Skip to content

Commit f2c0241

Browse files
knizhnikkelvich
authored andcommitted
Use default LSN for new timeline
1 parent 86d25e9 commit f2c0241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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)
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