Azure PostgreSQL 突然使用所有存储
Azure PostgreSQL suddenly uses all storage
昨天,我一直在追加的 'Azure Database for PostgreSQL server' 数据库突然增加了它的增长率并用完了所有存储空间,并且脚本报告了错误,因为连接变为只读。
磁盘上数据库大小的查询加起来不像 18GB
select pg_size_pretty(pg_database_size('database_alpha')) => '80 MB'
select pg_size_pretty(pg_database_size('database_beta')) => '458 MB'
select pg_size_pretty(pg_database_size('postgres')) => '8645 kB'
如果不是我的数据库,什么可能在使用存储,我如何防止它在未来发生?
查看日志,下午 5 点左右开始出现很多类似于以下内容的条目:
2018-08-26 15:52:39 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:52:49 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:52:56 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:00 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:04 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:08 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:11 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
我猜是硬件故障阻止了它写入 WAL 并且正在使用 space,它现在似乎已经恢复:
昨天,我一直在追加的 'Azure Database for PostgreSQL server' 数据库突然增加了它的增长率并用完了所有存储空间,并且脚本报告了错误,因为连接变为只读。
磁盘上数据库大小的查询加起来不像 18GB
select pg_size_pretty(pg_database_size('database_alpha')) => '80 MB'
select pg_size_pretty(pg_database_size('database_beta')) => '458 MB'
select pg_size_pretty(pg_database_size('postgres')) => '8645 kB'
如果不是我的数据库,什么可能在使用存储,我如何防止它在未来发生?
查看日志,下午 5 点左右开始出现很多类似于以下内容的条目:
2018-08-26 15:52:39 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:52:49 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:52:56 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:00 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:04 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:08 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
2018-08-26 15:53:11 UTC-5b819a84.45490-WARNING: archiving write-ahead log file "000000010000004E000000DA" failed too many times, will try again later
我猜是硬件故障阻止了它写入 WAL 并且正在使用 space,它现在似乎已经恢复: