简体   繁体   中英

Postgres wraparound problems

I have facing one problem with my Production PostgreSQL and which is related to Wraparound Problem basically for over limit of XID range.

This PostgreSQL Production is running more than 1 year with loads of transaction and bulk insertion.

I searched lot in google but confuse and very scare about this critical error. Right now I am getting this error during any vacuum or auto-vacuum stuff. I have around 250 GB of Postgres Production Database and I have also set auto-vacuum for all tables.

Error and Warning are:

WARNING:  oldest xmin is far in the past
HINT:  Close open transactions soon to avoid wraparound problems.

I have also checked current open transaction but there is no any long running transaction in Postgres session.

Current database age of XID :
  Database       Age
"template1";  153163876
"template0";  153163876
"postgres";   153163876
"dispatcher"; 153163876
"qate";       195568300

above result I got using below query :

SELECT datname, age(datfrozenxid) FROM pg_database;

please provide your inputs as soon as possible because very soon, this will really create problem for my production database.

If you can afford to forcibly close open transactions:

SELECT pg_terminate_backend(procpid)
FROM   pg_stat_activity
WHERE  datname = 'mydb';

Then autovacuum can freeze rows, or you can run VACUUM manually. You may have to prevent new transactions temporarily. Here are detailed instructions:

.. except you don't DROP the db. Just VACUUM it.

Or Postgres will force a shutdown to prevent data loss. Detailed explanation in the manual.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM