Print a message to command line if hawq switches from standby RPS to master RPS.
@@ -385,6 +385,7 @@ static int call_ranger_rest(CURL_HANDLE curl_handle, const char* request)
int ret = -1;
int retry = 2;
CURLcode res;
+ bool switchToMaster = false;
Assert(request != NULL);
/*
@@ -401,6 +402,7 @@ static int call_ranger_rest(CURL_HANDLE curl_handle, const char* request)
elog(RANGER_LOG,
"master has been talking to standby RPS for more than %d seconds, try switching to master RPS",
rps_check_local_interval);
+ switchToMaster = true;
}
}
@@ -464,6 +466,11 @@ static int call_ranger_rest(CURL_HANDLE curl_handle, const char* request)
}
else
{
+ if (switchToMaster && !curl_handle->talkingWithStandby)
+ {
+ /* master's RPS has recovered, switch from standby's RPS to master's RPS */
+ elog(NOTICE, "switch from standby's RPS to master's RPS");
+ }
if (curl_handle->talkingWithStandby && curl_handle->lastCheckTimestamp == 0)
{
curl_handle->lastCheckTimestamp = gettime_microsec();
