提交 ebc440b4 编写于 作者: D Daniel Gustafsson 提交者: Xin Zhang

Report diff in block mismatch

Include the diff between the first mismatching byte in the log output
as we have it, and it can aid debugging (it just now helped me). Can't
hurt.
上级 3b190519
......@@ -345,6 +345,7 @@ retry:
char mirrorFileBuf[BLCKSZ];
int primaryFileBytesRead;
int mirrorFileBytesRead;
int diff;
CHECK_FOR_INTERRUPTS();
......@@ -416,13 +417,13 @@ retry:
}
}
if (memcmp(primaryFileBuf, mirrorFileBuf, primaryFileBytesRead) != 0)
if ((diff = memcmp(primaryFileBuf, mirrorFileBuf, primaryFileBytesRead)) != 0)
{
/* different contents */
ereport(NOTICE,
(errmsg("%s files \"%s\" and \"%s\" mismatch at blockno %u",
(errmsg("%s files \"%s\" and \"%s\" mismatch by %i at blockno %u",
get_relation_type_data(rentry->relam, rentry->relstorage, rentry->relkind).name,
primaryfilepath, mirrorfilepath, blockno)));
primaryfilepath, mirrorfilepath, diff, blockno)));
goto retry;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册