数据库日志和程序日志中都有报错
ERROR: database is not accepting commands to avoid wraparound data loss in database "template1"
HINT: Stop the postmaster and use a standalone backend to vacuum that database.
You might also need to commit or roll back old prepared transactions.
CONTEXT: SQL statement "UPDATE XXX SET min_horizon = buffer_ts WHERE peer = peer_id"
PL/pgSQL function kv.XXX(regclass,integer) line 21 at SQL statement
其实提示中说的很明确,
- 关闭数据库
- 进入standalone backend模式
- vacuum数据库
所以跟着这个步骤。执行
service postgresql stop
su - postgres
$ postgres --single -D /usr/local/pgsql/data DBNAME
PostgreSQL stand-alone backend 9.3.21
backend> vacuum freeze XXX;
2019-12-13 03:11:59 EST [79657]: [1-1] user=,db= LOG: duration: 14309.933 ms statement: vacuum freeze XXX;
启动数据库,观察日志。解决~