PostgreSQL Source Code git master
Loading...
Searching...
No Matches
walsummarizer.h File Reference
#include "access/xlogdefs.h"
Include dependency graph for walsummarizer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Size WalSummarizerShmemSize (void)
 
void WalSummarizerShmemInit (void)
 
pg_noreturn void WalSummarizerMain (const void *startup_data, size_t startup_data_len)
 
void GetWalSummarizerState (TimeLineID *summarized_tli, XLogRecPtr *summarized_lsn, XLogRecPtr *pending_lsn, int *summarizer_pid)
 
XLogRecPtr GetOldestUnsummarizedLSN (TimeLineID *tli, bool *lsn_is_exact)
 
void WakeupWalSummarizer (void)
 
void WaitForWalSummarization (XLogRecPtr lsn)
 

Variables

PGDLLIMPORT bool summarize_wal
 
PGDLLIMPORT int wal_summary_keep_time
 

Function Documentation

◆ GetOldestUnsummarizedLSN()

XLogRecPtr GetOldestUnsummarizedLSN ( TimeLineID tli,
bool lsn_is_exact 
)
extern

Definition at line 505 of file walsummarizer.c.

506{
508 int n;
509 List *tles;
512 bool should_make_exact = false;
514 ListCell *lc;
516
517 /* If not summarizing WAL, do nothing. */
518 if (!summarize_wal)
519 return InvalidXLogRecPtr;
520
521 /*
522 * If we are not the WAL summarizer process, then we normally just want to
523 * read the values from shared memory. However, as an exception, if shared
524 * memory hasn't been initialized yet, then we need to do that so that we
525 * can read legal values and not remove any WAL too early.
526 */
528 {
530
532 {
534 if (tli != NULL)
536 if (lsn_is_exact != NULL)
537 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
539 return unsummarized_lsn;
540 }
541
543 }
544
545 /*
546 * Find the oldest timeline on which WAL still exists, and the earliest
547 * segment for which it exists.
548 *
549 * Note that we do this every time the WAL summarizer process restarts or
550 * recovers from an error, in case the contents of pg_wal have changed
551 * under us e.g. if some files were removed, either manually - which
552 * shouldn't really happen, but might - or by postgres itself, if
553 * summarize_wal was turned off and then back on again.
554 */
557 for (n = list_length(tles) - 1; n >= 0; --n)
558 {
561
563 if (oldest_segno != 0)
564 {
565 /* Compute oldest LSN that still exists on disk. */
568
569 unsummarized_tli = tle->tli;
570 break;
571 }
572 }
573
574 /*
575 * Don't try to summarize anything older than the end LSN of the newest
576 * summary file that exists for this timeline.
577 */
581 foreach(lc, existing_summaries)
582 {
584
585 if (ws->end_lsn > unsummarized_lsn)
586 {
587 unsummarized_lsn = ws->end_lsn;
588 should_make_exact = true;
589 }
590 }
591
592 /* It really should not be possible for us to find no WAL. */
593 if (unsummarized_tli == 0)
596 errmsg_internal("no WAL found on timeline %u", latest_tli));
597
598 /*
599 * If we're the WAL summarizer, we always want to store the values we just
600 * computed into shared memory, because those are the values we're going
601 * to use to drive our operation, and so they are the authoritative
602 * values. Otherwise, we only store values into shared memory if shared
603 * memory is uninitialized. Our values are not canonical in such a case,
604 * but it's better to have something than nothing, to guide WAL retention.
605 */
608 {
614 }
615 else
617
618 /* Also return the to the caller as required. */
619 if (tli != NULL)
621 if (lsn_is_exact != NULL)
622 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
624
625 return unsummarized_lsn;
626}
List * readTimeLineHistory(TimeLineID targetTLI)
Definition timeline.c:77
int errcode(int sqlerrcode)
Definition elog.c:874
int int errmsg_internal(const char *fmt,...) pg_attribute_printf(1
#define ERROR
Definition elog.h:39
#define ereport(elevel,...)
Definition elog.h:151
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition lwlock.c:1149
void LWLockRelease(LWLock *lock)
Definition lwlock.c:1766
@ LW_SHARED
Definition lwlock.h:105
@ LW_EXCLUSIVE
Definition lwlock.h:104
#define AmWalSummarizerProcess()
Definition miscadmin.h:392
#define lfirst(lc)
Definition pg_list.h:172
static int list_length(const List *l)
Definition pg_list.h:152
static void * list_nth(const List *list, int n)
Definition pg_list.h:331
static int fb(int x)
Definition pg_list.h:54
XLogRecPtr summarized_lsn
TimeLineID summarized_tli
XLogRecPtr pending_lsn
static XLogRecPtr GetLatestLSN(TimeLineID *tli)
static WalSummarizerData * WalSummarizerCtl
bool summarize_wal
List * GetWalSummaries(TimeLineID tli, XLogRecPtr start_lsn, XLogRecPtr end_lsn)
Definition walsummary.c:43
int wal_segment_size
Definition xlog.c:147
XLogSegNo XLogGetOldestSegno(TimeLineID tli)
Definition xlog.c:3795
#define XLogSegNoOffsetToRecPtr(segno, offset, wal_segsz_bytes, dest)
uint64 XLogRecPtr
Definition xlogdefs.h:21
#define InvalidXLogRecPtr
Definition xlogdefs.h:28
uint32 TimeLineID
Definition xlogdefs.h:63
uint64 XLogSegNo
Definition xlogdefs.h:52

References AmWalSummarizerProcess, ereport, errcode(), errmsg_internal(), ERROR, fb(), GetLatestLSN(), GetWalSummaries(), WalSummarizerData::initialized, InvalidXLogRecPtr, lfirst, list_length(), list_nth(), WalSummarizerData::lsn_is_exact, LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), WalSummarizerData::pending_lsn, readTimeLineHistory(), summarize_wal, WalSummarizerData::summarized_lsn, WalSummarizerData::summarized_tli, wal_segment_size, WalSummarizerCtl, XLogGetOldestSegno(), and XLogSegNoOffsetToRecPtr.

Referenced by KeepLogSeg(), and WalSummarizerMain().

◆ GetWalSummarizerState()

void GetWalSummarizerState ( TimeLineID summarized_tli,
XLogRecPtr summarized_lsn,
XLogRecPtr pending_lsn,
int summarizer_pid 
)
extern

Definition at line 447 of file walsummarizer.c.

449{
452 {
453 /*
454 * If initialized is false, the rest of the structure contents are
455 * undefined.
456 */
457 *summarized_tli = 0;
458 *summarized_lsn = InvalidXLogRecPtr;
459 *pending_lsn = InvalidXLogRecPtr;
460 *summarizer_pid = -1;
461 }
462 else
463 {
464 int summarizer_pgprocno = WalSummarizerCtl->summarizer_pgprocno;
465
466 *summarized_tli = WalSummarizerCtl->summarized_tli;
467 *summarized_lsn = WalSummarizerCtl->summarized_lsn;
468 if (summarizer_pgprocno == INVALID_PROC_NUMBER)
469 {
470 /*
471 * If the summarizer has exited, the fact that it had processed
472 * beyond summarized_lsn is irrelevant now.
473 */
474 *pending_lsn = WalSummarizerCtl->summarized_lsn;
475 *summarizer_pid = -1;
476 }
477 else
478 {
479 *pending_lsn = WalSummarizerCtl->pending_lsn;
480
481 /*
482 * We're not fussed about inexact answers here, since they could
483 * become stale instantly, so we don't bother taking the lock, but
484 * make sure that invalid PID values are normalized to -1.
485 */
486 *summarizer_pid = GetPGProcByNumber(summarizer_pgprocno)->pid;
487 if (*summarizer_pid <= 0)
488 *summarizer_pid = -1;
489 }
490 }
492}
#define GetPGProcByNumber(n)
Definition proc.h:503
#define INVALID_PROC_NUMBER
Definition procnumber.h:26
ProcNumber summarizer_pgprocno

References fb(), GetPGProcByNumber, WalSummarizerData::initialized, INVALID_PROC_NUMBER, InvalidXLogRecPtr, LW_SHARED, LWLockAcquire(), LWLockRelease(), WalSummarizerData::pending_lsn, WalSummarizerData::summarized_lsn, WalSummarizerData::summarized_tli, WalSummarizerData::summarizer_pgprocno, and WalSummarizerCtl.

Referenced by pg_get_wal_summarizer_state().

◆ WaitForWalSummarization()

void WaitForWalSummarization ( XLogRecPtr  lsn)
extern

Definition at line 660 of file walsummarizer.c.

661{
666 int deadcycles = 0;
667
669
670 while (1)
671 {
672 long timeout_in_ms = 10000;
673 XLogRecPtr summarized_lsn;
674 XLogRecPtr pending_lsn;
675
677
678 /* If WAL summarization is disabled while we're waiting, give up. */
679 if (!summarize_wal)
680 return;
681
682 /*
683 * If the LSN summarized on disk has reached the target value, stop.
684 */
686 summarized_lsn = WalSummarizerCtl->summarized_lsn;
687 pending_lsn = WalSummarizerCtl->pending_lsn;
689
690 /* If WAL summarization has progressed sufficiently, stop waiting. */
691 if (summarized_lsn >= lsn)
692 break;
693
694 /* Recheck current time. */
696
697 /* Have we finished the current cycle of waiting? */
700 {
701 long elapsed_seconds;
702
703 /* Begin new wait cycle. */
706
707 /*
708 * Keep track of the number of cycles during which there has been
709 * no progression of pending_lsn. If pending_lsn is not advancing,
710 * that means that not only are no new files appearing on disk,
711 * but we're not even incorporating new records into the in-memory
712 * state.
713 */
714 if (pending_lsn > prior_pending_lsn)
715 {
716 prior_pending_lsn = pending_lsn;
717 deadcycles = 0;
718 }
719 else
720 ++deadcycles;
721
722 /*
723 * If we've managed to wait for an entire minute without the WAL
724 * summarizer absorbing a single WAL record, error out; probably
725 * something is wrong.
726 *
727 * We could consider also erroring out if the summarizer is taking
728 * too long to catch up, but it's not clear what rate of progress
729 * would be acceptable and what would be too slow. So instead, we
730 * just try to error out in the case where there's no progress at
731 * all. That seems likely to catch a reasonable number of the
732 * things that can go wrong in practice (e.g. the summarizer
733 * process is completely hung, say because somebody hooked up a
734 * debugger to it or something) without giving up too quickly when
735 * the system is just slow.
736 */
737 if (deadcycles >= 6)
740 errmsg("WAL summarization is not progressing"),
741 errdetail("Summarization is needed through %X/%08X, but is stuck at %X/%08X on disk and %X/%08X in memory.",
742 LSN_FORMAT_ARGS(lsn),
743 LSN_FORMAT_ARGS(summarized_lsn),
744 LSN_FORMAT_ARGS(pending_lsn))));
745
746
747 /*
748 * Otherwise, just let the user know what's happening.
749 */
752 current_time) / 1000;
755 errmsg_plural("still waiting for WAL summarization through %X/%08X after %ld second",
756 "still waiting for WAL summarization through %X/%08X after %ld seconds",
758 LSN_FORMAT_ARGS(lsn),
760 errdetail("Summarization has reached %X/%08X on disk and %X/%08X in memory.",
761 LSN_FORMAT_ARGS(summarized_lsn),
762 LSN_FORMAT_ARGS(pending_lsn))));
763 }
764
765 /*
766 * Align the wait time to prevent drift. This doesn't really matter,
767 * but we'd like the warnings about how long we've been waiting to say
768 * 10 seconds, 20 seconds, 30 seconds, 40 seconds ... without ever
769 * drifting to something that is not a multiple of ten.
770 */
773
774 /* Wait and see. */
778 }
779
781}
long TimestampDifferenceMilliseconds(TimestampTz start_time, TimestampTz stop_time)
Definition timestamp.c:1751
TimestampTz GetCurrentTimestamp(void)
Definition timestamp.c:1639
bool ConditionVariableCancelSleep(void)
bool ConditionVariableTimedSleep(ConditionVariable *cv, long timeout, uint32 wait_event_info)
int64 TimestampTz
Definition timestamp.h:39
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define WARNING
Definition elog.h:36
int int int errmsg_plural(const char *fmt_singular, const char *fmt_plural, unsigned long n,...) pg_attribute_printf(1
#define CHECK_FOR_INTERRUPTS()
Definition miscadmin.h:123
static char * errmsg
ConditionVariable summary_file_cv
#define TimestampTzPlusMilliseconds(tz, ms)
Definition timestamp.h:85
#define LSN_FORMAT_ARGS(lsn)
Definition xlogdefs.h:47

References CHECK_FOR_INTERRUPTS, ConditionVariableCancelSleep(), ConditionVariableTimedSleep(), ereport, errcode(), errdetail(), errmsg, errmsg_plural(), ERROR, fb(), GetCurrentTimestamp(), InvalidXLogRecPtr, LSN_FORMAT_ARGS, LW_SHARED, LWLockAcquire(), LWLockRelease(), WalSummarizerData::pending_lsn, summarize_wal, WalSummarizerData::summarized_lsn, WalSummarizerData::summary_file_cv, TimestampDifferenceMilliseconds(), TimestampTzPlusMilliseconds, WalSummarizerCtl, and WARNING.

Referenced by CleanupAfterArchiveRecovery(), and PrepareForIncrementalBackup().

◆ WakeupWalSummarizer()

void WakeupWalSummarizer ( void  )
extern

Definition at line 637 of file walsummarizer.c.

638{
639 ProcNumber pgprocno;
640
641 if (WalSummarizerCtl == NULL)
642 return;
643
647
648 if (pgprocno != INVALID_PROC_NUMBER)
649 SetLatch(&GetPGProcByNumber(pgprocno)->procLatch);
650}
void SetLatch(Latch *latch)
Definition latch.c:290
int ProcNumber
Definition procnumber.h:24

References fb(), GetPGProcByNumber, INVALID_PROC_NUMBER, LW_SHARED, LWLockAcquire(), LWLockRelease(), SetLatch(), WalSummarizerData::summarizer_pgprocno, and WalSummarizerCtl.

Referenced by CreateCheckPoint().

◆ WalSummarizerMain()

pg_noreturn void WalSummarizerMain ( const void startup_data,
size_t  startup_data_len 
)
extern

Definition at line 214 of file walsummarizer.c.

215{
217 MemoryContext context;
218
219 /*
220 * Within this function, 'current_lsn' and 'current_tli' refer to the
221 * point from which the next WAL summary file should start. 'exact' is
222 * true if 'current_lsn' is known to be the start of a WAL record or WAL
223 * segment, and false if it might be in the middle of a record someplace.
224 *
225 * 'switch_lsn' and 'switch_tli', if set, are the LSN at which we need to
226 * switch to a new timeline and the timeline to which we need to switch.
227 * If not set, we either haven't figured out the answers yet or we're
228 * already on the latest timeline.
229 */
232 bool exact;
235
237
239
241 (errmsg_internal("WAL summarizer started")));
242
243 /*
244 * Properly accept or ignore signals the postmaster might send us
245 */
247 pqsignal(SIGINT, SIG_IGN); /* no query to cancel */
249 /* SIGQUIT handler was already set up by InitPostmasterChild */
253 pqsignal(SIGUSR2, SIG_IGN); /* not used */
254
255 /* Advertise ourselves. */
260
261 /* Create and switch to a memory context that we can reset on error. */
263 "Wal Summarizer",
265 MemoryContextSwitchTo(context);
266
267 /*
268 * Reset some signals that are accepted by postmaster but not here
269 */
271
272 /*
273 * If an exception is encountered, processing resumes here.
274 */
275 if (sigsetjmp(local_sigjmp_buf, 1) != 0)
276 {
277 /* Since not using PG_TRY, must reset error stack by hand */
279
280 /* Prevent interrupts while cleaning up */
282
283 /* Report the error to the server log */
285
286 /* Release resources we might have acquired. */
292 AtEOXact_Files(false);
293 AtEOXact_HashTables(false);
294
295 /*
296 * Now return to normal top-level context and clear ErrorContext for
297 * next time.
298 */
299 MemoryContextSwitchTo(context);
301
302 /* Flush any leaked data in the top-level context */
303 MemoryContextReset(context);
304
305 /* Now we can allow interrupts again */
307
308 /*
309 * Sleep for 10 seconds before attempting to resume operations in
310 * order to avoid excessive logging.
311 *
312 * Many of the likely error conditions are things that will repeat
313 * every time. For example, if the WAL can't be read or the summary
314 * can't be written, only administrator action will cure the problem.
315 * So a really fast retry time doesn't seem to be especially
316 * beneficial, and it will clutter the logs.
317 */
320 10000,
322 }
323
324 /* We can now handle ereport(ERROR) */
326
327 /*
328 * Unblock signals (they were blocked when the postmaster forked us)
329 */
331
332 /*
333 * Fetch information about previous progress from shared memory, and ask
334 * GetOldestUnsummarizedLSN to reset pending_lsn to summarized_lsn. We
335 * might be recovering from an error, and if so, pending_lsn might have
336 * advanced past summarized_lsn, but any WAL we read previously has been
337 * lost and will need to be reread.
338 *
339 * If we discover that WAL summarization is not enabled, just exit.
340 */
343 proc_exit(0);
344
345 /*
346 * Loop forever
347 */
348 for (;;)
349 {
353
354 /* Flush any leaked data in the top-level context */
355 MemoryContextReset(context);
356
357 /* Process any signals received recently. */
359
360 /* If it's time to remove any old WAL summaries, do that now. */
362
363 /* Find the LSN and TLI up to which we can safely summarize. */
365
366 /*
367 * If we're summarizing a historic timeline and we haven't yet
368 * computed the point at which to switch to the next timeline, do that
369 * now.
370 *
371 * Note that if this is a standby, what was previously the current
372 * timeline could become historic at any time.
373 *
374 * We could try to make this more efficient by caching the results of
375 * readTimeLineHistory when latest_tli has not changed, but since we
376 * only have to do this once per timeline switch, we probably wouldn't
377 * save any significant amount of work in practice.
378 */
380 {
382
385 errmsg_internal("switch point from TLI %u to TLI %u is at %X/%08X",
387 }
388
389 /*
390 * If we've reached the switch LSN, we can't summarize anything else
391 * on this timeline. Switch to the next timeline and go around again,
392 * backing up to the exact switch point if we passed it.
393 */
395 {
396 /* Restart summarization from switch point. */
399
400 /* Next timeline and switch point, if any, not yet known. */
402 switch_tli = 0;
403
404 /* Update (really, rewind, if needed) state in shared memory. */
411
412 continue;
413 }
414
415 /* Summarize WAL. */
421
422 /*
423 * Update state for next loop iteration.
424 *
425 * Next summary file should start from exactly where this one ended.
426 */
428 exact = true;
429
430 /* Update state in shared memory. */
437
438 /* Wake up anyone waiting for more summary files to be written. */
440 }
441}
void pgaio_error_cleanup(void)
Definition aio.c:1175
void AuxiliaryProcessMainCommon(void)
Definition auxprocess.c:40
XLogRecPtr tliSwitchPoint(TimeLineID tli, List *history, TimeLineID *nextTLI)
Definition timeline.c:573
sigset_t UnBlockSig
Definition pqsignal.c:22
#define Assert(condition)
Definition c.h:943
void ConditionVariableBroadcast(ConditionVariable *cv)
void AtEOXact_HashTables(bool isCommit)
Definition dynahash.c:1912
void EmitErrorReport(void)
Definition elog.c:1882
ErrorContextCallback * error_context_stack
Definition elog.c:99
void FlushErrorState(void)
Definition elog.c:2062
sigjmp_buf * PG_exception_stack
Definition elog.c:101
#define DEBUG1
Definition elog.h:30
void AtEOXact_Files(bool isCommit)
Definition fd.c:3214
ProcNumber MyProcNumber
Definition globals.c:90
void SignalHandlerForShutdownRequest(SIGNAL_ARGS)
Definition interrupt.c:104
void SignalHandlerForConfigReload(SIGNAL_ARGS)
Definition interrupt.c:61
void on_shmem_exit(pg_on_exit_callback function, Datum arg)
Definition ipc.c:372
void proc_exit(int code)
Definition ipc.c:105
int WaitLatch(Latch *latch, int wakeEvents, long timeout, uint32 wait_event_info)
Definition latch.c:172
void LWLockReleaseAll(void)
Definition lwlock.c:1865
void MemoryContextReset(MemoryContext context)
Definition mcxt.c:403
MemoryContext TopMemoryContext
Definition mcxt.c:166
#define AllocSetContextCreate
Definition memutils.h:129
#define ALLOCSET_DEFAULT_SIZES
Definition memutils.h:160
#define RESUME_INTERRUPTS()
Definition miscadmin.h:136
#define HOLD_INTERRUPTS()
Definition miscadmin.h:134
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
Definition palloc.h:124
#define pqsignal
Definition port.h:547
uint64_t Datum
Definition postgres.h:70
void procsignal_sigusr1_handler(SIGNAL_ARGS)
Definition procsignal.c:680
void ReleaseAuxProcessResources(bool isCommit)
Definition resowner.c:1016
static void pgstat_report_wait_end(void)
Definition wait_event.h:85
#define WL_TIMEOUT
#define WL_EXIT_ON_PM_DEATH
static XLogRecPtr SummarizeWAL(TimeLineID tli, XLogRecPtr start_lsn, bool exact, XLogRecPtr switch_lsn, XLogRecPtr maximum_lsn)
static void ProcessWalSummarizerInterrupts(void)
static void WalSummarizerShutdown(int code, Datum arg)
static void MaybeRemoveOldWalSummaries(void)
XLogRecPtr GetOldestUnsummarizedLSN(TimeLineID *tli, bool *lsn_is_exact)
#define SIGCHLD
Definition win32_port.h:168
#define SIGHUP
Definition win32_port.h:158
#define SIGPIPE
Definition win32_port.h:163
#define SIGUSR1
Definition win32_port.h:170
#define SIGALRM
Definition win32_port.h:164
#define SIGUSR2
Definition win32_port.h:171
#define XLogRecPtrIsValid(r)
Definition xlogdefs.h:29

References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, AtEOXact_Files(), AtEOXact_HashTables(), AuxiliaryProcessMainCommon(), ConditionVariableBroadcast(), ConditionVariableCancelSleep(), DEBUG1, EmitErrorReport(), ereport, errmsg_internal(), error_context_stack, fb(), FlushErrorState(), GetLatestLSN(), GetOldestUnsummarizedLSN(), HOLD_INTERRUPTS, InvalidXLogRecPtr, LSN_FORMAT_ARGS, WalSummarizerData::lsn_is_exact, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), LWLockReleaseAll(), MaybeRemoveOldWalSummaries(), MemoryContextReset(), MemoryContextSwitchTo(), MyProcNumber, on_shmem_exit(), WalSummarizerData::pending_lsn, PG_exception_stack, pgaio_error_cleanup(), pgstat_report_wait_end(), pqsignal, proc_exit(), ProcessWalSummarizerInterrupts(), procsignal_sigusr1_handler(), readTimeLineHistory(), ReleaseAuxProcessResources(), RESUME_INTERRUPTS, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), SIGPIPE, SIGUSR1, SIGUSR2, WalSummarizerData::summarized_lsn, WalSummarizerData::summarized_tli, WalSummarizerData::summarizer_pgprocno, SummarizeWAL(), WalSummarizerData::summary_file_cv, tliSwitchPoint(), TopMemoryContext, UnBlockSig, WaitLatch(), WalSummarizerCtl, WalSummarizerShutdown(), WL_EXIT_ON_PM_DEATH, WL_TIMEOUT, and XLogRecPtrIsValid.

◆ WalSummarizerShmemInit()

void WalSummarizerShmemInit ( void  )
extern

Definition at line 183 of file walsummarizer.c.

184{
185 bool found;
186
188 ShmemInitStruct("Wal Summarizer Ctl", WalSummarizerShmemSize(),
189 &found);
190
191 if (!found)
192 {
193 /*
194 * First time through, so initialize.
195 *
196 * We're just filling in dummy values here -- the real initialization
197 * will happen when GetOldestUnsummarizedLSN() is called for the first
198 * time.
199 */
207 }
208}
void ConditionVariableInit(ConditionVariable *cv)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
Definition shmem.c:408
Size WalSummarizerShmemSize(void)

References ConditionVariableInit(), WalSummarizerData::initialized, INVALID_PROC_NUMBER, InvalidXLogRecPtr, WalSummarizerData::lsn_is_exact, WalSummarizerData::pending_lsn, ShmemInitStruct(), WalSummarizerData::summarized_lsn, WalSummarizerData::summarized_tli, WalSummarizerData::summarizer_pgprocno, WalSummarizerData::summary_file_cv, WalSummarizerCtl, and WalSummarizerShmemSize().

Referenced by CreateOrAttachShmemStructs().

◆ WalSummarizerShmemSize()

Size WalSummarizerShmemSize ( void  )
extern

Definition at line 174 of file walsummarizer.c.

175{
176 return sizeof(WalSummarizerData);
177}

Referenced by CalculateShmemSize(), and WalSummarizerShmemInit().

Variable Documentation

◆ summarize_wal

◆ wal_summary_keep_time

PGDLLIMPORT int wal_summary_keep_time
extern

Definition at line 146 of file walsummarizer.c.

Referenced by MaybeRemoveOldWalSummaries().