【发布时间】:2017-01-14 00:20:42
【问题描述】:
我尝试使用Luigi 框架使用Python 脚本摄取大量数据(大约 100 个 csv 文件,每个文件有 1500 万行),并且摄取一直正常,直到我遇到以下错误 (来自 Postgres 日志),其中最重要的部分是:
2016-08-18 13:14:31.714 UTC,,,8508,,57b5b2ec.213c,1,,2016-08-18 13:06:52 UTC,13/109,0,PANIC,53100,"could not write to file ""pg_xlog/xlogtemp.8508"": No space left on device",,,,,"writing block 49526 of relation base/16384/22811",,,, ""
由于预写日志 (WAL) 机制,POSTGRES 似乎阻止了摄取。在摄取了 10 天的文件并重置数据库后,我尝试摄取更多天数。第二次尝试导致仅摄取了额外 1 天的数据量。第三次尝试完全失败。
是不是pg_xlog没有被清理?我不知道它们是如何管理的,确切的目的是什么,我的直觉说 WAL 是一种机制,POSTGRES 通过它写入要插入数据库的行。
有没有我遗漏的数据库配置?我的表上的索引有问题吗?还有什么?
日志中可能相关的其他部分:
2016-08-18 12:57:45.255 UTC,,,8342,,57b5a460.2096,96,,2016-08-18 12:04:48 UTC,,0,LOG,00000,"checkpoints are occurring too frequently (25 seconds apart)",,"Consider increasing the configuration parameter ""max_wal_size"".",,,,,,,""
2016-08-18 12:57:45.255 UTC,,,8342,,57b5a460.2096,97,,2016-08-18 12:04:48 UTC,,0,LOG,00000,"checkpoint starting: xlog",,,,,,,,,""
2016-08-18 12:58:13.609 UTC,,,8342,,57b5a460.2096,98,,2016-08-18 12:04:48 UTC,,0,LOG,00000,"checkpoint complete: wrote 349100 buffers (16.6%); 0 transaction log file(s) added, 143 removed, 0 recycled; write=15.550 s, sync=12.677 s, t otal=28.354 s; sync files=51, longest=2.304 s, average=0.248 s; distance=2641771 kB, estimate=2641771 kB",,,,,,,,,""
1038 2016-08-18 12:58:13.610 UTC,,,8342,,57b5a460.2096,99,,2016-08-18 12:04:48 UTC,,0,LOG,00000,"checkpoints are occurring too frequently (28 seconds apart)",,"Consider increasing the configuration parameter ""max_wal_size"".",,,,,,,""
1039 2016-08-18 12:58:13.610 UTC,,,8342,,57b5a460.2096,100,,2016-08-18 12:04:48 UTC,,0,LOG,00000,"checkpoint starting: xlog",,,,,,,,,""
谢谢
【问题讨论】:
标签: python postgresql