首页 > 解决方案 > postgresql 何时需要写入文件“pg_logical/replorigin_checkpoint.tmp”?

问题描述

Postgres(版本 10.10)在我的机器上崩溃(数据库连接变得不可能)。我检查了日志并看到

2019-10-11 15:46:41.262 UTC [30233] postgres_prod@syntax_prod LOG:  could not receive data from client: Connection reset by peer
2019-10-11 17:41:06.104 UTC [2001] PANIC:  could not write to file "pg_logical/replorigin_checkpoint.tmp": No space left on device
2019-10-11 17:41:06.364 UTC [1999] LOG:  checkpointer process (PID 2001) was terminated by signal 6: Aborted
2019-10-11 17:41:06.364 UTC [1999] LOG:  terminating any other active server processes
2019-10-11 17:41:06.364 UTC [1326] postgres_prod@syntax_prod WARNING:  terminating connection because of crash of another server process
2019-10-11 17:41:06.364 UTC [1326] postgres_prod@syntax_prod DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
...

我认为问题发生在

PANIC: could not write to file "pg_logical/replorigin_checkpoint.tmp": No space left on device

但是我的机器上还剩下 77 GB(我刚刚重新启动了 Postgres,到目前为止一切正常)。所以我不太了解 PANIC 错误消息。我想了解更多关于 postgres 必须写入文件“pg_logical/replorigin_checkpoint.tmp”的信息可能有助于我理解出了什么问题。所以我正在寻找这方面的信息。

标签: linuxpostgresqlpostgresql-10

解决方案


但我的机器上还剩 77 GB

大概您在错误发生时没有,或者可用空间位于要使用的错误分区上。错误后可能有很多临时文件被清理了,所以现在的可用空间并不意味着你当时有可用空间。也许您可以在不同的分区上设置一个临时表空间,这样它就无法在空间不足的情况下运行其他东西并使整个系统崩溃?

我想了解更多关于 postgres 必须写入文件“pg_logical/replorigin_checkpoint.tmp”的信息可能有助于我理解出了什么问题。

我很确定它不会。但这是检查点逻辑复制进度的一部分。它创建一个新文件,然后以原子方式将其重命名为旧文件。


推荐阅读