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

508{
510 int n;
511 List *tles;
514 bool should_make_exact = false;
516 ListCell *lc;
518
519 /* If not summarizing WAL, do nothing. */
520 if (!summarize_wal)
521 return InvalidXLogRecPtr;
522
523 /*
524 * If we are not the WAL summarizer process, then we normally just want to
525 * read the values from shared memory. However, as an exception, if shared
526 * memory hasn't been initialized yet, then we need to do that so that we
527 * can read legal values and not remove any WAL too early.
528 */
530 {
532
534 {
536 if (tli != NULL)
538 if (lsn_is_exact != NULL)
539 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
541 return unsummarized_lsn;
542 }
543
545 }
546
547 /*
548 * Find the oldest timeline on which WAL still exists, and the earliest
549 * segment for which it exists.
550 *
551 * Note that we do this every time the WAL summarizer process restarts or
552 * recovers from an error, in case the contents of pg_wal have changed
553 * under us e.g. if some files were removed, either manually - which
554 * shouldn't really happen, but might - or by postgres itself, if
555 * summarize_wal was turned off and then back on again.
556 */
559 for (n = list_length(tles) - 1; n >= 0; --n)
560 {
563
565 if (oldest_segno != 0)
566 {
567 /* Compute oldest LSN that still exists on disk. */
570
571 unsummarized_tli = tle->tli;
572 break;
573 }
574 }
575
576 /*
577 * Don't try to summarize anything older than the end LSN of the newest
578 * summary file that exists for this timeline.
579 */
583 foreach(lc, existing_summaries)
584 {
586
587 if (ws->end_lsn > unsummarized_lsn)
588 {
589 unsummarized_lsn = ws->end_lsn;
590 should_make_exact = true;
591 }
592 }
593
594 /* It really should not be possible for us to find no WAL. */
595 if (unsummarized_tli == 0)
598 errmsg_internal("no WAL found on timeline %u", latest_tli));
599
600 /*
601 * If we're the WAL summarizer, we always want to store the values we just
602 * computed into shared memory, because those are the values we're going
603 * to use to drive our operation, and so they are the authoritative
604 * values. Otherwise, we only store values into shared memory if shared
605 * memory is uninitialized. Our values are not canonical in such a case,
606 * but it's better to have something than nothing, to guide WAL retention.
607 */
610 {
616 }
617 else
619
620 /* Also return the to the caller as required. */
621 if (tli != NULL)
623 if (lsn_is_exact != NULL)
624 *lsn_is_exact = WalSummarizerCtl->lsn_is_exact;
626
627 return unsummarized_lsn;
628}
List * readTimeLineHistory(TimeLineID targetTLI)
Definition timeline.c:76
int errmsg_internal(const char *fmt,...)
Definition elog.c:1170
int errcode(int sqlerrcode)
Definition elog.c:863
#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 449 of file walsummarizer.c.

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

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

640{
641 ProcNumber pgprocno;
642
643 if (WalSummarizerCtl == NULL)
644 return;
645
649
650 if (pgprocno != INVALID_PROC_NUMBER)
651 SetLatch(&GetPGProcByNumber(pgprocno)->procLatch);
652}
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 *
245 * We have no particular use for SIGINT at the moment, but seems
246 * reasonable to treat like SIGTERM.
247 */
251 /* SIGQUIT handler was already set up by InitPostmasterChild */
255 pqsignal(SIGUSR2, SIG_IGN); /* not used */
256
257 /* Advertise ourselves. */
262
263 /* Create and switch to a memory context that we can reset on error. */
265 "Wal Summarizer",
267 MemoryContextSwitchTo(context);
268
269 /*
270 * Reset some signals that are accepted by postmaster but not here
271 */
273
274 /*
275 * If an exception is encountered, processing resumes here.
276 */
277 if (sigsetjmp(local_sigjmp_buf, 1) != 0)
278 {
279 /* Since not using PG_TRY, must reset error stack by hand */
281
282 /* Prevent interrupts while cleaning up */
284
285 /* Report the error to the server log */
287
288 /* Release resources we might have acquired. */
294 AtEOXact_Files(false);
295 AtEOXact_HashTables(false);
296
297 /*
298 * Now return to normal top-level context and clear ErrorContext for
299 * next time.
300 */
301 MemoryContextSwitchTo(context);
303
304 /* Flush any leaked data in the top-level context */
305 MemoryContextReset(context);
306
307 /* Now we can allow interrupts again */
309
310 /*
311 * Sleep for 10 seconds before attempting to resume operations in
312 * order to avoid excessive logging.
313 *
314 * Many of the likely error conditions are things that will repeat
315 * every time. For example, if the WAL can't be read or the summary
316 * can't be written, only administrator action will cure the problem.
317 * So a really fast retry time doesn't seem to be especially
318 * beneficial, and it will clutter the logs.
319 */
322 10000,
324 }
325
326 /* We can now handle ereport(ERROR) */
328
329 /*
330 * Unblock signals (they were blocked when the postmaster forked us)
331 */
333
334 /*
335 * Fetch information about previous progress from shared memory, and ask
336 * GetOldestUnsummarizedLSN to reset pending_lsn to summarized_lsn. We
337 * might be recovering from an error, and if so, pending_lsn might have
338 * advanced past summarized_lsn, but any WAL we read previously has been
339 * lost and will need to be reread.
340 *
341 * If we discover that WAL summarization is not enabled, just exit.
342 */
345 proc_exit(0);
346
347 /*
348 * Loop forever
349 */
350 for (;;)
351 {
355
356 /* Flush any leaked data in the top-level context */
357 MemoryContextReset(context);
358
359 /* Process any signals received recently. */
361
362 /* If it's time to remove any old WAL summaries, do that now. */
364
365 /* Find the LSN and TLI up to which we can safely summarize. */
367
368 /*
369 * If we're summarizing a historic timeline and we haven't yet
370 * computed the point at which to switch to the next timeline, do that
371 * now.
372 *
373 * Note that if this is a standby, what was previously the current
374 * timeline could become historic at any time.
375 *
376 * We could try to make this more efficient by caching the results of
377 * readTimeLineHistory when latest_tli has not changed, but since we
378 * only have to do this once per timeline switch, we probably wouldn't
379 * save any significant amount of work in practice.
380 */
382 {
384
387 errmsg_internal("switch point from TLI %u to TLI %u is at %X/%08X",
389 }
390
391 /*
392 * If we've reached the switch LSN, we can't summarize anything else
393 * on this timeline. Switch to the next timeline and go around again,
394 * backing up to the exact switch point if we passed it.
395 */
397 {
398 /* Restart summarization from switch point. */
401
402 /* Next timeline and switch point, if any, not yet known. */
404 switch_tli = 0;
405
406 /* Update (really, rewind, if needed) state in shared memory. */
413
414 continue;
415 }
416
417 /* Summarize WAL. */
423
424 /*
425 * Update state for next loop iteration.
426 *
427 * Next summary file should start from exactly where this one ended.
428 */
430 exact = true;
431
432 /* Update state in shared memory. */
439
440 /* Wake up anyone waiting for more summary files to be written. */
442 }
443}
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:873
void ConditionVariableBroadcast(ConditionVariable *cv)
void AtEOXact_HashTables(bool isCommit)
Definition dynahash.c:1931
void EmitErrorReport(void)
Definition elog.c:1704
ErrorContextCallback * error_context_stack
Definition elog.c:95
void FlushErrorState(void)
Definition elog.c:1884
sigjmp_buf * PG_exception_stack
Definition elog.c:97
#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:677
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().