This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 399d50c7de4 Fix compile errors for replication
399d50c7de4 is described below
commit 399d50c7de47e767ec676ec26317cafd71c1b127
Author: Jinbao Chen <[email protected]>
AuthorDate: Sat Oct 4 21:41:28 2025 +0800
Fix compile errors for replication
---
src/backend/replication/logical/decode.c | 1 -
src/backend/replication/logical/worker.c | 12 +-----
src/backend/replication/repl_gram.y | 65 -----------------------------
src/backend/replication/repl_scanner.l | 8 ----
src/backend/replication/slotfuncs.c | 9 ----
src/backend/replication/syncrep.c | 3 +-
src/backend/replication/walsender.c | 4 +-
src/include/nodes/nodes.h | 1 +
src/include/replication/walsender_private.h | 7 ++++
9 files changed, 13 insertions(+), 97 deletions(-)
diff --git a/src/backend/replication/logical/decode.c
b/src/backend/replication/logical/decode.c
index 0004786e359..7a25abfda2a 100644
--- a/src/backend/replication/logical/decode.c
+++ b/src/backend/replication/logical/decode.c
@@ -193,7 +193,6 @@ xlog_decode(LogicalDecodingContext *ctx, XLogRecordBuffer
*buf)
case XLOG_OVERWRITE_CONTRECORD:
/* GPDB_14_MERGE_FIXME: see pg_control.h, Compatible, Figure
out whether 0xC0 already used? */
case XLOG_NEXTRELFILENODE:
- case XLOG_OVERWRITE_CONTRECORD:
case XLOG_ENCRYPTION_LSN:
break;
default:
diff --git a/src/backend/replication/logical/worker.c
b/src/backend/replication/logical/worker.c
index 564177a5e40..e93ab4c5b9f 100644
--- a/src/backend/replication/logical/worker.c
+++ b/src/backend/replication/logical/worker.c
@@ -927,14 +927,6 @@ slot_modify_data(TupleTableSlot *slot, TupleTableSlot
*srcslot,
memcpy(slot->tts_values, srcslot->tts_values, natts * sizeof(Datum));
memcpy(slot->tts_isnull, srcslot->tts_isnull, natts * sizeof(bool));
- /* For error reporting, push callback + info on the error context stack
*/
- errarg.rel = rel;
- errarg.remote_attnum = -1;
- errcallback.callback = slot_store_error_callback;
- errcallback.arg = (void *) &errarg;
- errcallback.previous = error_context_stack;
- error_context_stack = &errcallback;
-
/* Call the "in" function for each replaced attribute */
Assert(natts == rel->attrmap->maplen);
for (i = 0; i < natts; i++)
@@ -1209,7 +1201,7 @@ apply_handle_commit_prepared(StringInfo s)
replorigin_session_origin_lsn = prepare_data.end_lsn;
replorigin_session_origin_timestamp = prepare_data.commit_time;
- FinishPreparedTransaction(gid, true);
+ FinishPreparedTransaction(gid, true, true);
end_replication_step();
CommitTransactionCommand();
pgstat_report_stat(false);
@@ -1266,7 +1258,7 @@ apply_handle_rollback_prepared(StringInfo s)
/* There is no transaction when ABORT/ROLLBACK PREPARED is
called */
begin_replication_step();
- FinishPreparedTransaction(gid, false);
+ FinishPreparedTransaction(gid, false, true);
end_replication_step();
CommitTransactionCommand();
diff --git a/src/backend/replication/repl_gram.y
b/src/backend/replication/repl_gram.y
index dc826764007..6ab421472ed 100644
--- a/src/backend/replication/repl_gram.y
+++ b/src/backend/replication/repl_gram.y
@@ -177,71 +177,6 @@ base_backup:
}
;
-base_backup_opt_list:
- base_backup_opt_list base_backup_opt
- { $$ = lappend($1, $2); }
- | /* EMPTY */
- { $$ = NIL; }
- ;
-
-base_backup_opt:
- K_LABEL SCONST
- {
- $$ = makeDefElem("label",
- (Node
*)makeString($2), -1);
- }
- | K_PROGRESS
- {
- $$ = makeDefElem("progress",
- (Node
*)makeInteger(true), -1);
- }
- | K_FAST
- {
- $$ = makeDefElem("fast",
- (Node
*)makeInteger(true), -1);
- }
- | K_WAL
- {
- $$ = makeDefElem("wal",
- (Node
*)makeInteger(true), -1);
- }
- | K_NOWAIT
- {
- $$ = makeDefElem("nowait",
- (Node
*)makeInteger(true), -1);
- }
- | K_MAX_RATE UCONST
- {
- $$ = makeDefElem("max_rate",
- (Node
*)makeInteger($2), -1);
- }
- | K_TABLESPACE_MAP
- {
- $$ = makeDefElem("tablespace_map",
- (Node
*)makeInteger(true), -1);
- }
- | K_NOVERIFY_CHECKSUMS
- {
- $$ = makeDefElem("noverify_checksums",
- (Node
*)makeInteger(true), -1);
- }
- | K_MANIFEST SCONST
- {
- $$ = makeDefElem("manifest",
- (Node
*)makeString($2), -1);
- }
- | K_MANIFEST_CHECKSUMS SCONST
- {
- $$ = makeDefElem("manifest_checksums",
- (Node
*)makeString($2), -1);
- }
- | K_EXCLUDE SCONST
- {
- $$ = makeDefElem("exclude",
- (Node *) makeString($2), -1);
- }
- ;
-
create_replication_slot:
/* CREATE_REPLICATION_SLOT slot [TEMPORARY] PHYSICAL
[options] */
K_CREATE_REPLICATION_SLOT IDENT opt_temporary
K_PHYSICAL create_slot_options
diff --git a/src/backend/replication/repl_scanner.l
b/src/backend/replication/repl_scanner.l
index 4e2edaba095..cb467ca46f7 100644
--- a/src/backend/replication/repl_scanner.l
+++ b/src/backend/replication/repl_scanner.l
@@ -121,14 +121,6 @@ BASE_BACKUP { return K_BASE_BACKUP;
}
IDENTIFY_SYSTEM { return K_IDENTIFY_SYSTEM; }
READ_REPLICATION_SLOT { return K_READ_REPLICATION_SLOT; }
SHOW { return K_SHOW; }
-LABEL { return K_LABEL; }
-NOWAIT { return K_NOWAIT; }
-EXCLUDE { return K_EXCLUDE; }
-PROGRESS { return K_PROGRESS; }
-MAX_RATE { return K_MAX_RATE; }
-WAL { return K_WAL; }
-TABLESPACE_MAP { return K_TABLESPACE_MAP; }
-NOVERIFY_CHECKSUMS { return K_NOVERIFY_CHECKSUMS; }
TIMELINE { return K_TIMELINE; }
START_REPLICATION { return K_START_REPLICATION; }
CREATE_REPLICATION_SLOT { return K_CREATE_REPLICATION_SLOT; }
diff --git a/src/backend/replication/slotfuncs.c
b/src/backend/replication/slotfuncs.c
index e01adb00795..f8dd7feacf3 100644
--- a/src/backend/replication/slotfuncs.c
+++ b/src/backend/replication/slotfuncs.c
@@ -26,15 +26,6 @@
#include "utils/pg_lsn.h"
#include "utils/resowner.h"
-static void
-check_permissions(void)
-{
- if (!superuser() && !has_rolreplication(GetUserId()))
- ereport(ERROR,
- (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
- errmsg("must be superuser or replication role
to use replication slots")));
-}
-
static void
warn_slot_only_created_on_segment(const char *name) {
ereport(WARNING,
diff --git a/src/backend/replication/syncrep.c
b/src/backend/replication/syncrep.c
index 4b0660e54ce..885df814b11 100644
--- a/src/backend/replication/syncrep.c
+++ b/src/backend/replication/syncrep.c
@@ -924,7 +924,6 @@ SyncRepGetCandidateStandbys(SyncRepStandbyData **standbys)
if (IS_QUERY_DISPATCHER())
{
bool syncStandbyPresent;
- int i;
SyncRepStandbyData *stby;
volatile WalSnd *walsnd; /* Use volatile pointer
to prevent code
* rearrangement */
@@ -1145,7 +1144,7 @@ SyncRepWakeQueue(bool all, int mode)
"syncrep wakeup queue -- %d procid was removed
from syncrep queue. "
"Its state is changed to 'Wait Complete' and "
"its latch is now set",
- thisproc->pid);
+ proc->pid);
numprocs++;
}
diff --git a/src/backend/replication/walsender.c
b/src/backend/replication/walsender.c
index e3370266438..014272acefc 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -129,7 +129,7 @@ bool am_cascading_walsender = false; /* Am I
cascading WAL to another
bool am_db_walsender = false; /* Connected to a database? */
/* User-settable parameters for walsender */
-int repl_catchup_within_range = 0*/
+int repl_catchup_within_range = 0;
int max_wal_senders = 10; /* the maximum number of
concurrent
*
walsenders */
int wal_sender_timeout = 60 * 1000; /* maximum time to send
one WAL
@@ -446,7 +446,7 @@ IdentifySystem(void)
"SysId = %s, "
"ThisTimelineID = %u, "
"XLog InsertRecPtr = %s will be sent.",
- sysid, ThisTimeLineID, xloc);
+ sysid, currTLI, xloc);
if (MyDatabaseId != InvalidOid)
{
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 21b7da55347..765cd273bcd 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -672,6 +672,7 @@ typedef enum NodeTag
T_CreateReplicationSlotCmd,
T_DropReplicationSlotCmd,
T_StartReplicationCmd,
+ T_ReadReplicationSlotCmd,
T_TimeLineHistoryCmd,
T_SQLCmd,
diff --git a/src/include/replication/walsender_private.h
b/src/include/replication/walsender_private.h
index a6b6493db40..78140f4f7d0 100644
--- a/src/include/replication/walsender_private.h
+++ b/src/include/replication/walsender_private.h
@@ -138,6 +138,13 @@ typedef struct
*/
XLogRecPtr lsn[NUM_SYNC_REP_WAIT_MODE];
+ /*
+ * Are any sync standbys defined? Waiting backends can't reload the
+ * config file safely, so checkpointer updates this value as needed.
+ * Protected by SyncRepLock.
+ */
+ bool sync_standbys_defined;
+
/*
* Status of data related to the synchronous standbys. Waiting backends
* can't reload the config file safely, so checkpointer updates this
value
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]