diff options
Diffstat (limited to 'src/include/commands/waitlsn.h')
-rw-r--r-- | src/include/commands/waitlsn.h | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/src/include/commands/waitlsn.h b/src/include/commands/waitlsn.h deleted file mode 100644 index da17b8be6f9..00000000000 --- a/src/include/commands/waitlsn.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------------------- - * - * waitlsn.h - * Declarations for LSN replay waiting routines. - * - * Copyright (c) 2024, PostgreSQL Global Development Group - * - * src/include/commands/waitlsn.h - * - *------------------------------------------------------------------------- - */ -#ifndef WAIT_LSN_H -#define WAIT_LSN_H - -#include "lib/pairingheap.h" -#include "postgres.h" -#include "port/atomics.h" -#include "storage/spin.h" -#include "tcop/dest.h" - -/* - * WaitLSNProcInfo – the shared memory structure representing information - * about the single process, which may wait for LSN replay. An item of - * waitLSN->procInfos array. - */ -typedef struct WaitLSNProcInfo -{ - /* - * A process number, same as the index of this item in waitLSN->procInfos. - * Stored for convenience. - */ - int procnum; - - /* LSN, which this process is waiting for */ - XLogRecPtr waitLSN; - - /* A pairing heap node for participation in waitLSN->waitersHeap */ - pairingheap_node phNode; - - /* A flag indicating that this item is added to waitLSN->waitersHeap */ - bool inHeap; -} WaitLSNProcInfo; - -/* - * WaitLSNState - the shared memory state for the replay LSN waiting facility. - */ -typedef struct WaitLSNState -{ - /* - * The minimum LSN value some process is waiting for. Used for the - * fast-path checking if we need to wake up any waiters after replaying a - * WAL record. Could be read lock-less. Update protected by WaitLSNLock. - */ - pg_atomic_uint64 minWaitedLSN; - - /* - * A pairing heap of waiting processes order by LSN values (least LSN is - * on top). Protected by WaitLSNLock. - */ - pairingheap waitersHeap; - - /* - * An array with per-process information, indexed by the process number. - * Protected by WaitLSNLock. - */ - WaitLSNProcInfo procInfos[FLEXIBLE_ARRAY_MEMBER]; -} WaitLSNState; - -extern PGDLLIMPORT struct WaitLSNState *waitLSN; - -extern void WaitForLSN(XLogRecPtr targetLSN, int64 timeout); -extern Size WaitLSNShmemSize(void); -extern void WaitLSNShmemInit(void); -extern void WaitLSNSetLatches(XLogRecPtr currentLSN); -extern void WaitLSNCleanup(void); - -#endif /* WAIT_LSN_H */ |