提交 591ba12e 编写于 作者: A Ashwin Agrawal

Reset synchronous_standby_names on FTS mirror promotion.

When FTS promotes mirror, in gp_segment_configuration it marks mirror as
not in sync ('n'). Hence, on mirror when promotion request is received,
best to reset the synchronous_standby_names. If this is not done,
commits hang/wait after promotion till next FTS probe cycle to detect
this condition and reset the synchronous_standby_names.
上级 2351a0e9
......@@ -339,7 +339,18 @@ HandleFtsWalRepPromote(void)
*/
DBState state = GetCurrentDBState();
if (state == DB_IN_STANDBY_MODE)
{
/*
* Reset sync_standby_names on promotion. This is to avoid commits
* hanging/waiting for replication till next FTS probe. Next FTS probe
* will detect this node to be not in sync and reset the same which
* can take a min. Since we know on mirror promotion its marked as not
* in sync in gp_segment_configuration, best to right away clean the
* sync_standby_names.
*/
UnsetSyncStandbysDefined();
SignalPromote();
}
else
{
elog(LOG, "ignoring promote request, walreceiver not running,"
......
......@@ -136,6 +136,7 @@ test_HandleFtsWalRepPromoteMirror(void **state)
am_mirror = true;
will_return(GetCurrentDBState, DB_IN_STANDBY_MODE);
will_be_called(UnsetSyncStandbysDefined);
will_be_called(SignalPromote);
FtsResponse mockresponse;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册