Skip to content

Commit 5035172

Browse files
committed
Move LSN waiting declarations and definitions to better place
3c5db1d implemented the pg_wal_replay_wait() stored procedure. Due to the patch development history, the implementation resided in src/backend/commands/waitlsn.c (src/include/commands/waitlsn.h for headers). 014f9f3 moved pg_wal_replay_wait() itself to src/backend/access/transam/xlogfuncs.c near to the WAL-manipulation functions. But most of the implementation stayed in place. The code in src/backend/commands/waitlsn.c has nothing to do with commands, but is related to WAL. So, this commit moves this code into src/backend/access/transam/xlogwait.c (src/include/access/xlogwait.h for headers). Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/18c0fa64-0475-415e-a1bd-665d922c5201%40eisentraut.org Reviewed-by: Pavel Borisov
1 parent b85a9d0 commit 5035172

File tree

12 files changed

+18
-18
lines changed

12 files changed

+18
-18
lines changed

src/backend/access/transam/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ OBJS = \
3636
xlogreader.o \
3737
xlogrecovery.o \
3838
xlogstats.o \
39-
xlogutils.o
39+
xlogutils.o \
40+
xlogwait.o
4041

4142
include $(top_srcdir)/src/backend/common.mk
4243

src/backend/access/transam/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ backend_sources += files(
2424
'xlogrecovery.c',
2525
'xlogstats.c',
2626
'xlogutils.c',
27+
'xlogwait.c',
2728
)
2829

2930
# used by frontend programs to build a frontend xlogreader

src/backend/access/transam/xact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
#include "access/xloginsert.h"
3232
#include "access/xlogrecovery.h"
3333
#include "access/xlogutils.h"
34+
#include "access/xlogwait.h"
3435
#include "catalog/index.h"
3536
#include "catalog/namespace.h"
3637
#include "catalog/pg_enum.h"
3738
#include "catalog/storage.h"
3839
#include "commands/async.h"
3940
#include "commands/tablecmds.h"
4041
#include "commands/trigger.h"
41-
#include "commands/waitlsn.h"
4242
#include "common/pg_prng.h"
4343
#include "executor/spi.h"
4444
#include "libpq/be-fsstubs.h"

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262
#include "access/xlogreader.h"
6363
#include "access/xlogrecovery.h"
6464
#include "access/xlogutils.h"
65+
#include "access/xlogwait.h"
6566
#include "backup/basebackup.h"
6667
#include "catalog/catversion.h"
6768
#include "catalog/pg_control.h"
6869
#include "catalog/pg_database.h"
69-
#include "commands/waitlsn.h"
7070
#include "common/controldata_utils.h"
7171
#include "common/file_utils.h"
7272
#include "executor/instrument.h"

src/backend/access/transam/xlogfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#include "access/xlog_internal.h"
2323
#include "access/xlogbackup.h"
2424
#include "access/xlogrecovery.h"
25+
#include "access/xlogwait.h"
2526
#include "catalog/pg_type.h"
26-
#include "commands/waitlsn.h"
2727
#include "funcapi.h"
2828
#include "miscadmin.h"
2929
#include "pgstat.h"

src/backend/access/transam/xlogrecovery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
#include "access/xlogreader.h"
4141
#include "access/xlogrecovery.h"
4242
#include "access/xlogutils.h"
43+
#include "access/xlogwait.h"
4344
#include "backup/basebackup.h"
4445
#include "catalog/pg_control.h"
4546
#include "commands/tablespace.h"
46-
#include "commands/waitlsn.h"
4747
#include "common/file_utils.h"
4848
#include "miscadmin.h"
4949
#include "pgstat.h"

src/backend/commands/waitlsn.c renamed to src/backend/access/transam/xlogwait.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* waitlsn.c
3+
* xlogwait.c
44
* Implements waiting for the given replay LSN, which is used in
55
* CALL pg_wal_replay_wait(target_lsn pg_lsn, timeout float8).
66
*
77
* Copyright (c) 2024, PostgreSQL Global Development Group
88
*
99
* IDENTIFICATION
10-
* src/backend/commands/waitlsn.c
10+
* src/backend/access/transam/xlogwait.c
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -20,7 +20,7 @@
2020
#include "pgstat.h"
2121
#include "access/xlog.h"
2222
#include "access/xlogrecovery.h"
23-
#include "commands/waitlsn.h"
23+
#include "access/xlogwait.h"
2424
#include "funcapi.h"
2525
#include "miscadmin.h"
2626
#include "storage/latch.h"

src/backend/commands/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ OBJS = \
6161
vacuum.o \
6262
vacuumparallel.o \
6363
variable.o \
64-
view.o \
65-
waitlsn.o
64+
view.o
6665

6766
include $(top_srcdir)/src/backend/common.mk

src/backend/commands/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,4 @@ backend_sources += files(
5050
'vacuumparallel.c',
5151
'variable.c',
5252
'view.c',
53-
'waitlsn.c',
5453
)

src/backend/storage/ipc/ipci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
#include "access/twophase.h"
2525
#include "access/xlogprefetcher.h"
2626
#include "access/xlogrecovery.h"
27+
#include "access/xlogwait.h"
2728
#include "commands/async.h"
28-
#include "commands/waitlsn.h"
2929
#include "miscadmin.h"
3030
#include "pgstat.h"
3131
#include "postmaster/autovacuum.h"

src/backend/storage/lmgr/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "access/transam.h"
3737
#include "access/twophase.h"
3838
#include "access/xlogutils.h"
39-
#include "commands/waitlsn.h"
39+
#include "access/xlogwait.h"
4040
#include "miscadmin.h"
4141
#include "pgstat.h"
4242
#include "postmaster/autovacuum.h"

src/include/commands/waitlsn.h renamed to src/include/access/xlogwait.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* waitlsn.h
3+
* xlogwait.h
44
* Declarations for LSN replay waiting routines.
55
*
66
* Copyright (c) 2024, PostgreSQL Global Development Group
77
*
8-
* src/include/commands/waitlsn.h
8+
* src/include/access/xlogwait.h
99
*
1010
*-------------------------------------------------------------------------
1111
*/
12-
#ifndef WAIT_LSN_H
13-
#define WAIT_LSN_H
12+
#ifndef XLOG_WAIT_H
13+
#define XLOG_WAIT_H
1414

1515
#include "lib/pairingheap.h"
1616
#include "postgres.h"
@@ -78,4 +78,4 @@ extern void WaitLSNSetLatches(XLogRecPtr currentLSN);
7878
extern void WaitLSNCleanup(void);
7979
extern void WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
8080

81-
#endif /* WAIT_LSN_H */
81+
#endif /* XLOG_WAIT_H */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy