提交 a7d11627 编写于 作者: H Heikki Linnakangas

Use strcmp for string comparison.

On my laptop, with gcc -O, these comparisons didn't work as intended,
and as result, the FTS probe messages were not processed, and
gp_segment_configuration always claimed the mirrors to be down, even though
they were running OK.
上级 322770c5
......@@ -686,14 +686,14 @@ FtsWalRepSetupMessageContext(fts_context *context)
for (i = 0; i < context->num_primary_segments; i++)
{
probe_response_per_segment *response = &context->responses[i];
if (response->message == FTS_MSG_PROBE)
if (strcmp(response->message, FTS_MSG_PROBE) == 0)
{
response->message = NULL;
response->isScheduled = true;
}
else
{
Assert(response->message == FTS_MSG_SYNCREP_OFF);
Assert(strcmp(response->message, FTS_MSG_SYNCREP_OFF) == 0);
response->isScheduled = false;
response->result.isPrimaryAlive = false;
response->result.isInSync = false;
......
......@@ -213,10 +213,10 @@ ftsReceive(FtsConnectionInfo *ftsInfo)
* response. In that situation, we should force another probe to update
* the gp_segment_configuration to avoid waiting the fts probe interval.
*/
if (ftsInfo->message == FTS_MSG_PROBE)
if (strcmp(ftsInfo->message, FTS_MSG_PROBE) == 0)
probeRecordResponse(ftsInfo, lastResult);
/* Primary must have syncrep disabled in response to SYNCREP_OFF message. */
AssertImply(ftsInfo->message == FTS_MSG_SYNCREP_OFF,
AssertImply(strcmp(ftsInfo->message, FTS_MSG_SYNCREP_OFF) == 0,
PQgetvalue(lastResult, 0, Anum_fts_message_response_is_syncrep_enabled) != NULL &&
*(PQgetvalue(lastResult, 0, Anum_fts_message_response_is_syncrep_enabled)) == false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册