aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/xlogwait.h
diff options
context:
space:
mode:
authorAlexander Korotkov <akorotkov@postgresql.org>2024-11-04 22:43:08 +0200
committerAlexander Korotkov <akorotkov@postgresql.org>2024-11-04 22:47:57 +0200
commit3a7ae6b3d91e0d011dba1eb8a29e1836c6a33c75 (patch)
tree78d10a6e062353c06046ec2a5d82fa94e4897219 /src/include/access/xlogwait.h
parent3293b718a01310c8ce765ace3cb15efcb956a84e (diff)
downloadpostgresql-3a7ae6b3d91e0d011dba1eb8a29e1836c6a33c75.tar.gz
postgresql-3a7ae6b3d91e0d011dba1eb8a29e1836c6a33c75.zip
Revert pg_wal_replay_wait() stored procedure
This commit reverts 3c5db1d6b0, and subsequent improvements and fixes including 8036d73ae3, 867d396ccd, 3ac3ec580c, 0868d7ae70, 85b98b8d5a, 2520226c95, 014f9f34d2, e658038772, e1555645d7, 5035172e4a, 6cfebfe88b, 73da6b8d1b, and e546989a26. The reason for reverting is a set of remaining issues. Most notably, the stored procedure appears to need more effort than the utility statement to turn the backend into a "snapshot-less" state. This makes an approach to use stored procedures questionable. Catversion is bumped. Discussion: https://postgr.es/m/Zyhj2anOPRKtb0xW%40paquier.xyz
Diffstat (limited to 'src/include/access/xlogwait.h')
-rw-r--r--src/include/access/xlogwait.h89
1 files changed, 0 insertions, 89 deletions
diff --git a/src/include/access/xlogwait.h b/src/include/access/xlogwait.h
deleted file mode 100644
index a77635eb97c..00000000000
--- a/src/include/access/xlogwait.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * xlogwait.h
- * Declarations for LSN replay waiting routines.
- *
- * Copyright (c) 2024, PostgreSQL Global Development Group
- *
- * src/include/access/xlogwait.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef XLOG_WAIT_H
-#define XLOG_WAIT_H
-
-#include "lib/pairingheap.h"
-#include "postgres.h"
-#include "port/atomics.h"
-#include "storage/procnumber.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
-{
- /* LSN, which this process is waiting for */
- XLogRecPtr waitLSN;
-
- /* Process to wake up once the waitLSN is replayed */
- ProcNumber procno;
-
- /* A pairing heap node for participation in waitLSNState->waitersHeap */
- pairingheap_node phNode;
-
- /*
- * A flag indicating that this item is present in
- * waitLSNState->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;
-
-/*
- * Result statuses for WaitForLSNReplay().
- */
-typedef enum
-{
- WAIT_LSN_RESULT_SUCCESS, /* Target LSN is reached */
- WAIT_LSN_RESULT_TIMEOUT, /* Timeout occurred */
- WAIT_LSN_RESULT_NOT_IN_RECOVERY, /* Recovery ended before or during our
- * wait */
-} WaitLSNResult;
-
-extern PGDLLIMPORT WaitLSNState *waitLSNState;
-
-extern Size WaitLSNShmemSize(void);
-extern void WaitLSNShmemInit(void);
-extern void WaitLSNWakeup(XLogRecPtr currentLSN);
-extern void WaitLSNCleanup(void);
-extern WaitLSNResult WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
-
-#endif /* XLOG_WAIT_H */