From ef5448479cea756c349ab2b46138477250cbac8e Mon Sep 17 00:00:00 2001 From: John Naylor Date: Mon, 1 May 2023 19:07:37 +0700 Subject: [PATCH v8 3/3] Rough draft of complete steps to recover from (M)XID generation failure --- doc/src/sgml/maintenance.sgml | 53 +++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 116d6187cd..8b9f34074b 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -678,6 +678,20 @@ HINT: Execute a database-wide VACUUM in that database. The VACUUM command can still be run normally to recover. + + However, it is first necessary to remove obstacles to advancing the XID horizon: + + + + Commit or rollback any prepared transactions + + + Terminate any sessions that might have open transactions + + + Drop any old replication slots + + @@ -763,6 +777,45 @@ HINT: Execute a database-wide VACUUM in that database. have the oldest multixact-age. Both of these kinds of aggressive scans will occur even if autovacuum is nominally disabled. + + + + If for some reason autovacuum fails to clear old MXIDs from a table, the + system will begin to emit warning messages like this when the database's + oldest XIDs reach forty million transactions from the wraparound point: + + +WARNING: database "mydb" must be vacuumed within 39985967 transactions +HINT: To prevent MultiXactId generation failure, execute a database-wide VACUUM in that database. + + + + (A manual VACUUM should fix the problem, as suggested by the + hint; but note that the VACUUM must be performed by a + superuser, else it will fail to process system catalogs and thus not + be able to advance the database's datfrozenxid.) + If these warnings are + ignored, the system will refuse to generate new MXIDs once there are + fewer than three million left until wraparound: + + +ERROR: database is not accepting commands that generate new MultiXactIds to avoid wraparound data loss in database "mydb" +HINT: Execute a database-wide VACUUM in that database. + + + + + To restore normal operation, it is first necessary to remove obstacles to advancing the MXID horizon: + + + Commit or rollback each prepared transaction that might appear in a multixact + + + Resolve each transaction that might appear in a multixact + + + + -- 2.39.2