mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-27 07:21:09 +08:00
Move LSN waiting declarations and definitions to better place
3c5db1d6b
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).014f9f34d
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
This commit is contained in:
parent
b85a9d046e
commit
5035172e4a
@ -36,7 +36,8 @@ OBJS = \
|
|||||||
xlogreader.o \
|
xlogreader.o \
|
||||||
xlogrecovery.o \
|
xlogrecovery.o \
|
||||||
xlogstats.o \
|
xlogstats.o \
|
||||||
xlogutils.o
|
xlogutils.o \
|
||||||
|
xlogwait.o
|
||||||
|
|
||||||
include $(top_srcdir)/src/backend/common.mk
|
include $(top_srcdir)/src/backend/common.mk
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ backend_sources += files(
|
|||||||
'xlogrecovery.c',
|
'xlogrecovery.c',
|
||||||
'xlogstats.c',
|
'xlogstats.c',
|
||||||
'xlogutils.c',
|
'xlogutils.c',
|
||||||
|
'xlogwait.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
# used by frontend programs to build a frontend xlogreader
|
# used by frontend programs to build a frontend xlogreader
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
|
#include "access/xlogwait.h"
|
||||||
#include "catalog/index.h"
|
#include "catalog/index.h"
|
||||||
#include "catalog/namespace.h"
|
#include "catalog/namespace.h"
|
||||||
#include "catalog/pg_enum.h"
|
#include "catalog/pg_enum.h"
|
||||||
@ -38,7 +39,6 @@
|
|||||||
#include "commands/async.h"
|
#include "commands/async.h"
|
||||||
#include "commands/tablecmds.h"
|
#include "commands/tablecmds.h"
|
||||||
#include "commands/trigger.h"
|
#include "commands/trigger.h"
|
||||||
#include "commands/waitlsn.h"
|
|
||||||
#include "common/pg_prng.h"
|
#include "common/pg_prng.h"
|
||||||
#include "executor/spi.h"
|
#include "executor/spi.h"
|
||||||
#include "libpq/be-fsstubs.h"
|
#include "libpq/be-fsstubs.h"
|
||||||
|
@ -62,11 +62,11 @@
|
|||||||
#include "access/xlogreader.h"
|
#include "access/xlogreader.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
|
#include "access/xlogwait.h"
|
||||||
#include "backup/basebackup.h"
|
#include "backup/basebackup.h"
|
||||||
#include "catalog/catversion.h"
|
#include "catalog/catversion.h"
|
||||||
#include "catalog/pg_control.h"
|
#include "catalog/pg_control.h"
|
||||||
#include "catalog/pg_database.h"
|
#include "catalog/pg_database.h"
|
||||||
#include "commands/waitlsn.h"
|
|
||||||
#include "common/controldata_utils.h"
|
#include "common/controldata_utils.h"
|
||||||
#include "common/file_utils.h"
|
#include "common/file_utils.h"
|
||||||
#include "executor/instrument.h"
|
#include "executor/instrument.h"
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "access/xlogbackup.h"
|
#include "access/xlogbackup.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
|
#include "access/xlogwait.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "commands/waitlsn.h"
|
|
||||||
#include "funcapi.h"
|
#include "funcapi.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
|
@ -40,10 +40,10 @@
|
|||||||
#include "access/xlogreader.h"
|
#include "access/xlogreader.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
|
#include "access/xlogwait.h"
|
||||||
#include "backup/basebackup.h"
|
#include "backup/basebackup.h"
|
||||||
#include "catalog/pg_control.h"
|
#include "catalog/pg_control.h"
|
||||||
#include "commands/tablespace.h"
|
#include "commands/tablespace.h"
|
||||||
#include "commands/waitlsn.h"
|
|
||||||
#include "common/file_utils.h"
|
#include "common/file_utils.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* waitlsn.c
|
* xlogwait.c
|
||||||
* Implements waiting for the given replay LSN, which is used in
|
* Implements waiting for the given replay LSN, which is used in
|
||||||
* CALL pg_wal_replay_wait(target_lsn pg_lsn, timeout float8).
|
* CALL pg_wal_replay_wait(target_lsn pg_lsn, timeout float8).
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024, PostgreSQL Global Development Group
|
* Copyright (c) 2024, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* src/backend/commands/waitlsn.c
|
* src/backend/access/transam/xlogwait.c
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -20,7 +20,7 @@
|
|||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
#include "commands/waitlsn.h"
|
#include "access/xlogwait.h"
|
||||||
#include "funcapi.h"
|
#include "funcapi.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "storage/latch.h"
|
#include "storage/latch.h"
|
@ -61,7 +61,6 @@ OBJS = \
|
|||||||
vacuum.o \
|
vacuum.o \
|
||||||
vacuumparallel.o \
|
vacuumparallel.o \
|
||||||
variable.o \
|
variable.o \
|
||||||
view.o \
|
view.o
|
||||||
waitlsn.o
|
|
||||||
|
|
||||||
include $(top_srcdir)/src/backend/common.mk
|
include $(top_srcdir)/src/backend/common.mk
|
||||||
|
@ -50,5 +50,4 @@ backend_sources += files(
|
|||||||
'vacuumparallel.c',
|
'vacuumparallel.c',
|
||||||
'variable.c',
|
'variable.c',
|
||||||
'view.c',
|
'view.c',
|
||||||
'waitlsn.c',
|
|
||||||
)
|
)
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include "access/twophase.h"
|
#include "access/twophase.h"
|
||||||
#include "access/xlogprefetcher.h"
|
#include "access/xlogprefetcher.h"
|
||||||
#include "access/xlogrecovery.h"
|
#include "access/xlogrecovery.h"
|
||||||
|
#include "access/xlogwait.h"
|
||||||
#include "commands/async.h"
|
#include "commands/async.h"
|
||||||
#include "commands/waitlsn.h"
|
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "postmaster/autovacuum.h"
|
#include "postmaster/autovacuum.h"
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "access/transam.h"
|
#include "access/transam.h"
|
||||||
#include "access/twophase.h"
|
#include "access/twophase.h"
|
||||||
#include "access/xlogutils.h"
|
#include "access/xlogutils.h"
|
||||||
#include "commands/waitlsn.h"
|
#include "access/xlogwait.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "pgstat.h"
|
#include "pgstat.h"
|
||||||
#include "postmaster/autovacuum.h"
|
#include "postmaster/autovacuum.h"
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* waitlsn.h
|
* xlogwait.h
|
||||||
* Declarations for LSN replay waiting routines.
|
* Declarations for LSN replay waiting routines.
|
||||||
*
|
*
|
||||||
* Copyright (c) 2024, PostgreSQL Global Development Group
|
* Copyright (c) 2024, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* src/include/commands/waitlsn.h
|
* src/include/access/xlogwait.h
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
#ifndef WAIT_LSN_H
|
#ifndef XLOG_WAIT_H
|
||||||
#define WAIT_LSN_H
|
#define XLOG_WAIT_H
|
||||||
|
|
||||||
#include "lib/pairingheap.h"
|
#include "lib/pairingheap.h"
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
@ -78,4 +78,4 @@ extern void WaitLSNSetLatches(XLogRecPtr currentLSN);
|
|||||||
extern void WaitLSNCleanup(void);
|
extern void WaitLSNCleanup(void);
|
||||||
extern void WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
|
extern void WaitForLSNReplay(XLogRecPtr targetLSN, int64 timeout);
|
||||||
|
|
||||||
#endif /* WAIT_LSN_H */
|
#endif /* XLOG_WAIT_H */
|
Loading…
Reference in New Issue
Block a user