开发者社区> 问答> 正文

postgresql 插入执行失败

Caused by: org.postgresql.util.PSQLException: ERROR: unexpected data beyond EOF in block 0 of relation base/18101/63191
Hint: This has been seen to occur with buggy kernels; consider updating your system.
Where: SQL statement "insert into tb_conf_attribute(confid,attrid,attrvalue) values(72141388,1,'true'),**"
PL/pgSQL function createorupdateconf(text,text,text,text,integer,integer) line 12 at EXECUTE statement

展开
收起
smithdep 2015-12-22 09:38:06 7582 0
2 条回答
写回答
取消 提交回答
  • @digoal Linux version 3.2.0-67-generic (buildd@brownie) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #101-Ubuntu SMP Tue Jul 15 17:46:11 UTC 2014 我们有多台服务器,系统和数据库的版本都是一样的,这次移植到新服务器出现这个问题。 至于zero_damaged_pages这个参数应该没有设置


    @digoal zero_damaged_pages参数是设置成的false,至于升级内核,具体是要升级到什么版本?

    2019-07-17 18:20:31
    赞同 展开评论 打赏
  • 公益是一辈子的事, I am digoal, just do it. 阿里云数据库团队, 擅长PolarDB, PostgreSQL, DuckDB, ADB等, 长期致力于推动开源数据库技术、生态在中国的发展与开源产业人才培养. 曾荣获阿里巴巴麒麟布道师称号、2018届OSCAR开源尖峰人物.
    1. 什么操作系统内核版本?
    2. 有没有打开参数zero_damaged_pages?

    从现象来看,建议你确认一下zero_damaged_pages这个参数是否打开,如果打开了,请关闭它。
    如果没有打开,建议你升级内核。

                    /*
                     * We get here only in the corner case where we are trying to extend
                     * the relation but we found a pre-existing buffer marked BM_VALID.
                     * This can happen because mdread doesn't complain about reads beyond
                     * EOF (when zero_damaged_pages is ON) and so a previous attempt to
                     * read a block beyond EOF could have left a "valid" zero-filled
                     * buffer.  Unfortunately, we have also seen this case occurring
                     * because of buggy Linux kernels that sometimes return an
                     * lseek(SEEK_END) result that doesn't account for a recent write. In
                     * that situation, the pre-existing buffer would contain valid data
                     * that we don't want to overwrite.  Since the legitimate case should
                     * always have left a zero-filled buffer, complain if not PageIsNew.
                     */
                    bufBlock = isLocalBuf ? LocalBufHdrGetBlock(bufHdr) : BufHdrGetBlock(bufHdr);
                    if (!PageIsNew((Page) bufBlock))
                            ereport(ERROR,
                             (errmsg("unexpected data beyond EOF in block %u of relation %s",
                                             blockNum, relpath(smgr->smgr_rnode, forkNum)),
                              errhint("This has been seen to occur with buggy kernels; consider updating your system.")));
    2019-07-17 18:20:31
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PolarDB for PostgreSQL三节点功能介绍 立即下载
PostgreSQL复制原理及高可用集群 立即下载
为什么PostgreSQL是最适合去O的数据库 立即下载

相关镜像