pg_rewind 9.5以及9.6版本,在file的size大于2G以上时,会发生int型溢出。
unexpected result while sending file list: ERROR: value "2148022000" is out of range for type integer
/*
* First create a temporary table, and load it with the blocks that we
* need to fetch.
*/
sql = "CREATE TEMPORARY TABLE fetchchunks(path text, begin int4, len int4);";
res = PQexec(conn, sql);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
pg_fatal("could not create temporary table: %s",
PQresultErrorMessage(res));
PQclear(res);
sql = "COPY fetchchunks FROM STDIN";
res = PQexec(conn, sql);
if (PQresultStatus(res) != PGRES_COPY_IN)
pg_fatal("could not send file list: %s",
PQresultErrorMessage(res));
PQclear(res);
while ((res = PQgetResult(conn)) != NULL)
{
if (PQresultStatus(res) != PGRES_COMMAND_OK)
pg_fatal("unexpected result while sending file list: %s",
PQresultErrorMessage(res));
PQclear(res);
}
postgresql 9.6.4已经修复这个bug,参考。
https://www.postgresql.org/docs/9.6/static/release-9-6-4.html
Fix pg_rewind to correctly handle files exceeding 2GB (Kuntal Ghosh, Michael Paquier)
Ordinarily such files won't appear in PostgreSQL data directories, but they could be present in some cases.
本文介绍了一个PostgreSQL中pg_rewind在处理超过2GB大小的文件时出现的整数溢出问题,并提供了修复方案。该问题出现在9.5及9.6版本中,但在9.6.4版本中已被修复。

1896

被折叠的 条评论
为什么被折叠?



