pg_rewind发生int型溢出(bug)
博客专区 > pg_edb 的博客 > 博客详情
pg_rewind发生int型溢出(bug)
pg_edb 发表于4个月前
pg_rewind发生int型溢出(bug)
  • 发表于 4个月前
  • 阅读 1
  • 收藏 0
  • 点赞 0
  • 评论 0

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.

共有 人打赏支持
粉丝 0
博文 5
码字总数 2203
×
pg_edb
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: