summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAlexander Korotkov2024-04-11 13:30:32 +0000
committerAlexander Korotkov2024-04-11 14:28:15 +0000
commit772faafca1b288c4dd66b7150a7831c27b768003 (patch)
tree53ccb481bb8e8ca93feff18555734b706aa4ad7c /src/include
parent922c4c461d213a422ee7eb6c38e399607539210a (diff)
Revert: Implement pg_wal_replay_wait() stored procedure
This commit reverts 06c418e163, e37662f221, bf1e650806, 25f42429e2, ee79928441, and 74eaf66f98 per review by Heikki Linnakangas. Discussion: https://postgr.es/m/b155606b-e744-4218-bda5-29379779da1a%40iki.fi
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h2
-rw-r--r--src/include/catalog/pg_proc.dat5
-rw-r--r--src/include/commands/waitlsn.h77
-rw-r--r--src/include/lib/pairingheap.h3
-rw-r--r--src/include/storage/lwlocklist.h1
5 files changed, 1 insertions, 87 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index f8fab27da94..950f00bed48 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -57,6 +57,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202404022
+#define CATALOG_VERSION_NO 202404021
#endif
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 153d816a053..134e3b22fd8 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -12153,11 +12153,6 @@
prorettype => 'bytea', proargtypes => 'pg_brin_minmax_multi_summary',
prosrc => 'brin_minmax_multi_summary_send' },
-{ oid => '16387', descr => 'wait for LSN with timeout',
- proname => 'pg_wal_replay_wait', prokind => 'p', prorettype => 'void',
- proargtypes => 'pg_lsn int8', proargnames => '{target_lsn,timeout}',
- prosrc => 'pg_wal_replay_wait' },
-
{ oid => '6291', descr => 'arbitrary value from among input values',
proname => 'any_value', prokind => 'a', proisstrict => 'f',
prorettype => 'anyelement', proargtypes => 'anyelement',
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 */
diff --git a/src/include/lib/pairingheap.h b/src/include/lib/pairingheap.h
index 9e1c26033a1..7eade81535a 100644
--- a/src/include/lib/pairingheap.h
+++ b/src/include/lib/pairingheap.h
@@ -77,9 +77,6 @@ typedef struct pairingheap
extern pairingheap *pairingheap_allocate(pairingheap_comparator compare,
void *arg);
-extern void pairingheap_initialize(pairingheap *heap,
- pairingheap_comparator compare,
- void *arg);
extern void pairingheap_free(pairingheap *heap);
extern void pairingheap_add(pairingheap *heap, pairingheap_node *node);
extern pairingheap_node *pairingheap_first(pairingheap *heap);
diff --git a/src/include/storage/lwlocklist.h b/src/include/storage/lwlocklist.h
index c2bab5a794e..85f6568b9e4 100644
--- a/src/include/storage/lwlocklist.h
+++ b/src/include/storage/lwlocklist.h
@@ -83,4 +83,3 @@ PG_LWLOCK(49, WALSummarizer)
PG_LWLOCK(50, DSMRegistry)
PG_LWLOCK(51, InjectionPoint)
PG_LWLOCK(52, SerialControl)
-PG_LWLOCK(53, WaitLSN)