|
PostgreSQL Source Code git master
|
#include "access/xlogdefs.h"#include "lib/pairingheap.h"#include "port/atomics.h"#include "storage/procnumber.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 enum WaitLSNType | WaitLSNType |
| typedef struct WaitLSNProcInfo | WaitLSNProcInfo |
| typedef struct WaitLSNState | WaitLSNState |
Enumerations | |
| enum | WaitLSNResult { WAIT_LSN_RESULT_SUCCESS , WAIT_LSN_RESULT_NOT_IN_RECOVERY , WAIT_LSN_RESULT_TIMEOUT } |
| enum | WaitLSNType { WAIT_LSN_TYPE_REPLAY = 0 , WAIT_LSN_TYPE_FLUSH = 1 , WAIT_LSN_TYPE_COUNT = 2 } |
Functions | |
| Size | WaitLSNShmemSize (void) |
| void | WaitLSNShmemInit (void) |
| void | WaitLSNWakeup (WaitLSNType lsnType, XLogRecPtr currentLSN) |
| void | WaitLSNCleanup (void) |
| WaitLSNResult | WaitForLSN (WaitLSNType lsnType, XLogRecPtr targetLSN, int64 timeout) |
Variables | |
| PGDLLIMPORT WaitLSNState * | waitLSNState |
| typedef struct WaitLSNProcInfo WaitLSNProcInfo |
| typedef struct WaitLSNState WaitLSNState |
| typedef enum WaitLSNType WaitLSNType |
| enum WaitLSNResult |
| Enumerator | |
|---|---|
| WAIT_LSN_RESULT_SUCCESS | |
| WAIT_LSN_RESULT_NOT_IN_RECOVERY | |
| WAIT_LSN_RESULT_TIMEOUT | |
Definition at line 25 of file xlogwait.h.
| enum WaitLSNType |
| Enumerator | |
|---|---|
| WAIT_LSN_TYPE_REPLAY | |
| WAIT_LSN_TYPE_FLUSH | |
| WAIT_LSN_TYPE_COUNT | |
Definition at line 36 of file xlogwait.h.
| WaitLSNResult WaitForLSN | ( | WaitLSNType | lsnType, |
| XLogRecPtr | targetLSN, | ||
| int64 | timeout | ||
| ) |
Definition at line 314 of file xlogwait.c.
References addLSNWaiter(), Assert(), CHECK_FOR_INTERRUPTS, deleteLSNWaiter(), ereport, errcode(), errcontext, errmsg(), FATAL, GetCurrentTimestamp(), GetFlushRecPtr(), GetXLogReplayRecPtr(), MaxBackends, MyLatch, MyProcNumber, PromoteIsTriggered(), RecoveryInProgress(), ResetLatch(), TimestampDifferenceMilliseconds(), TimestampTzPlusMilliseconds, WAIT_LSN_RESULT_NOT_IN_RECOVERY, WAIT_LSN_RESULT_SUCCESS, WAIT_LSN_RESULT_TIMEOUT, WAIT_LSN_TYPE_REPLAY, WaitLatch(), waitLSNState, WL_LATCH_SET, WL_POSTMASTER_DEATH, and WL_TIMEOUT.
Referenced by ExecWaitStmt().
| void WaitLSNCleanup | ( | void | ) |
Definition at line 290 of file xlogwait.c.
References deleteLSNWaiter(), WaitLSNProcInfo::inHeap, WaitLSNProcInfo::lsnType, MyProcNumber, WaitLSNState::procInfos, and waitLSNState.
Referenced by AbortTransaction(), and ProcKill().
| void WaitLSNShmemInit | ( | void | ) |
Definition at line 78 of file xlogwait.c.
References i, MaxBackends, WaitLSNState::minWaitedLSN, NUM_AUXILIARY_PROCS, pairingheap_initialize(), pg_atomic_init_u64(), PG_UINT64_MAX, WaitLSNState::procInfos, ShmemInitStruct(), WAIT_LSN_TYPE_COUNT, WaitLSNState::waitersHeap, waitlsn_cmp(), WaitLSNShmemSize(), and waitLSNState.
Referenced by CreateOrAttachShmemStructs().
| Size WaitLSNShmemSize | ( | void | ) |
Definition at line 67 of file xlogwait.c.
References add_size(), MaxBackends, mul_size(), NUM_AUXILIARY_PROCS, and WaitLSNState::procInfos.
Referenced by CalculateShmemSize(), and WaitLSNShmemInit().
| void WaitLSNWakeup | ( | WaitLSNType | lsnType, |
| XLogRecPtr | currentLSN | ||
| ) |
Definition at line 269 of file xlogwait.c.
References Assert(), i, WaitLSNState::minWaitedLSN, pg_atomic_read_u64(), WAIT_LSN_TYPE_COUNT, waitLSNState, wakeupWaiters(), and XLogRecPtrIsValid.
Referenced by PerformWalRecovery(), and StartupXLOG().
|
extern |
Definition at line 63 of file xlogwait.c.
Referenced by addLSNWaiter(), deleteLSNWaiter(), PerformWalRecovery(), updateMinWaitedLSN(), WaitForLSN(), WaitLSNCleanup(), WaitLSNShmemInit(), WaitLSNWakeup(), and wakeupWaiters().