aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2020-03-17 18:18:01 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2020-03-17 18:18:01 -0300
commit5d0c2d5eba6b58b3c9955ee41c917f7df8b62746 (patch)
treec246021bf6e93f1e96891ba1a8bdaffdfeefbe76 /src
parentbcd1c3630095e48bc3b1eb0fc8e8c8a7c851eba1 (diff)
downloadpostgresql-5d0c2d5eba6b58b3c9955ee41c917f7df8b62746.tar.gz
postgresql-5d0c2d5eba6b58b3c9955ee41c917f7df8b62746.zip
Remove logical_read_local_xlog_page
It devolved into a content-less wrapper over read_local_xlog_page, with nothing to add, plus it's easily confused with walsender's logical_read_xlog_page. There doesn't seem to be any reason for it to stay. src/include/replication/logicalfuncs.h becomes empty, so remove it too. The prototypes it initially had were absorbed by generated fmgrprotos.h. Discussion: https://postgr.es/m/20191115214102.GA15616@alvherre.pgsql
Diffstat (limited to 'src')
-rw-r--r--src/backend/replication/logical/logicalfuncs.c11
-rw-r--r--src/backend/replication/slotfuncs.c6
-rw-r--r--src/backend/replication/walsender.c3
-rw-r--r--src/include/replication/logicalfuncs.h19
4 files changed, 5 insertions, 34 deletions
diff --git a/src/backend/replication/logical/logicalfuncs.c b/src/backend/replication/logical/logicalfuncs.c
index a3a83a9d367..04510094a80 100644
--- a/src/backend/replication/logical/logicalfuncs.c
+++ b/src/backend/replication/logical/logicalfuncs.c
@@ -28,7 +28,6 @@
#include "nodes/makefuncs.h"
#include "replication/decode.h"
#include "replication/logical.h"
-#include "replication/logicalfuncs.h"
#include "replication/message.h"
#include "storage/fd.h"
#include "utils/array.h"
@@ -105,14 +104,6 @@ check_permissions(void)
errmsg("must be superuser or replication role to use replication slots")));
}
-int
-logical_read_local_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr,
- int reqLen, XLogRecPtr targetRecPtr, char *cur_page)
-{
- return read_local_xlog_page(state, targetPagePtr, reqLen,
- targetRecPtr, cur_page);
-}
-
/*
* Helper function for the various SQL callable logical decoding functions.
*/
@@ -242,7 +233,7 @@ pg_logical_slot_get_changes_guts(FunctionCallInfo fcinfo, bool confirm, bool bin
ctx = CreateDecodingContext(InvalidXLogRecPtr,
options,
false,
- logical_read_local_xlog_page,
+ read_local_xlog_page,
LogicalOutputPrepareWrite,
LogicalOutputWrite, NULL);
diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c
index beb735d87b6..ce0c9127bca 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -14,11 +14,11 @@
#include "access/htup_details.h"
#include "access/xlog_internal.h"
+#include "access/xlogutils.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "replication/decode.h"
#include "replication/logical.h"
-#include "replication/logicalfuncs.h"
#include "replication/slot.h"
#include "utils/builtins.h"
#include "utils/inval.h"
@@ -152,7 +152,7 @@ create_logical_replication_slot(char *name, char *plugin,
ctx = CreateInitDecodingContext(plugin, NIL,
false, /* just catalogs is OK */
restart_lsn,
- logical_read_local_xlog_page, NULL, NULL,
+ read_local_xlog_page, NULL, NULL,
NULL);
/*
@@ -424,7 +424,7 @@ pg_logical_replication_slot_advance(XLogRecPtr moveto)
ctx = CreateDecodingContext(InvalidXLogRecPtr,
NIL,
true, /* fast_forward */
- logical_read_local_xlog_page,
+ read_local_xlog_page,
NULL, NULL, NULL);
/*
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index 3f74bc84939..76ec3c7dd09 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -70,7 +70,6 @@
#include "replication/basebackup.h"
#include "replication/decode.h"
#include "replication/logical.h"
-#include "replication/logicalfuncs.h"
#include "replication/slot.h"
#include "replication/snapbuild.h"
#include "replication/syncrep.h"
@@ -759,7 +758,7 @@ StartReplication(StartReplicationCmd *cmd)
/*
* read_page callback for logical decoding contexts, as a walsender process.
*
- * Inside the walsender we can do better than logical_read_local_xlog_page,
+ * Inside the walsender we can do better than read_local_xlog_page,
* which has to do a plain sleep/busy loop, because the walsender's latch gets
* set every time WAL is flushed.
*/
diff --git a/src/include/replication/logicalfuncs.h b/src/include/replication/logicalfuncs.h
deleted file mode 100644
index 67c3fa12d94..00000000000
--- a/src/include/replication/logicalfuncs.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/*-------------------------------------------------------------------------
- * logicalfuncs.h
- * PostgreSQL WAL to logical transformation support functions
- *
- * Copyright (c) 2012-2020, PostgreSQL Global Development Group
- *
- *-------------------------------------------------------------------------
- */
-#ifndef LOGICALFUNCS_H
-#define LOGICALFUNCS_H
-
-#include "replication/logical.h"
-
-extern int logical_read_local_xlog_page(XLogReaderState *state,
- XLogRecPtr targetPagePtr,
- int reqLen, XLogRecPtr targetRecPtr,
- char *cur_page);
-
-#endif