PostgreSQL Source Code
git master
|
#include "lib/pairingheap.h"
#include "postgres.h"
#include "port/atomics.h"
#include "storage/latch.h"
#include "storage/spin.h"
#include "tcop/dest.h"
Go to the source code of this file.
Data Structures | |
struct | WaitLSNProcInfo |
struct | WaitLSNState |
Typedefs | |
typedef struct WaitLSNProcInfo | WaitLSNProcInfo |
typedef struct WaitLSNState | WaitLSNState |
Functions | |
Size | WaitLSNShmemSize (void) |
void | WaitLSNShmemInit (void) |
void | WaitLSNSetLatches (XLogRecPtr currentLSN) |
void | WaitLSNCleanup (void) |
void | WaitForLSNReplay (XLogRecPtr targetLSN, int64 timeout) |
Variables | |
PGDLLIMPORT WaitLSNState * | waitLSNState |
typedef struct WaitLSNProcInfo WaitLSNProcInfo |
typedef struct WaitLSNState WaitLSNState |
void WaitForLSNReplay | ( | XLogRecPtr | targetLSN, |
int64 | timeout | ||
) |
Definition at line 221 of file waitlsn.c.
References addLSNWaiter(), Assert, CHECK_FOR_INTERRUPTS, deleteLSNWaiter(), ereport, errcode(), errdetail(), errhint(), errmsg(), ERROR, GetCurrentTimestamp(), GetXLogReplayRecPtr(), LSN_FORMAT_ARGS, MaxBackends, MyLatch, MyProcNumber, RecoveryInProgress(), ResetLatch(), TimestampDifferenceMilliseconds(), TimestampTzPlusMilliseconds, WaitLatch(), waitLSNState, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, and WL_TIMEOUT.
Referenced by pg_wal_replay_wait().
void WaitLSNCleanup | ( | void | ) |
Definition at line 204 of file waitlsn.c.
References deleteLSNWaiter(), WaitLSNProcInfo::inHeap, MyProcNumber, WaitLSNState::procInfos, and waitLSNState.
Referenced by AbortTransaction(), and ProcKill().
void WaitLSNSetLatches | ( | XLogRecPtr | currentLSN | ) |
Definition at line 155 of file waitlsn.c.
References i, WaitLSNProcInfo::inHeap, WaitLSNProcInfo::latch, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MaxBackends, pairingheap_container, pairingheap_first(), pairingheap_is_empty, pairingheap_remove_first(), palloc(), pfree(), SetLatch(), updateMinWaitedLSN(), WaitLSNState::waitersHeap, WaitLSNProcInfo::waitLSN, waitLSNState, and XLogRecPtrIsInvalid.
Referenced by PerformWalRecovery(), and StartupXLOG().
void WaitLSNShmemInit | ( | void | ) |
Definition at line 52 of file waitlsn.c.
References MaxBackends, WaitLSNState::minWaitedLSN, pairingheap_initialize(), pg_atomic_init_u64(), PG_UINT64_MAX, WaitLSNState::procInfos, ShmemInitStruct(), WaitLSNState::waitersHeap, waitlsn_cmp(), WaitLSNShmemSize(), and waitLSNState.
Referenced by CreateOrAttachShmemStructs().
Size WaitLSNShmemSize | ( | void | ) |
Definition at line 41 of file waitlsn.c.
References add_size(), MaxBackends, mul_size(), WaitLSNState::procInfos, and size.
Referenced by CalculateShmemSize(), and WaitLSNShmemInit().
|
extern |
Definition at line 37 of file waitlsn.c.
Referenced by addLSNWaiter(), deleteLSNWaiter(), PerformWalRecovery(), updateMinWaitedLSN(), WaitForLSNReplay(), WaitLSNCleanup(), WaitLSNSetLatches(), and WaitLSNShmemInit().