PostgreSQL Source Code  git master
bgwriter.h File Reference
#include "storage/block.h"
#include "storage/relfilelocator.h"
#include "storage/smgr.h"
#include "storage/sync.h"
Include dependency graph for bgwriter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void BackgroundWriterMain (char *startup_data, size_t startup_data_len) pg_attribute_noreturn()
 
void CheckpointerMain (char *startup_data, size_t startup_data_len) pg_attribute_noreturn()
 
void RequestCheckpoint (int flags)
 
void CheckpointWriteDelay (int flags, double progress)
 
bool ForwardSyncRequest (const FileTag *ftag, SyncRequestType type)
 
void AbsorbSyncRequests (void)
 
Size CheckpointerShmemSize (void)
 
void CheckpointerShmemInit (void)
 
bool FirstCallSinceLastCheckpoint (void)
 

Variables

PGDLLIMPORT int BgWriterDelay
 
PGDLLIMPORT int CheckPointTimeout
 
PGDLLIMPORT int CheckPointWarning
 
PGDLLIMPORT double CheckPointCompletionTarget
 

Function Documentation

◆ AbsorbSyncRequests()

void AbsorbSyncRequests ( void  )

Definition at line 1260 of file checkpointer.c.

1261 {
1262  CheckpointerRequest *requests = NULL;
1263  CheckpointerRequest *request;
1264  int n;
1265 
1266  if (!AmCheckpointerProcess())
1267  return;
1268 
1269  LWLockAcquire(CheckpointerCommLock, LW_EXCLUSIVE);
1270 
1271  /*
1272  * We try to avoid holding the lock for a long time by copying the request
1273  * array, and processing the requests after releasing the lock.
1274  *
1275  * Once we have cleared the requests from shared memory, we have to PANIC
1276  * if we then fail to absorb them (eg, because our hashtable runs out of
1277  * memory). This is because the system cannot run safely if we are unable
1278  * to fsync what we have been told to fsync. Fortunately, the hashtable
1279  * is so small that the problem is quite unlikely to arise in practice.
1280  */
1282  if (n > 0)
1283  {
1284  requests = (CheckpointerRequest *) palloc(n * sizeof(CheckpointerRequest));
1285  memcpy(requests, CheckpointerShmem->requests, n * sizeof(CheckpointerRequest));
1286  }
1287 
1289 
1291 
1292  LWLockRelease(CheckpointerCommLock);
1293 
1294  for (request = requests; n > 0; request++, n--)
1295  RememberSyncRequest(&request->ftag, request->type);
1296 
1297  END_CRIT_SECTION();
1298 
1299  if (requests)
1300  pfree(requests);
1301 }
static CheckpointerShmemStruct * CheckpointerShmem
Definition: checkpointer.c:128
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition: lwlock.c:1170
void LWLockRelease(LWLock *lock)
Definition: lwlock.c:1783
@ LW_EXCLUSIVE
Definition: lwlock.h:114
void pfree(void *pointer)
Definition: mcxt.c:1520
void * palloc(Size size)
Definition: mcxt.c:1316
#define AmCheckpointerProcess()
Definition: miscadmin.h:381
#define START_CRIT_SECTION()
Definition: miscadmin.h:149
#define END_CRIT_SECTION()
Definition: miscadmin.h:151
SyncRequestType type
Definition: checkpointer.c:104
CheckpointerRequest requests[FLEXIBLE_ARRAY_MEMBER]
Definition: checkpointer.c:125
void RememberSyncRequest(const FileTag *ftag, SyncRequestType type)
Definition: sync.c:487

References AmCheckpointerProcess, CheckpointerShmem, END_CRIT_SECTION, CheckpointerRequest::ftag, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), CheckpointerShmemStruct::num_requests, palloc(), pfree(), RememberSyncRequest(), CheckpointerShmemStruct::requests, START_CRIT_SECTION, and CheckpointerRequest::type.

Referenced by CheckpointerMain(), CheckpointWriteDelay(), ProcessSyncRequests(), SyncPostCheckpoint(), and SyncPreCheckpoint().

◆ BackgroundWriterMain()

void BackgroundWriterMain ( char *  startup_data,
size_t  startup_data_len 
)

Definition at line 87 of file bgwriter.c.

88 {
89  sigjmp_buf local_sigjmp_buf;
90  MemoryContext bgwriter_context;
91  bool prev_hibernate;
92  WritebackContext wb_context;
93 
94  Assert(startup_data_len == 0);
95 
98 
99  /*
100  * Properly accept or ignore signals that might be sent to us.
101  */
103  pqsignal(SIGINT, SIG_IGN);
105  /* SIGQUIT handler was already set up by InitPostmasterChild */
110 
111  /*
112  * Reset some signals that are accepted by postmaster but not here
113  */
115 
116  /*
117  * We just started, assume there has been either a shutdown or
118  * end-of-recovery snapshot.
119  */
121 
122  /*
123  * Create a memory context that we will do all our work in. We do this so
124  * that we can reset the context during error recovery and thereby avoid
125  * possible memory leaks. Formerly this code just ran in
126  * TopMemoryContext, but resetting that would be a really bad idea.
127  */
128  bgwriter_context = AllocSetContextCreate(TopMemoryContext,
129  "Background Writer",
131  MemoryContextSwitchTo(bgwriter_context);
132 
134 
135  /*
136  * If an exception is encountered, processing resumes here.
137  *
138  * You might wonder why this isn't coded as an infinite loop around a
139  * PG_TRY construct. The reason is that this is the bottom of the
140  * exception stack, and so with PG_TRY there would be no exception handler
141  * in force at all during the CATCH part. By leaving the outermost setjmp
142  * always active, we have at least some chance of recovering from an error
143  * during error recovery. (If we get into an infinite loop thereby, it
144  * will soon be stopped by overflow of elog.c's internal state stack.)
145  *
146  * Note that we use sigsetjmp(..., 1), so that the prevailing signal mask
147  * (to wit, BlockSig) will be restored when longjmp'ing to here. Thus,
148  * signals other than SIGQUIT will be blocked until we complete error
149  * recovery. It might seem that this policy makes the HOLD_INTERRUPTS()
150  * call redundant, but it is not since InterruptPending might be set
151  * already.
152  */
153  if (sigsetjmp(local_sigjmp_buf, 1) != 0)
154  {
155  /* Since not using PG_TRY, must reset error stack by hand */
156  error_context_stack = NULL;
157 
158  /* Prevent interrupts while cleaning up */
159  HOLD_INTERRUPTS();
160 
161  /* Report the error to the server log */
162  EmitErrorReport();
163 
164  /*
165  * These operations are really just a minimal subset of
166  * AbortTransaction(). We don't have very many resources to worry
167  * about in bgwriter, but we do have LWLocks, buffers, and temp files.
168  */
171  UnlockBuffers();
173  AtEOXact_Buffers(false);
174  AtEOXact_SMgr();
175  AtEOXact_Files(false);
176  AtEOXact_HashTables(false);
177 
178  /*
179  * Now return to normal top-level context and clear ErrorContext for
180  * next time.
181  */
182  MemoryContextSwitchTo(bgwriter_context);
183  FlushErrorState();
184 
185  /* Flush any leaked data in the top-level context */
186  MemoryContextReset(bgwriter_context);
187 
188  /* re-initialize to avoid repeated errors causing problems */
190 
191  /* Now we can allow interrupts again */
193 
194  /*
195  * Sleep at least 1 second after any error. A write error is likely
196  * to be repeated, and we don't want to be filling the error logs as
197  * fast as we can.
198  */
199  pg_usleep(1000000L);
200 
201  /* Report wait end here, when there is no further possibility of wait */
203  }
204 
205  /* We can now handle ereport(ERROR) */
206  PG_exception_stack = &local_sigjmp_buf;
207 
208  /*
209  * Unblock signals (they were blocked when the postmaster forked us)
210  */
211  sigprocmask(SIG_SETMASK, &UnBlockSig, NULL);
212 
213  /*
214  * Reset hibernation state after any error.
215  */
216  prev_hibernate = false;
217 
218  /*
219  * Loop forever
220  */
221  for (;;)
222  {
223  bool can_hibernate;
224  int rc;
225 
226  /* Clear any already-pending wakeups */
228 
230 
231  /*
232  * Do one cycle of dirty-buffer writing.
233  */
234  can_hibernate = BgBufferSync(&wb_context);
235 
236  /* Report pending statistics to the cumulative stats system */
238  pgstat_report_wal(true);
239 
241  {
242  /*
243  * After any checkpoint, free all smgr objects. Otherwise we
244  * would never do so for dropped relations, as the bgwriter does
245  * not process shared invalidation messages or call
246  * AtEOXact_SMgr().
247  */
248  smgrdestroyall();
249  }
250 
251  /*
252  * Log a new xl_running_xacts every now and then so replication can
253  * get into a consistent state faster (think of suboverflowed
254  * snapshots) and clean up resources (locks, KnownXids*) more
255  * frequently. The costs of this are relatively low, so doing it 4
256  * times (LOG_SNAPSHOT_INTERVAL_MS) a minute seems fine.
257  *
258  * We assume the interval for writing xl_running_xacts is
259  * significantly bigger than BgWriterDelay, so we don't complicate the
260  * overall timeout handling but just assume we're going to get called
261  * often enough even if hibernation mode is active. It's not that
262  * important that LOG_SNAPSHOT_INTERVAL_MS is met strictly. To make
263  * sure we're not waking the disk up unnecessarily on an idle system
264  * we check whether there has been any WAL inserted since the last
265  * time we've logged a running xacts.
266  *
267  * We do this logging in the bgwriter as it is the only process that
268  * is run regularly and returns to its mainloop all the time. E.g.
269  * Checkpointer, when active, is barely ever in its mainloop and thus
270  * makes it hard to log regularly.
271  */
273  {
274  TimestampTz timeout = 0;
276 
279 
280  /*
281  * Only log if enough time has passed and interesting records have
282  * been inserted since the last snapshot. Have to compare with <=
283  * instead of < because GetLastImportantRecPtr() points at the
284  * start of a record, whereas last_snapshot_lsn points just past
285  * the end of the record.
286  */
287  if (now >= timeout &&
289  {
292  }
293  }
294 
295  /*
296  * Sleep until we are signaled or BgWriterDelay has elapsed.
297  *
298  * Note: the feedback control loop in BgBufferSync() expects that we
299  * will call it every BgWriterDelay msec. While it's not critical for
300  * correctness that that be exact, the feedback loop might misbehave
301  * if we stray too far from that. Hence, avoid loading this process
302  * down with latch events that are likely to happen frequently during
303  * normal operation.
304  */
305  rc = WaitLatch(MyLatch,
307  BgWriterDelay /* ms */ , WAIT_EVENT_BGWRITER_MAIN);
308 
309  /*
310  * If no latch event and BgBufferSync says nothing's happening, extend
311  * the sleep in "hibernation" mode, where we sleep for much longer
312  * than bgwriter_delay says. Fewer wakeups save electricity. When a
313  * backend starts using buffers again, it will wake us up by setting
314  * our latch. Because the extra sleep will persist only as long as no
315  * buffer allocations happen, this should not distort the behavior of
316  * BgBufferSync's control loop too badly; essentially, it will think
317  * that the system-wide idle interval didn't exist.
318  *
319  * There is a race condition here, in that a backend might allocate a
320  * buffer between the time BgBufferSync saw the alloc count as zero
321  * and the time we call StrategyNotifyBgWriter. While it's not
322  * critical that we not hibernate anyway, we try to reduce the odds of
323  * that by only hibernating when BgBufferSync says nothing's happening
324  * for two consecutive cycles. Also, we mitigate any possible
325  * consequences of a missed wakeup by not hibernating forever.
326  */
327  if (rc == WL_TIMEOUT && can_hibernate && prev_hibernate)
328  {
329  /* Ask for notification at next buffer allocation */
331  /* Sleep ... */
332  (void) WaitLatch(MyLatch,
335  WAIT_EVENT_BGWRITER_HIBERNATE);
336  /* Reset the notification request in case we timed out */
338  }
339 
340  prev_hibernate = can_hibernate;
341  }
342 }
void AuxiliaryProcessMainCommon(void)
Definition: auxprocess.c:44
sigset_t UnBlockSig
Definition: pqsignal.c:22
TimestampTz GetCurrentTimestamp(void)
Definition: timestamp.c:1654
Datum now(PG_FUNCTION_ARGS)
Definition: timestamp.c:1618
static XLogRecPtr last_snapshot_lsn
Definition: bgwriter.c:77
static TimestampTz last_snapshot_ts
Definition: bgwriter.c:76
int BgWriterDelay
Definition: bgwriter.c:57
#define HIBERNATE_FACTOR
Definition: bgwriter.c:63
#define LOG_SNAPSHOT_INTERVAL_MS
Definition: bgwriter.c:69
void AtEOXact_Buffers(bool isCommit)
Definition: bufmgr.c:3502
bool BgBufferSync(WritebackContext *wb_context)
Definition: bufmgr.c:3131
void UnlockBuffers(void)
Definition: bufmgr.c:5057
int bgwriter_flush_after
Definition: bufmgr.c:171
void WritebackContextInit(WritebackContext *context, int *max_pending)
Definition: bufmgr.c:5830
#define Assert(condition)
Definition: c.h:858
bool FirstCallSinceLastCheckpoint(void)
bool ConditionVariableCancelSleep(void)
int64 TimestampTz
Definition: timestamp.h:39
void AtEOXact_HashTables(bool isCommit)
Definition: dynahash.c:1869
void EmitErrorReport(void)
Definition: elog.c:1672
ErrorContextCallback * error_context_stack
Definition: elog.c:94
void FlushErrorState(void)
Definition: elog.c:1836
sigjmp_buf * PG_exception_stack
Definition: elog.c:96
void AtEOXact_Files(bool isCommit)
Definition: fd.c:3165
void StrategyNotifyBgWriter(int bgwprocno)
Definition: freelist.c:431
ProcNumber MyProcNumber
Definition: globals.c:87
struct Latch * MyLatch
Definition: globals.c:60
void SignalHandlerForShutdownRequest(SIGNAL_ARGS)
Definition: interrupt.c:105
void SignalHandlerForConfigReload(SIGNAL_ARGS)
Definition: interrupt.c:61
void HandleMainLoopInterrupts(void)
Definition: interrupt.c:34
void ResetLatch(Latch *latch)
Definition: latch.c:724
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
Definition: latch.c:517
#define WL_TIMEOUT
Definition: latch.h:130
#define WL_EXIT_ON_PM_DEATH
Definition: latch.h:132
#define WL_LATCH_SET
Definition: latch.h:127
void LWLockReleaseAll(void)
Definition: lwlock.c:1878
void MemoryContextReset(MemoryContext context)
Definition: mcxt.c:383
MemoryContext TopMemoryContext
Definition: mcxt.c:149
#define AllocSetContextCreate
Definition: memutils.h:129
#define ALLOCSET_DEFAULT_SIZES
Definition: memutils.h:160
#define RESUME_INTERRUPTS()
Definition: miscadmin.h:135
#define HOLD_INTERRUPTS()
Definition: miscadmin.h:133
@ B_BG_WRITER
Definition: miscadmin.h:356
BackendType MyBackendType
Definition: miscinit.c:63
void pgstat_report_bgwriter(void)
void pgstat_report_wal(bool force)
Definition: pgstat_wal.c:48
pqsigfunc pqsignal(int signo, pqsigfunc func)
void procsignal_sigusr1_handler(SIGNAL_ARGS)
Definition: procsignal.c:635
MemoryContextSwitchTo(old_ctx)
void ReleaseAuxProcessResources(bool isCommit)
Definition: resowner.c:1002
void pg_usleep(long microsec)
Definition: signal.c:53
void smgrdestroyall(void)
Definition: smgr.c:332
void AtEOXact_SMgr(void)
Definition: smgr.c:807
XLogRecPtr LogStandbySnapshot(void)
Definition: standby.c:1285
#define TimestampTzPlusMilliseconds(tz, ms)
Definition: timestamp.h:85
static void pgstat_report_wait_end(void)
Definition: wait_event.h:104
#define SIGCHLD
Definition: win32_port.h:178
#define SIGHUP
Definition: win32_port.h:168
#define SIG_DFL
Definition: win32_port.h:163
#define SIGPIPE
Definition: win32_port.h:173
#define SIGUSR1
Definition: win32_port.h:180
#define SIGALRM
Definition: win32_port.h:174
#define SIGUSR2
Definition: win32_port.h:181
#define SIG_IGN
Definition: win32_port.h:165
bool RecoveryInProgress(void)
Definition: xlog.c:6290
XLogRecPtr GetLastImportantRecPtr(void)
Definition: xlog.c:6493
#define XLogStandbyInfoActive()
Definition: xlog.h:121

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, AtEOXact_Buffers(), AtEOXact_Files(), AtEOXact_HashTables(), AtEOXact_SMgr(), AuxiliaryProcessMainCommon(), B_BG_WRITER, BgBufferSync(), bgwriter_flush_after, BgWriterDelay, ConditionVariableCancelSleep(), EmitErrorReport(), error_context_stack, FirstCallSinceLastCheckpoint(), FlushErrorState(), GetCurrentTimestamp(), GetLastImportantRecPtr(), HandleMainLoopInterrupts(), HIBERNATE_FACTOR, HOLD_INTERRUPTS, last_snapshot_lsn, last_snapshot_ts, LOG_SNAPSHOT_INTERVAL_MS, LogStandbySnapshot(), LWLockReleaseAll(), MemoryContextReset(), MemoryContextSwitchTo(), MyBackendType, MyLatch, MyProcNumber, now(), PG_exception_stack, pg_usleep(), pgstat_report_bgwriter(), pgstat_report_wait_end(), pgstat_report_wal(), pqsignal(), procsignal_sigusr1_handler(), RecoveryInProgress(), ReleaseAuxProcessResources(), ResetLatch(), RESUME_INTERRUPTS, SIG_DFL, SIG_IGN, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), SIGPIPE, SIGUSR1, SIGUSR2, smgrdestroyall(), StrategyNotifyBgWriter(), TimestampTzPlusMilliseconds, TopMemoryContext, UnBlockSig, UnlockBuffers(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, WritebackContextInit(), and XLogStandbyInfoActive.

◆ CheckpointerMain()

void CheckpointerMain ( char *  startup_data,
size_t  startup_data_len 
)

Definition at line 173 of file checkpointer.c.

174 {
175  sigjmp_buf local_sigjmp_buf;
176  MemoryContext checkpointer_context;
177 
178  Assert(startup_data_len == 0);
179 
182 
184 
185  /*
186  * Properly accept or ignore signals the postmaster might send us
187  *
188  * Note: we deliberately ignore SIGTERM, because during a standard Unix
189  * system shutdown cycle, init will SIGTERM all processes at once. We
190  * want to wait for the backends to exit, whereupon the postmaster will
191  * tell us it's okay to shut down (via SIGUSR2).
192  */
194  pqsignal(SIGINT, ReqCheckpointHandler); /* request checkpoint */
195  pqsignal(SIGTERM, SIG_IGN); /* ignore SIGTERM */
196  /* SIGQUIT handler was already set up by InitPostmasterChild */
201 
202  /*
203  * Reset some signals that are accepted by postmaster but not here
204  */
206 
207  /*
208  * Initialize so that first time-driven event happens at the correct time.
209  */
211 
212  /*
213  * Write out stats after shutdown. This needs to be called by exactly one
214  * process during a normal shutdown, and since checkpointer is shut down
215  * very late...
216  *
217  * Walsenders are shut down after the checkpointer, but currently don't
218  * report stats. If that changes, we need a more complicated solution.
219  */
221 
222  /*
223  * Create a memory context that we will do all our work in. We do this so
224  * that we can reset the context during error recovery and thereby avoid
225  * possible memory leaks. Formerly this code just ran in
226  * TopMemoryContext, but resetting that would be a really bad idea.
227  */
228  checkpointer_context = AllocSetContextCreate(TopMemoryContext,
229  "Checkpointer",
231  MemoryContextSwitchTo(checkpointer_context);
232 
233  /*
234  * If an exception is encountered, processing resumes here.
235  *
236  * You might wonder why this isn't coded as an infinite loop around a
237  * PG_TRY construct. The reason is that this is the bottom of the
238  * exception stack, and so with PG_TRY there would be no exception handler
239  * in force at all during the CATCH part. By leaving the outermost setjmp
240  * always active, we have at least some chance of recovering from an error
241  * during error recovery. (If we get into an infinite loop thereby, it
242  * will soon be stopped by overflow of elog.c's internal state stack.)
243  *
244  * Note that we use sigsetjmp(..., 1), so that the prevailing signal mask
245  * (to wit, BlockSig) will be restored when longjmp'ing to here. Thus,
246  * signals other than SIGQUIT will be blocked until we complete error
247  * recovery. It might seem that this policy makes the HOLD_INTERRUPTS()
248  * call redundant, but it is not since InterruptPending might be set
249  * already.
250  */
251  if (sigsetjmp(local_sigjmp_buf, 1) != 0)
252  {
253  /* Since not using PG_TRY, must reset error stack by hand */
254  error_context_stack = NULL;
255 
256  /* Prevent interrupts while cleaning up */
257  HOLD_INTERRUPTS();
258 
259  /* Report the error to the server log */
260  EmitErrorReport();
261 
262  /*
263  * These operations are really just a minimal subset of
264  * AbortTransaction(). We don't have very many resources to worry
265  * about in checkpointer, but we do have LWLocks, buffers, and temp
266  * files.
267  */
271  UnlockBuffers();
273  AtEOXact_Buffers(false);
274  AtEOXact_SMgr();
275  AtEOXact_Files(false);
276  AtEOXact_HashTables(false);
277 
278  /* Warn any waiting backends that the checkpoint failed. */
279  if (ckpt_active)
280  {
285 
287 
288  ckpt_active = false;
289  }
290 
291  /*
292  * Now return to normal top-level context and clear ErrorContext for
293  * next time.
294  */
295  MemoryContextSwitchTo(checkpointer_context);
296  FlushErrorState();
297 
298  /* Flush any leaked data in the top-level context */
299  MemoryContextReset(checkpointer_context);
300 
301  /* Now we can allow interrupts again */
303 
304  /*
305  * Sleep at least 1 second after any error. A write error is likely
306  * to be repeated, and we don't want to be filling the error logs as
307  * fast as we can.
308  */
309  pg_usleep(1000000L);
310  }
311 
312  /* We can now handle ereport(ERROR) */
313  PG_exception_stack = &local_sigjmp_buf;
314 
315  /*
316  * Unblock signals (they were blocked when the postmaster forked us)
317  */
318  sigprocmask(SIG_SETMASK, &UnBlockSig, NULL);
319 
320  /*
321  * Ensure all shared memory values are set correctly for the config. Doing
322  * this here ensures no race conditions from other concurrent updaters.
323  */
325 
326  /*
327  * Advertise our latch that backends can use to wake us up while we're
328  * sleeping.
329  */
331 
332  /*
333  * Loop forever
334  */
335  for (;;)
336  {
337  bool do_checkpoint = false;
338  int flags = 0;
339  pg_time_t now;
340  int elapsed_secs;
341  int cur_timeout;
342  bool chkpt_or_rstpt_requested = false;
343  bool chkpt_or_rstpt_timed = false;
344 
345  /* Clear any already-pending wakeups */
347 
348  /*
349  * Process any requests or signals received recently.
350  */
353 
354  /*
355  * Detect a pending checkpoint request by checking whether the flags
356  * word in shared memory is nonzero. We shouldn't need to acquire the
357  * ckpt_lck for this.
358  */
359  if (((volatile CheckpointerShmemStruct *) CheckpointerShmem)->ckpt_flags)
360  {
361  do_checkpoint = true;
362  chkpt_or_rstpt_requested = true;
363  }
364 
365  /*
366  * Force a checkpoint if too much time has elapsed since the last one.
367  * Note that we count a timed checkpoint in stats only when this
368  * occurs without an external request, but we set the CAUSE_TIME flag
369  * bit even if there is also an external request.
370  */
371  now = (pg_time_t) time(NULL);
372  elapsed_secs = now - last_checkpoint_time;
373  if (elapsed_secs >= CheckPointTimeout)
374  {
375  if (!do_checkpoint)
376  chkpt_or_rstpt_timed = true;
377  do_checkpoint = true;
378  flags |= CHECKPOINT_CAUSE_TIME;
379  }
380 
381  /*
382  * Do a checkpoint if requested.
383  */
384  if (do_checkpoint)
385  {
386  bool ckpt_performed = false;
387  bool do_restartpoint;
388 
389  /* Check if we should perform a checkpoint or a restartpoint. */
390  do_restartpoint = RecoveryInProgress();
391 
392  /*
393  * Atomically fetch the request flags to figure out what kind of a
394  * checkpoint we should perform, and increase the started-counter
395  * to acknowledge that we've started a new checkpoint.
396  */
398  flags |= CheckpointerShmem->ckpt_flags;
402 
404 
405  /*
406  * The end-of-recovery checkpoint is a real checkpoint that's
407  * performed while we're still in recovery.
408  */
409  if (flags & CHECKPOINT_END_OF_RECOVERY)
410  do_restartpoint = false;
411 
412  if (chkpt_or_rstpt_timed)
413  {
414  chkpt_or_rstpt_timed = false;
415  if (do_restartpoint)
417  else
419  }
420 
421  if (chkpt_or_rstpt_requested)
422  {
423  chkpt_or_rstpt_requested = false;
424  if (do_restartpoint)
426  else
428  }
429 
430  /*
431  * We will warn if (a) too soon since last checkpoint (whatever
432  * caused it) and (b) somebody set the CHECKPOINT_CAUSE_XLOG flag
433  * since the last checkpoint start. Note in particular that this
434  * implementation will not generate warnings caused by
435  * CheckPointTimeout < CheckPointWarning.
436  */
437  if (!do_restartpoint &&
438  (flags & CHECKPOINT_CAUSE_XLOG) &&
439  elapsed_secs < CheckPointWarning)
440  ereport(LOG,
441  (errmsg_plural("checkpoints are occurring too frequently (%d second apart)",
442  "checkpoints are occurring too frequently (%d seconds apart)",
443  elapsed_secs,
444  elapsed_secs),
445  errhint("Consider increasing the configuration parameter max_wal_size.")));
446 
447  /*
448  * Initialize checkpointer-private variables used during
449  * checkpoint.
450  */
451  ckpt_active = true;
452  if (do_restartpoint)
454  else
458 
459  /*
460  * Do the checkpoint.
461  */
462  if (!do_restartpoint)
463  {
464  CreateCheckPoint(flags);
465  ckpt_performed = true;
466  }
467  else
468  ckpt_performed = CreateRestartPoint(flags);
469 
470  /*
471  * After any checkpoint, free all smgr objects. Otherwise we
472  * would never do so for dropped relations, as the checkpointer
473  * does not process shared invalidation messages or call
474  * AtEOXact_SMgr().
475  */
476  smgrdestroyall();
477 
478  /*
479  * Indicate checkpoint completion to any waiting backends.
480  */
484 
486 
487  if (ckpt_performed)
488  {
489  /*
490  * Note we record the checkpoint start time not end time as
491  * last_checkpoint_time. This is so that time-driven
492  * checkpoints happen at a predictable spacing.
493  */
495 
496  if (do_restartpoint)
498  }
499  else
500  {
501  /*
502  * We were not able to perform the restartpoint (checkpoints
503  * throw an ERROR in case of error). Most likely because we
504  * have not received any new checkpoint WAL records since the
505  * last restartpoint. Try again in 15 s.
506  */
508  }
509 
510  ckpt_active = false;
511 
512  /* We may have received an interrupt during the checkpoint. */
514  }
515 
516  /* Check for archive_timeout and switch xlog files if necessary. */
518 
519  /* Report pending statistics to the cumulative stats system */
521  pgstat_report_wal(true);
522 
523  /*
524  * If any checkpoint flags have been set, redo the loop to handle the
525  * checkpoint without sleeping.
526  */
527  if (((volatile CheckpointerShmemStruct *) CheckpointerShmem)->ckpt_flags)
528  continue;
529 
530  /*
531  * Sleep until we are signaled or it's time for another checkpoint or
532  * xlog file switch.
533  */
534  now = (pg_time_t) time(NULL);
535  elapsed_secs = now - last_checkpoint_time;
536  if (elapsed_secs >= CheckPointTimeout)
537  continue; /* no sleep for us ... */
538  cur_timeout = CheckPointTimeout - elapsed_secs;
540  {
541  elapsed_secs = now - last_xlog_switch_time;
542  if (elapsed_secs >= XLogArchiveTimeout)
543  continue; /* no sleep for us ... */
544  cur_timeout = Min(cur_timeout, XLogArchiveTimeout - elapsed_secs);
545  }
546 
547  (void) WaitLatch(MyLatch,
549  cur_timeout * 1000L /* convert to ms */ ,
550  WAIT_EVENT_CHECKPOINTER_MAIN);
551  }
552 }
#define Min(x, y)
Definition: c.h:1004
static void UpdateSharedMemoryConfig(void)
static XLogRecPtr ckpt_start_recptr
Definition: checkpointer.c:147
static void ReqCheckpointHandler(SIGNAL_ARGS)
Definition: checkpointer.c:859
static void CheckArchiveTimeout(void)
Definition: checkpointer.c:623
static double ckpt_cached_elapsed
Definition: checkpointer.c:148
static bool ckpt_active
Definition: checkpointer.c:143
static void HandleCheckpointerInterrupts(void)
Definition: checkpointer.c:558
void AbsorbSyncRequests(void)
static pg_time_t last_xlog_switch_time
Definition: checkpointer.c:151
int CheckPointWarning
Definition: checkpointer.c:137
int CheckPointTimeout
Definition: checkpointer.c:136
static pg_time_t last_checkpoint_time
Definition: checkpointer.c:150
static pg_time_t ckpt_start_time
Definition: checkpointer.c:146
void ConditionVariableBroadcast(ConditionVariable *cv)
int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...)
Definition: elog.c:1182
int errhint(const char *fmt,...)
Definition: elog.c:1319
#define LOG
Definition: elog.h:31
#define ereport(elevel,...)
Definition: elog.h:149
int MyProcPid
Definition: globals.c:45
void before_shmem_exit(pg_on_exit_callback function, Datum arg)
Definition: ipc.c:337
@ B_CHECKPOINTER
Definition: miscadmin.h:357
void pgstat_before_server_shutdown(int code, Datum arg)
Definition: pgstat.c:462
void pgstat_report_checkpointer(void)
PgStat_CheckpointerStats PendingCheckpointerStats
int64 pg_time_t
Definition: pgtime.h:23
#define SpinLockRelease(lock)
Definition: spin.h:64
#define SpinLockAcquire(lock)
Definition: spin.h:62
PGPROC * MyProc
Definition: proc.c:66
PROC_HDR * ProcGlobal
Definition: proc.c:78
ConditionVariable done_cv
Definition: checkpointer.c:121
ConditionVariable start_cv
Definition: checkpointer.c:120
Latch procLatch
Definition: proc.h:165
Latch * checkpointerLatch
Definition: proc.h:414
PgStat_Counter restartpoints_requested
Definition: pgstat.h:266
PgStat_Counter num_requested
Definition: pgstat.h:264
PgStat_Counter restartpoints_timed
Definition: pgstat.h:265
PgStat_Counter num_timed
Definition: pgstat.h:263
PgStat_Counter restartpoints_performed
Definition: pgstat.h:267
bool CreateRestartPoint(int flags)
Definition: xlog.c:7512
XLogRecPtr GetInsertRecPtr(void)
Definition: xlog.c:6438
int XLogArchiveTimeout
Definition: xlog.c:118
void CreateCheckPoint(int flags)
Definition: xlog.c:6821
#define CHECKPOINT_CAUSE_XLOG
Definition: xlog.h:146
#define CHECKPOINT_END_OF_RECOVERY
Definition: xlog.h:138
#define CHECKPOINT_CAUSE_TIME
Definition: xlog.h:147
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)

References AbsorbSyncRequests(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, AtEOXact_Buffers(), AtEOXact_Files(), AtEOXact_HashTables(), AtEOXact_SMgr(), AuxiliaryProcessMainCommon(), B_CHECKPOINTER, before_shmem_exit(), CheckArchiveTimeout(), CHECKPOINT_CAUSE_TIME, CHECKPOINT_CAUSE_XLOG, CHECKPOINT_END_OF_RECOVERY, CheckpointerShmemStruct::checkpointer_pid, PROC_HDR::checkpointerLatch, CheckpointerShmem, CheckPointTimeout, CheckPointWarning, ckpt_active, ckpt_cached_elapsed, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_failed, CheckpointerShmemStruct::ckpt_flags, CheckpointerShmemStruct::ckpt_lck, ckpt_start_recptr, ckpt_start_time, CheckpointerShmemStruct::ckpt_started, ConditionVariableBroadcast(), ConditionVariableCancelSleep(), CreateCheckPoint(), CreateRestartPoint(), CheckpointerShmemStruct::done_cv, EmitErrorReport(), ereport, errhint(), errmsg_plural(), error_context_stack, FlushErrorState(), GetInsertRecPtr(), GetXLogReplayRecPtr(), HandleCheckpointerInterrupts(), HOLD_INTERRUPTS, last_checkpoint_time, last_xlog_switch_time, LOG, LWLockReleaseAll(), MemoryContextReset(), MemoryContextSwitchTo(), Min, MyBackendType, MyLatch, MyProc, MyProcPid, now(), PgStat_CheckpointerStats::num_requested, PgStat_CheckpointerStats::num_timed, PendingCheckpointerStats, PG_exception_stack, pg_usleep(), pgstat_before_server_shutdown(), pgstat_report_checkpointer(), pgstat_report_wait_end(), pgstat_report_wal(), pqsignal(), ProcGlobal, PGPROC::procLatch, procsignal_sigusr1_handler(), RecoveryInProgress(), ReleaseAuxProcessResources(), ReqCheckpointHandler(), ResetLatch(), PgStat_CheckpointerStats::restartpoints_performed, PgStat_CheckpointerStats::restartpoints_requested, PgStat_CheckpointerStats::restartpoints_timed, RESUME_INTERRUPTS, SIG_DFL, SIG_IGN, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), SIGPIPE, SIGUSR1, SIGUSR2, smgrdestroyall(), SpinLockAcquire, SpinLockRelease, CheckpointerShmemStruct::start_cv, TopMemoryContext, UnBlockSig, UnlockBuffers(), UpdateSharedMemoryConfig(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, and XLogArchiveTimeout.

◆ CheckpointerShmemInit()

void CheckpointerShmemInit ( void  )

Definition at line 898 of file checkpointer.c.

899 {
901  bool found;
902 
904  ShmemInitStruct("Checkpointer Data",
905  size,
906  &found);
907 
908  if (!found)
909  {
910  /*
911  * First time through, so initialize. Note that we zero the whole
912  * requests array; this is so that CompactCheckpointerRequestQueue can
913  * assume that any pad bytes in the request structs are zeroes.
914  */
920  }
921 }
#define MemSet(start, val, len)
Definition: c.h:1020
size_t Size
Definition: c.h:605
Size CheckpointerShmemSize(void)
Definition: checkpointer.c:879
void ConditionVariableInit(ConditionVariable *cv)
int NBuffers
Definition: globals.c:139
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
Definition: shmem.c:387
static pg_noinline void Size size
Definition: slab.c:607
#define SpinLockInit(lock)
Definition: spin.h:60

References CheckpointerShmem, CheckpointerShmemSize(), CheckpointerShmemStruct::ckpt_lck, ConditionVariableInit(), CheckpointerShmemStruct::done_cv, CheckpointerShmemStruct::max_requests, MemSet, NBuffers, ShmemInitStruct(), size, SpinLockInit, and CheckpointerShmemStruct::start_cv.

Referenced by CreateOrAttachShmemStructs().

◆ CheckpointerShmemSize()

Size CheckpointerShmemSize ( void  )

Definition at line 879 of file checkpointer.c.

880 {
881  Size size;
882 
883  /*
884  * Currently, the size of the requests[] array is arbitrarily set equal to
885  * NBuffers. This may prove too large or small ...
886  */
887  size = offsetof(CheckpointerShmemStruct, requests);
889 
890  return size;
891 }
Size add_size(Size s1, Size s2)
Definition: shmem.c:493
Size mul_size(Size s1, Size s2)
Definition: shmem.c:510

References add_size(), mul_size(), NBuffers, and size.

Referenced by CalculateShmemSize(), and CheckpointerShmemInit().

◆ CheckpointWriteDelay()

void CheckpointWriteDelay ( int  flags,
double  progress 
)

Definition at line 711 of file checkpointer.c.

712 {
713  static int absorb_counter = WRITES_PER_ABSORB;
714 
715  /* Do nothing if checkpoint is being executed by non-checkpointer process */
716  if (!AmCheckpointerProcess())
717  return;
718 
719  /*
720  * Perform the usual duties and take a nap, unless we're behind schedule,
721  * in which case we just try to catch up as quickly as possible.
722  */
723  if (!(flags & CHECKPOINT_IMMEDIATE) &&
727  {
729  {
730  ConfigReloadPending = false;
732  /* update shmem copies of config variables */
734  }
735 
737  absorb_counter = WRITES_PER_ABSORB;
738 
740 
741  /* Report interim statistics to the cumulative stats system */
743 
744  /*
745  * This sleep used to be connected to bgwriter_delay, typically 200ms.
746  * That resulted in more frequent wakeups if not much work to do.
747  * Checkpointer and bgwriter are no longer related so take the Big
748  * Sleep.
749  */
751  100,
752  WAIT_EVENT_CHECKPOINT_WRITE_DELAY);
754  }
755  else if (--absorb_counter <= 0)
756  {
757  /*
758  * Absorb pending fsync requests after each WRITES_PER_ABSORB write
759  * operations even when we don't sleep, to prevent overflow of the
760  * fsync request queue.
761  */
763  absorb_counter = WRITES_PER_ABSORB;
764  }
765 
766  /* Check for barrier events. */
769 }
static bool ImmediateCheckpointRequested(void)
Definition: checkpointer.c:684
static bool IsCheckpointOnSchedule(double progress)
Definition: checkpointer.c:780
#define WRITES_PER_ABSORB
Definition: checkpointer.c:131
volatile sig_atomic_t ProcSignalBarrierPending
Definition: globals.c:38
@ PGC_SIGHUP
Definition: guc.h:71
void ProcessConfigFile(GucContext context)
volatile sig_atomic_t ShutdownRequestPending
Definition: interrupt.c:28
volatile sig_atomic_t ConfigReloadPending
Definition: interrupt.c:27
int progress
Definition: pgbench.c:261
void ProcessProcSignalBarrier(void)
Definition: procsignal.c:464
#define CHECKPOINT_IMMEDIATE
Definition: xlog.h:139

References AbsorbSyncRequests(), AmCheckpointerProcess, CheckArchiveTimeout(), CHECKPOINT_IMMEDIATE, ConfigReloadPending, ImmediateCheckpointRequested(), IsCheckpointOnSchedule(), MyLatch, PGC_SIGHUP, pgstat_report_checkpointer(), ProcessConfigFile(), ProcessProcSignalBarrier(), ProcSignalBarrierPending, progress, ResetLatch(), ShutdownRequestPending, UpdateSharedMemoryConfig(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, and WRITES_PER_ABSORB.

Referenced by BufferSync().

◆ FirstCallSinceLastCheckpoint()

bool FirstCallSinceLastCheckpoint ( void  )

Definition at line 1326 of file checkpointer.c.

1327 {
1328  static int ckpt_done = 0;
1329  int new_done;
1330  bool FirstCall = false;
1331 
1333  new_done = CheckpointerShmem->ckpt_done;
1335 
1336  if (new_done != ckpt_done)
1337  FirstCall = true;
1338 
1339  ckpt_done = new_done;
1340 
1341  return FirstCall;
1342 }

References CheckpointerShmem, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_lck, SpinLockAcquire, and SpinLockRelease.

Referenced by BackgroundWriterMain().

◆ ForwardSyncRequest()

bool ForwardSyncRequest ( const FileTag ftag,
SyncRequestType  type 
)

Definition at line 1093 of file checkpointer.c.

1094 {
1095  CheckpointerRequest *request;
1096  bool too_full;
1097 
1098  if (!IsUnderPostmaster)
1099  return false; /* probably shouldn't even get here */
1100 
1101  if (AmCheckpointerProcess())
1102  elog(ERROR, "ForwardSyncRequest must not be called in checkpointer");
1103 
1104  LWLockAcquire(CheckpointerCommLock, LW_EXCLUSIVE);
1105 
1106  /*
1107  * If the checkpointer isn't running or the request queue is full, the
1108  * backend will have to perform its own fsync request. But before forcing
1109  * that to happen, we can try to compact the request queue.
1110  */
1111  if (CheckpointerShmem->checkpointer_pid == 0 ||
1114  {
1115  LWLockRelease(CheckpointerCommLock);
1116  return false;
1117  }
1118 
1119  /* OK, insert request */
1121  request->ftag = *ftag;
1122  request->type = type;
1123 
1124  /* If queue is more than half full, nudge the checkpointer to empty it */
1125  too_full = (CheckpointerShmem->num_requests >=
1127 
1128  LWLockRelease(CheckpointerCommLock);
1129 
1130  /* ... but not till after we release the lock */
1131  if (too_full && ProcGlobal->checkpointerLatch)
1133 
1134  return true;
1135 }
static bool CompactCheckpointerRequestQueue(void)
#define ERROR
Definition: elog.h:39
#define elog(elevel,...)
Definition: elog.h:224
bool IsUnderPostmaster
Definition: globals.c:117
void SetLatch(Latch *latch)
Definition: latch.c:632
const char * type

References AmCheckpointerProcess, CheckpointerShmemStruct::checkpointer_pid, PROC_HDR::checkpointerLatch, CheckpointerShmem, CompactCheckpointerRequestQueue(), elog, ERROR, CheckpointerRequest::ftag, IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), CheckpointerShmemStruct::max_requests, CheckpointerShmemStruct::num_requests, ProcGlobal, CheckpointerShmemStruct::requests, SetLatch(), CheckpointerRequest::type, and type.

Referenced by RegisterSyncRequest().

◆ RequestCheckpoint()

void RequestCheckpoint ( int  flags)

Definition at line 941 of file checkpointer.c.

942 {
943  int ntries;
944  int old_failed,
945  old_started;
946 
947  /*
948  * If in a standalone backend, just do it ourselves.
949  */
951  {
952  /*
953  * There's no point in doing slow checkpoints in a standalone backend,
954  * because there's no other backends the checkpoint could disrupt.
955  */
957 
958  /* Free all smgr objects, as CheckpointerMain() normally would. */
959  smgrdestroyall();
960 
961  return;
962  }
963 
964  /*
965  * Atomically set the request flags, and take a snapshot of the counters.
966  * When we see ckpt_started > old_started, we know the flags we set here
967  * have been seen by checkpointer.
968  *
969  * Note that we OR the flags with any existing flags, to avoid overriding
970  * a "stronger" request by another backend. The flag senses must be
971  * chosen to make this work!
972  */
974 
975  old_failed = CheckpointerShmem->ckpt_failed;
976  old_started = CheckpointerShmem->ckpt_started;
978 
980 
981  /*
982  * Send signal to request checkpoint. It's possible that the checkpointer
983  * hasn't started yet, or is in process of restarting, so we will retry a
984  * few times if needed. (Actually, more than a few times, since on slow
985  * or overloaded buildfarm machines, it's been observed that the
986  * checkpointer can take several seconds to start.) However, if not told
987  * to wait for the checkpoint to occur, we consider failure to send the
988  * signal to be nonfatal and merely LOG it. The checkpointer should see
989  * the request when it does start, with or without getting a signal.
990  */
991 #define MAX_SIGNAL_TRIES 600 /* max wait 60.0 sec */
992  for (ntries = 0;; ntries++)
993  {
995  {
996  if (ntries >= MAX_SIGNAL_TRIES || !(flags & CHECKPOINT_WAIT))
997  {
998  elog((flags & CHECKPOINT_WAIT) ? ERROR : LOG,
999  "could not signal for checkpoint: checkpointer is not running");
1000  break;
1001  }
1002  }
1003  else if (kill(CheckpointerShmem->checkpointer_pid, SIGINT) != 0)
1004  {
1005  if (ntries >= MAX_SIGNAL_TRIES || !(flags & CHECKPOINT_WAIT))
1006  {
1007  elog((flags & CHECKPOINT_WAIT) ? ERROR : LOG,
1008  "could not signal for checkpoint: %m");
1009  break;
1010  }
1011  }
1012  else
1013  break; /* signal sent successfully */
1014 
1016  pg_usleep(100000L); /* wait 0.1 sec, then retry */
1017  }
1018 
1019  /*
1020  * If requested, wait for completion. We detect completion according to
1021  * the algorithm given above.
1022  */
1023  if (flags & CHECKPOINT_WAIT)
1024  {
1025  int new_started,
1026  new_failed;
1027 
1028  /* Wait for a new checkpoint to start. */
1030  for (;;)
1031  {
1033  new_started = CheckpointerShmem->ckpt_started;
1035 
1036  if (new_started != old_started)
1037  break;
1038 
1040  WAIT_EVENT_CHECKPOINT_START);
1041  }
1043 
1044  /*
1045  * We are waiting for ckpt_done >= new_started, in a modulo sense.
1046  */
1048  for (;;)
1049  {
1050  int new_done;
1051 
1053  new_done = CheckpointerShmem->ckpt_done;
1054  new_failed = CheckpointerShmem->ckpt_failed;
1056 
1057  if (new_done - new_started >= 0)
1058  break;
1059 
1061  WAIT_EVENT_CHECKPOINT_DONE);
1062  }
1064 
1065  if (new_failed != old_failed)
1066  ereport(ERROR,
1067  (errmsg("checkpoint request failed"),
1068  errhint("Consult recent messages in the server log for details.")));
1069  }
1070 }
#define MAX_SIGNAL_TRIES
void ConditionVariablePrepareToSleep(ConditionVariable *cv)
void ConditionVariableSleep(ConditionVariable *cv, uint32 wait_event_info)
int errmsg(const char *fmt,...)
Definition: elog.c:1072
bool IsPostmasterEnvironment
Definition: globals.c:116
#define CHECK_FOR_INTERRUPTS()
Definition: miscadmin.h:122
#define kill(pid, sig)
Definition: win32_port.h:485
#define CHECKPOINT_REQUESTED
Definition: xlog.h:144
#define CHECKPOINT_WAIT
Definition: xlog.h:143

References CHECK_FOR_INTERRUPTS, CHECKPOINT_IMMEDIATE, CHECKPOINT_REQUESTED, CHECKPOINT_WAIT, CheckpointerShmemStruct::checkpointer_pid, CheckpointerShmem, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_failed, CheckpointerShmemStruct::ckpt_flags, CheckpointerShmemStruct::ckpt_lck, CheckpointerShmemStruct::ckpt_started, ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), CreateCheckPoint(), CheckpointerShmemStruct::done_cv, elog, ereport, errhint(), errmsg(), ERROR, IsPostmasterEnvironment, kill, LOG, MAX_SIGNAL_TRIES, pg_usleep(), smgrdestroyall(), SpinLockAcquire, SpinLockRelease, and CheckpointerShmemStruct::start_cv.

Referenced by CreateDatabaseUsingFileCopy(), do_pg_backup_start(), dropdb(), DropTableSpace(), movedb(), PerformRecoveryXLogAction(), standard_ProcessUtility(), StartupXLOG(), XLogPageRead(), and XLogWrite().

Variable Documentation

◆ BgWriterDelay

PGDLLIMPORT int BgWriterDelay
extern

Definition at line 57 of file bgwriter.c.

Referenced by BackgroundWriterMain(), and BgBufferSync().

◆ CheckPointCompletionTarget

PGDLLIMPORT double CheckPointCompletionTarget
extern

◆ CheckPointTimeout

PGDLLIMPORT int CheckPointTimeout
extern

Definition at line 136 of file checkpointer.c.

Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().

◆ CheckPointWarning

PGDLLIMPORT int CheckPointWarning
extern

Definition at line 137 of file checkpointer.c.

Referenced by CheckpointerMain().