/* * Initialize CommitTs at system startup (postmaster start or standalone * backend) */ void CommitTsShmemInit(void) { bool found; CommitTsCtl->PagePrecedes = CommitTsPagePrecedes; SimpleLruInit(CommitTsCtl, "commit_timestamp", CommitTsShmemBuffers(), 0, CommitTsControlLock, "pg_commit_ts", LWTRANCHE_COMMITTS_BUFFERS); commitTsShared = ShmemInitStruct("CommitTs shared", sizeof(CommitTimestampShared), &found); if (!IsUnderPostmaster) { Assert(!found); commitTsShared->xidLastCommit = InvalidTransactionId; TIMESTAMP_NOBEGIN(commitTsShared->dataLastCommit.time); commitTsShared->dataLastCommit.nodeid = InvalidRepOriginId; commitTsShared->commitTsActive = false; } else Assert(found); }
void DistributedLog_ShmemInit(void) { bool found; /* Set up SLRU for the distributed log. */ DistributedLogCtl->PagePrecedes = DistributedLog_PagePrecedes; SimpleLruInit(DistributedLogCtl, "DistributedLogCtl", NUM_DISTRIBUTEDLOG_BUFFERS, DistributedLogControlLock, DISTRIBUTEDLOG_DIR); /* Create or attach to the shared structure */ DistributedLogShared = (DistributedLogShmem *) ShmemInitStruct( "DistributedLogShmem", DistributedLog_SharedShmemSize(), &found); if (!DistributedLogShared) elog(FATAL, "could not initialize Distributed Log shared memory"); if (!found) { DistributedLogShared->oldestXid = InvalidTransactionId; DistributedLogShared->knowHighestUnusedPage = false; DistributedLogShared->highestUnusedPage = -1; } }
void DistributedXidMapShmemInit_SLru(void) { DistributedXidMapCtl->PagePrecedes = DistributedXidMapPagePrecedes; SimpleLruInit(DistributedXidMapCtl, "DistributedXidMap Ctl", NUM_DISTRIBUTEDXIDMAP_BUFFERS, DistributedXidMapControlLock, DISTRIBUTEDXIDMAP_DIR); /* Override default assumption that writes should be fsync'd */ DistributedXidMapCtl->do_fsync = false; }
void SUBTRANSShmemInit(void) { SubTransCtl->PagePrecedes = SubTransPagePrecedes; SimpleLruInit(SubTransCtl, "SUBTRANS Ctl", NUM_SUBTRANS_BUFFERS, 0, SubtransControlLock, "pg_subtrans"); /* Override default assumption that writes should be fsync'd */ SubTransCtl->do_fsync = false; }