From 758c18985c6094c24cfa2616accb554d34d33da8 Mon Sep 17 00:00:00 2001 From: Ian Barwick Date: Thu, 8 Oct 2020 21:07:16 +0900 Subject: [PATCH] node rejoin: better document unrecoverable situation If two diverged nodes are on the same timeline, currently there's no way of establishing the divergence point and pg_rewind is ineffective. Clarify the log messages to make this clearer. --- repmgr-client.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/repmgr-client.c b/repmgr-client.c index 942dd46e..f1c34efb 100644 --- a/repmgr-client.c +++ b/repmgr-client.c @@ -4208,12 +4208,26 @@ check_node_can_attach(TimeLineID local_tli, XLogRecPtr local_xlogpos, PGconn *fo } else { - log_error(_("this node is ahead of the %s target"), action); + /* + * Unable to follow or join to a node we're ahead of, if we're on the + * same timeline. Also, pg_rewind does not detect this situation, + * as there is no definitive fork point. + * + * Note that Pg will still happily attach to the upstream in state "streaming" + * for a while but then detach with an endless stream of + * "record with incorrect prev-link" errors. + */ + log_error(_("this node ahead of the %s target on the same timeline (%i)"), action, local_tli); log_detail(_("local node lsn is %X/%X, %s target lsn is %X/%X"), format_lsn(local_xlogpos), action, format_lsn(follow_target_xlogpos)); + if (is_rejoin == true) + { + log_hint(_("the --force-rewind option is ineffective in this case")); + } + success = false; } }