选择 打开 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / 错误代码 / Class 53 资源不足

53100 disk_full

ERROR 源码确认 详解 未实测

类别
Class 53 资源不足
严重等级
ERROR
条件名
disk_full
宏名称
ERRCODE_DISK_FULL
启用版本
7.4
状态
活跃

版本覆盖

速览

53100 表示文件写入进入明确的短写分支。固定路径覆盖基础备份输出和关系文件扩展;诊断会给出文件、已写/请求字节以及 offset 或 block。

含义

短写消息给出目标文件、已写/请求字节以及 offset 或 block,并提示 Check free disk space.。同一个 md.c 函数先把负的 FileWrite 结果交给 errcode_for_file_access()%m;固定 helper 的 saved-errno 分支把 ENOSPC 映射为 53100,但没有列出 EFBIGEDQUOT,它们会走 ERRCODE_INTERNAL_ERROR 默认分支。这是存储写入边界,不是普通 SQL 数据错误,也不能据此断言宿主卷已满。

报文模板

源码里的格式串,不是某一次运行的输出。%s 之类是占位符,实际报文会填入对象名与取值。适用范围一栏是核验时留下的原始英文记录,未经翻译。

主消息 could not write file "%s": wrote only %d of %d bytes at offset %lld
HINT Check free disk space.

来源:src/backend/backup/basebackup_server.c @ REL_18_6

主消息 could not extend file "%s": wrote only %d of %d bytes at block %u
HINT Check free disk space.

来源:src/backend/storage/smgr/md.c @ REL_18_6

主消息 could not extend file "%s": %m

来源:src/backend/storage/smgr/md.c @ REL_18_6 · src/backend/utils/error/elog.c @ REL_18_6

适用范围:The source selects errcode_for_file_access() from errno; this template is not itself proof that the resulting SQLSTATE is 53100.

诊断

按消息定位文件系统和路径,检查空间、配额、挂载状态、写入错误及受影响的数据库或备份卷,再把 offset/block 和部分字节数与操作及服务器日志对应。若 primary 是 could not ...: %m 而不是短写模板,应检查保存的 errno:固定 helper 把 ENOSPC 映射为 53100,但未列出的 EFBIGEDQUOT 会进入其 internal-error 默认分支。不能把 errno 对应的其他 SQLSTATE 重新标成 53100。

处理

在指定文件系统释放或增加容量、修复报告的写入条件,或改用合适目标。部分基础备份或关系写入在验证前都应视为不完整;按该操作的恢复流程处理。显式事务中若发生此 ERROR,重试前执行 ROLLBACKROLLBACK TO SAVEPOINT;自动提交只有在存储原因修复后才能重试。不要在用户实例制造磁盘压力。

版本

锁定目录从 7.4 记录;引用写入路径来自 PostgreSQL 18.6,未执行磁盘满运行。

来源

证据

断言

每条断言都写明了是怎么核实的,以及它不覆盖什么。这一层是核验时留下的原始英文记录,照原样呈现,未经翻译。

  • 53100 is disk_full in SQLSTATE Class 53.

    核实方式Read fixed definition.

    来源src/backend/utils/errcodes.txt

  • The cited PostgreSQL 18.6 source paths support the representative resource and object-state mechanisms described.

    核实方式Read complete fixed source contexts.

    不覆盖Source confirmation is not natural runtime.

    来源src/backend/backup/basebackup_server.c · src/backend/storage/smgr/md.c · src/backend/storage/smgr/md.c · src/backend/utils/error/elog.c

  • The relation write path sends a negative FileWrite result through errcode_for_file_access(), while a short write explicitly uses ERRCODE_DISK_FULL; these are separate source branches.

    核实方式Read the complete mdextend error branch.

    来源src/backend/storage/smgr/md.c

  • In the fixed errno helper, ENOSPC maps to ERRCODE_DISK_FULL; EFBIG and EDQUOT are not listed and therefore use the helper's default internal-error mapping.

    核实方式Read the complete saved-errno switch, including its default branch.

    不覆盖This records the PostgreSQL helper mapping; it does not claim that every operating-system write failure presents this SQLSTATE.

    来源src/backend/utils/error/elog.c

  • The locked catalogue records 53100 from 7.4; that boundary does not prove exact implementation introduction.

    核实方式Use catalogue boundary.

    来源src/backend/utils/errcodes.txt

同类错误代码

Class 53 资源不足 下的其他成员。