MCPcopy Create free account
hub / github.com/apache/cloudberry / AddCatcacheInvalidationMessage

Function AddCatcacheInvalidationMessage

src/backend/utils/cache/inval.c:371–394  ·  view source on GitHub ↗

* Add a catcache inval entry */

Source from the content-addressed store, hash-verified

369 * Add a catcache inval entry
370 */
371static void
372AddCatcacheInvalidationMessage(InvalidationListHeader *hdr,
373 int id, uint32 hashValue, Oid dbId)
374{
375 SharedInvalidationMessage msg;
376
377 Assert(id < CHAR_MAX);
378 msg.cc.id = (int8) id;
379 msg.cc.dbId = dbId;
380 msg.cc.hashValue = hashValue;
381
382 /*
383 * Define padding bytes in SharedInvalidationMessage structs to be
384 * defined. Otherwise the sinvaladt.c ringbuffer, which is accessed by
385 * multiple processes, will cause spurious valgrind warnings about
386 * undefined memory being used. That's because valgrind remembers the
387 * undefined bytes from the last local process's store, not realizing that
388 * another process has written since, filling the previously uninitialized
389 * bytes
390 */
391 VALGRIND_MAKE_MEM_DEFINED(&msg, sizeof(msg));
392
393 AddInvalidationMessage(&hdr->cclist, &msg);
394}
395
396/*
397 * Add a whole-catalog inval entry

Callers 1

Calls 1

AddInvalidationMessageFunction · 0.85

Tested by

no test coverage detected