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

Function RegisterRelcacheInvalidation

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

* RegisterRelcacheInvalidation * * As above, but register a relcache invalidation event. */

Source from the content-addressed store, hash-verified

542 * As above, but register a relcache invalidation event.
543 */
544static void
545RegisterRelcacheInvalidation(Oid dbId, Oid relId)
546{
547 AddRelcacheInvalidationMessage(&transInvalInfo->CurrentCmdInvalidMsgs,
548 dbId, relId);
549
550 /*
551 * Most of the time, relcache invalidation is associated with system
552 * catalog updates, but there are a few cases where it isn't. Quick hack
553 * to ensure that the next CommandCounterIncrement() will think that we
554 * need to do CommandEndInvalidationMessages().
555 */
556 (void) GetCurrentCommandId(true);
557
558 /*
559 * If the relation being invalidated is one of those cached in a relcache
560 * init file, mark that we need to zap that file at commit. For simplicity
561 * invalidations for a specific database always invalidate the shared file
562 * as well. Also zap when we are invalidating whole relcache.
563 */
564 if (relId == InvalidOid || RelationIdIsInInitFile(relId))
565 transInvalInfo->RelcacheInitFileInval = true;
566}
567
568#ifdef USE_ASSERT_CHECKING
569static char *

Callers 4

CacheInvalidateHeapTupleFunction · 0.85
CacheInvalidateRelcacheFunction · 0.85

Calls 3

GetCurrentCommandIdFunction · 0.85
RelationIdIsInInitFileFunction · 0.85

Tested by

no test coverage detected