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 504 of file walsummarizer.c.

505{
507 int n;
508 List *tles;
511 bool should_make_exact = false;
513 ListCell *lc;
515
516 /* If not summarizing WAL, do nothing. */
517 if (!summarize_wal)
518 return InvalidXLogRecPtr;
519
520 /*
521 * If we are not the WAL summarizer process, then we normally just want to
522 * read the values from shared memory. However, as an exception, if shared
523 * memory hasn't been initialized yet, then we need to do that so that we
524 * can read legal values and not remove any WAL too early.
525 */
527 {
529
531 {
533 if (tli != NULL)
535 if (lsn_is_exact != NULL)
536 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
538 return unsummarized_lsn;
539 }
540
542 }
543
544 /*
545 * Find the oldest timeline on which WAL still exists, and the earliest
546 * segment for which it exists.
547 *
548 * Note that we do this every time the WAL summarizer process restarts or
549 * recovers from an error, in case the contents of pg_wal have changed
550 * under us e.g. if some files were removed, either manually - which
551 * shouldn't really happen, but might - or by postgres itself, if
552 * summarize_wal was turned off and then back on again.
553 */
556 for (n = list_length(tles) - 1; n >= 0; --n)
557 {
560
562 if (oldest_segno != 0)
563 {
564 /* Compute oldest LSN that still exists on disk. */
567
568 unsummarized_tli = tle->tli;
569 break;
570 }
571 }
572
573 /*
574 * Don't try to summarize anything older than the end LSN of the newest
575 * summary file that exists for this timeline.
576 */
580 foreach(lc, existing_summaries)
581 {
583
584 if (ws->end_lsn > unsummarized_lsn)
585 {
586 unsummarized_lsn = ws->end_lsn;
587 should_make_exact = true;
588 }
589 }
590
591 /* It really should not be possible for us to find no WAL. */
592 if (unsummarized_tli == 0)
595 errmsg_internal("no WAL found on timeline %u", latest_tli));
596
597 /*
598 * If we're the WAL summarizer, we always want to store the values we just
599 * computed into shared memory, because those are the values we're going
600 * to use to drive our operation, and so they are the authoritative
601 * values. Otherwise, we only store values into shared memory if shared
602 * memory is uninitialized. Our values are not canonical in such a case,
603 * but it's better to have something than nothing, to guide WAL retention.
604 */
607 {
613 }
614 else
616
617 /* Also return the to the caller as required. */
618 if (tli != NULL)
620 if (lsn_is_exact != NULL)
621 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
623
624 return unsummarized_lsn;
625}
List * readTimeLineHistory(TimeLineID targetTLI)
Definition timeline.c:76
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:150
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition lwlock.c:1176
void LWLockRelease(LWLock *lock)
Definition lwlock.c:1793
@ LW_SHARED
Definition lwlock.h:113
@ LW_EXCLUSIVE
Definition lwlock.h:112
#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:299
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:146
XLogSegNo XLogGetOldestSegno(TimeLineID tli)
Definition xlog.c:3811
#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 446 of file walsummarizer.c.

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

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

637{
638 ProcNumber pgprocno;
639
640 if (WalSummarizerCtl == NULL)
641 return;
642
646
647 if (pgprocno != INVALID_PROC_NUMBER)
648 SetLatch(&GetPGProcByNumber(pgprocno)->procLatch);
649}
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 213 of file walsummarizer.c.

214{
216 MemoryContext context;
217
218 /*
219 * Within this function, 'current_lsn' and 'current_tli' refer to the
220 * point from which the next WAL summary file should start. 'exact' is
221 * true if 'current_lsn' is known to be the start of a WAL record or WAL
222 * segment, and false if it might be in the middle of a record someplace.
223 *
224 * 'switch_lsn' and 'switch_tli', if set, are the LSN at which we need to
225 * switch to a new timeline and the timeline to which we need to switch.
226 * If not set, we either haven't figured out the answers yet or we're
227 * already on the latest timeline.
228 */
231 bool exact;
234
236
238
240 (errmsg_internal("WAL summarizer started")));
241
242 /*
243 * Properly accept or ignore signals the postmaster might send us
244 */
246 pqsignal(SIGINT, SIG_IGN); /* no query to cancel */
248 /* SIGQUIT handler was already set up by InitPostmasterChild */
252 pqsignal(SIGUSR2, SIG_IGN); /* not used */
253
254 /* Advertise ourselves. */
259
260 /* Create and switch to a memory context that we can reset on error. */
262 "Wal Summarizer",
264 MemoryContextSwitchTo(context);
265
266 /*
267 * Reset some signals that are accepted by postmaster but not here
268 */
270
271 /*
272 * If an exception is encountered, processing resumes here.
273 */
274 if (sigsetjmp(local_sigjmp_buf, 1) != 0)
275 {
276 /* Since not using PG_TRY, must reset error stack by hand */
278
279 /* Prevent interrupts while cleaning up */
281
282 /* Report the error to the server log */
284
285 /* Release resources we might have acquired. */
291 AtEOXact_Files(false);
292 AtEOXact_HashTables(false);
293
294 /*
295 * Now return to normal top-level context and clear ErrorContext for
296 * next time.
297 */
298 MemoryContextSwitchTo(context);
300
301 /* Flush any leaked data in the top-level context */
302 MemoryContextReset(context);
303
304 /* Now we can allow interrupts again */
306
307 /*
308 * Sleep for 10 seconds before attempting to resume operations in
309 * order to avoid excessive logging.
310 *
311 * Many of the likely error conditions are things that will repeat
312 * every time. For example, if the WAL can't be read or the summary
313 * can't be written, only administrator action will cure the problem.
314 * So a really fast retry time doesn't seem to be especially
315 * beneficial, and it will clutter the logs.
316 */
319 10000,
321 }
322
323 /* We can now handle ereport(ERROR) */
325
326 /*
327 * Unblock signals (they were blocked when the postmaster forked us)
328 */
330
331 /*
332 * Fetch information about previous progress from shared memory, and ask
333 * GetOldestUnsummarizedLSN to reset pending_lsn to summarized_lsn. We
334 * might be recovering from an error, and if so, pending_lsn might have
335 * advanced past summarized_lsn, but any WAL we read previously has been
336 * lost and will need to be reread.
337 *
338 * If we discover that WAL summarization is not enabled, just exit.
339 */
342 proc_exit(0);
343
344 /*
345 * Loop forever
346 */
347 for (;;)
348 {
352
353 /* Flush any leaked data in the top-level context */
354 MemoryContextReset(context);
355
356 /* Process any signals received recently. */
358
359 /* If it's time to remove any old WAL summaries, do that now. */
361
362 /* Find the LSN and TLI up to which we can safely summarize. */
364
365 /*
366 * If we're summarizing a historic timeline and we haven't yet
367 * computed the point at which to switch to the next timeline, do that
368 * now.
369 *
370 * Note that if this is a standby, what was previously the current
371 * timeline could become historic at any time.
372 *
373 * We could try to make this more efficient by caching the results of
374 * readTimeLineHistory when latest_tli has not changed, but since we
375 * only have to do this once per timeline switch, we probably wouldn't
376 * save any significant amount of work in practice.
377 */
379 {
381
384 errmsg_internal("switch point from TLI %u to TLI %u is at %X/%08X",
386 }
387
388 /*
389 * If we've reached the switch LSN, we can't summarize anything else
390 * on this timeline. Switch to the next timeline and go around again,
391 * backing up to the exact switch point if we passed it.
392 */
394 {
395 /* Restart summarization from switch point. */
398
399 /* Next timeline and switch point, if any, not yet known. */
401 switch_tli = 0;
402
403 /* Update (really, rewind, if needed) state in shared memory. */
410
411 continue;
412 }
413
414 /* Summarize WAL. */
420
421 /*
422 * Update state for next loop iteration.
423 *
424 * Next summary file should start from exactly where this one ended.
425 */
427 exact = true;
428
429 /* Update state in shared memory. */
436
437 /* Wake up anyone waiting for more summary files to be written. */
439 }
440}
void pgaio_error_cleanup(void)
Definition aio.c:1165
void AuxiliaryProcessMainCommon(void)
Definition auxprocess.c:39
XLogRecPtr tliSwitchPoint(TimeLineID tli, List *history, TimeLineID *nextTLI)
Definition timeline.c:572
sigset_t UnBlockSig
Definition pqsignal.c:22
#define Assert(condition)
Definition c.h:885
void ConditionVariableBroadcast(ConditionVariable *cv)
void AtEOXact_HashTables(bool isCommit)
Definition dynahash.c:1931
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:3213
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:1892
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:679
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 182 of file walsummarizer.c.

183{
184 bool found;
185
187 ShmemInitStruct("Wal Summarizer Ctl", WalSummarizerShmemSize(),
188 &found);
189
190 if (!found)
191 {
192 /*
193 * First time through, so initialize.
194 *
195 * We're just filling in dummy values here -- the real initialization
196 * will happen when GetOldestUnsummarizedLSN() is called for the first
197 * time.
198 */
206 }
207}
void ConditionVariableInit(ConditionVariable *cv)
void * ShmemInitStruct(const char *name, Size size, bool *foundPtr)
Definition shmem.c:378
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 173 of file walsummarizer.c.

174{
175 return sizeof(WalSummarizerData);
176}

Referenced by CalculateShmemSize(), and WalSummarizerShmemInit().

Variable Documentation

◆ summarize_wal

◆ wal_summary_keep_time

PGDLLIMPORT int wal_summary_keep_time
extern

Definition at line 145 of file walsummarizer.c.

Referenced by MaybeRemoveOldWalSummaries().