gpt4 book ai didi

postgresql - ActiveRecord::StatementInvalid: PG::DataCorrupted: 错误

转载 作者:行者123 更新时间:2023-11-29 13:59:47 37 4
gpt4 key购买 nike

这是完整的错误信息

ActiveRecord::StatementInvalid: PG::DataCorrupted: 错误:无法读取文件“base/50711/50722”中的 block 0:只读 8192 字节中的 0

这可能是什么根本原因?

最佳答案

来自 md.c 的错误报告。我认为您的 block 已损坏。您的文件系统设置或 block 设备设置不强?你可以设置 zero_damaged_pa​​ges 跳过这个 block 。

if (nbytes != BLCKSZ)
{
if (nbytes < 0)
ereport(ERROR,
(errcode_for_file_access(),
errmsg("could not read block %u in file \"%s\": %m",
blocknum, FilePathName(v->mdfd_vfd))));

/*
* Short read: we are at or past EOF, or we read a partial block at
* EOF. Normally this is an error; upper levels should never try to
* read a nonexistent block. However, if zero_damaged_pages is ON or
* we are InRecovery, we should instead return zeroes without
* complaining. This allows, for example, the case of trying to
* update a block that was later truncated away.
*/
if (zero_damaged_pages || InRecovery)
MemSet(buffer, 0, BLCKSZ);
else
ereport(ERROR,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg("could not read block %u in file \"%s\": read only %d of %d bytes",
blocknum, FilePathName(v->mdfd_vfd),
nbytes, BLCKSZ)));
}

关于postgresql - ActiveRecord::StatementInvalid: PG::DataCorrupted: 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23023860/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com