mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
Prevent "invalid LSN returned from node..." infinite loop
Currently in repmgrd3, if a repmgrd enters failover, but one or more other repmgrds do not (e.g. partial primary invisibility), the repmgrd in failover may enter an infinite loop waiting for the repmgrd(s) not in failover to update shared memory.
This commit is contained in:
18
repmgr.c
18
repmgr.c
@@ -4201,27 +4201,13 @@ stop_backup:
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
static void
|
||||
parse_lsn(XLogRecPtr *ptr, const char *str)
|
||||
{
|
||||
uint32 high, low;
|
||||
|
||||
if (sscanf(str, "%x/%x", &high, &low) != 2)
|
||||
return;
|
||||
|
||||
*ptr = (((XLogRecPtr)high) << 32) + (XLogRecPtr)low;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static XLogRecPtr
|
||||
parse_label_lsn(const char *label_key, const char *label_value)
|
||||
{
|
||||
XLogRecPtr ptr = InvalidXLogRecPtr;
|
||||
XLogRecPtr ptr = parse_lsn(label_value);
|
||||
|
||||
parse_lsn(&ptr, label_value);
|
||||
|
||||
/* parse_lsn() will not modify ptr if it can't parse the label value */
|
||||
/* parse_lsn() will return InvalidXLogRecPtr if it can't parse the label value */
|
||||
if (ptr == InvalidXLogRecPtr)
|
||||
{
|
||||
log_err(_("Couldn't parse backup label entry \"%s: %s\" as lsn"),
|
||||
|
||||
Reference in New Issue
Block a user