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

Function SyncPreCheckpoint

src/backend/storage/sync/sync.c:195–213  ·  view source on GitHub ↗

* SyncPreCheckpoint() -- Do pre-checkpoint work * * To distinguish unlink requests that arrived before this checkpoint * started from those that arrived during the checkpoint, we use a cycle * counter similar to the one we use for fsync requests. That cycle * counter is incremented here. * * This must be called *before* the checkpoint REDO point is determined. * That ensures that we won't

Source from the content-addressed store, hash-verified

193 * that the checkpoint will be completed.
194 */
195void
196SyncPreCheckpoint(void)
197{
198 /*
199 * Operations such as DROP TABLESPACE assume that the next checkpoint will
200 * process all recently forwarded unlink requests, but if they aren't
201 * absorbed prior to advancing the cycle counter, they won't be processed
202 * until a future checkpoint. The following absorb ensures that any
203 * unlink requests forwarded before the checkpoint began will be processed
204 * in the current checkpoint.
205 */
206 AbsorbSyncRequests();
207
208 /*
209 * Any unlink requests arriving after this point will be assigned the next
210 * cycle counter, and won't be unlinked until next checkpoint.
211 */
212 checkpoint_cycle_ctr++;
213}
214
215/*
216 * SyncPostCheckpoint() -- Do post-checkpoint work

Callers 1

CreateCheckPointFunction · 0.85

Calls 1

AbsorbSyncRequestsFunction · 0.85

Tested by

no test coverage detected