Fix a problem that caused a standby to promote itself without going to

voting procedure.

This is because of a race condition inside CheckPrimaryConnection().

This has independently reported by Alex Railean and Dumitru, and Frank Jördens.
Analyzed and fixed by Cédric Villemain.

The fix have been verified to work by Frank
This commit is contained in:
Jaime Casanova
2012-12-19 11:45:58 -05:00
parent 93a999adc7
commit 2a5d431481

View File

@@ -792,7 +792,7 @@ CheckPrimaryConnection(void)
{
log_info(_("%s: Connection to master has been restored.\n"), progname);
}
break;
return true;
}
}
if (!is_pgup(primaryConn, local_options.master_response_timeout))