pg_rewind发生int型溢出(bug)

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值