8000 Use default LSN for new timeline · postgrespro/postgres_cluster@0cec1f0 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0cec1f0

Browse files
committed
Use default LSN for new timeline
1 parent beeff8f commit 0cec1f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contrib/mmts/pglogical_receiver.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ pglogical_receiver_main(Datum main_arg)
251251
ConnStatusType status;
252252
XLogRecPtr originStartPos = InvalidXLogRecPtr;
253253
int timeline;
254+
bool newTimeline = false;
254255

255256
/*
256257
* Determine when and how we should open replication slot.
@@ -282,6 +283,7 @@ pglogical_receiver_main(Datum main_arg)
282283
PQclear(res);
283284
resetPQExpBuffer(query);
284285
timeline = Mtm->nodes[nodeId-1].timeline;
286+
newTimeline = true;
285287
}
286288
/* My original assumption was that we can perfrom recovery only fromm existed slot,
287289
* but unfortunately looks like slots can "disapear" together with WAL-sender.
@@ -311,7 +313,7 @@ pglogical_receiver_main(Datum main_arg)
311313
originStartPos = Mtm->nodes[nodeId-1].restartLsn;
312314
MTM_LOG1("Restart replication from node %d from position %lx", nodeId, originStartPos);
313315
}
314-
if (originStartPos == InvalidXLogRecPtr) {
316+
if (originStartPos == InvalidXLogRecPtr && !newTimeline) {
315317
StartTransactionCommand();
316318
originName = psprintf(MULTIMASTER_SLOT_PATTERN, nodeId);
317319
originId = replorigin_by_name(originName, true);

0 commit comments

Comments
 (0)
0