]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Remove replication slot advice from MultiXact wraparound hints
authorFujii Masao <fujii@postgresql.org>
Fri, 3 Jul 2026 02:22:15 +0000 (11:22 +0900)
committerFujii Masao <fujii@postgresql.org>
Fri, 3 Jul 2026 02:22:55 +0000 (11:22 +0900)
Previously, MultiXactId wraparound hints suggested dropping stale
replication slots. While that advice is appropriate for transaction ID
wraparound, where replication slots can hold back XID horizons,
it was misleading for MultiXactId wraparound. Following it could lead
users to drop replication slots unnecessarily without helping resolve
the MultiXactId wraparound condition.

MultiXact cleanup is not directly delayed by replication slots.
Instead, it depends on whether old MultiXactIds can still be seen
as live by running transactions.

This commit removes the replication slot advice from MultiXactId
wraparound hints, and documents that stale replication slots are
normally not relevant to resolving MultiXactId wraparound problems.

Backpatch to all supported branches.

BUG #18876
Reported-by: Haruka Takatsuka <harukat@sraoss.co.jp>
Author: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/18876-0d0b53bad5a1f4c1@postgresql.org
Backpatch-through: 14

doc/src/sgml/maintenance.sgml
src/backend/access/transam/multixact.c

index 1ab5bfd0ae411cf4d244ff93fb9993b3b32a0416..f494c69cdc7067342c4d35aa7fb03d119dc450f0 100644 (file)
@@ -800,6 +800,12 @@ HINT:  Stop the postmaster and vacuum that database in single-user mode.
       <simpara>Running transactions and prepared transactions can be ignored if there
        is no chance that they might appear in a multixact.</simpara>
      </listitem>
+     <listitem>
+      <simpara>Unlike transaction ID wraparound, replication slots do not
+       directly hold back multixact cleanup. Dropping stale replication
+       slots is therefore not usually relevant to resolving multixact ID
+       wraparound problems.</simpara>
+     </listitem>
      <listitem>
       <simpara>MXID information is not directly visible in system views such as
        <literal>pg_stat_activity</literal>; however, looking for old XIDs is still a good
index 0b26ea7be3786710d3fec16708e94bba4e67ff24..50c8d9220e1d5259611e3e3fa3ec087100c0beac 100644 (file)
@@ -1158,14 +1158,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
                                                 errmsg("database is not accepting commands that generate new MultiXactIds to avoid wraparound data loss in database \"%s\"",
                                                                oldest_datname),
                                                 errhint("Execute a database-wide VACUUM in that database.\n"
-                                                                "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                                "You might also need to commit or roll back old prepared transactions.")));
                        else
                                ereport(ERROR,
                                                (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
                                                 errmsg("database is not accepting commands that generate new MultiXactIds to avoid wraparound data loss in database with OID %u",
                                                                oldest_datoid),
                                                 errhint("Execute a database-wide VACUUM in that database.\n"
-                                                                "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                                "You might also need to commit or roll back old prepared transactions.")));
                }
 
                /*
@@ -1189,7 +1189,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
                                                                           oldest_datname,
                                                                           multiWrapLimit - result),
                                                 errhint("Execute a database-wide VACUUM in that database.\n"
-                                                                "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                                "You might also need to commit or roll back old prepared transactions.")));
                        else
                                ereport(WARNING,
                                                (errmsg_plural("database with OID %u must be vacuumed before %u more MultiXactId is used",
@@ -1198,7 +1198,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
                                                                           oldest_datoid,
                                                                           multiWrapLimit - result),
                                                 errhint("Execute a database-wide VACUUM in that database.\n"
-                                                                "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                                "You might also need to commit or roll back old prepared transactions.")));
                }
 
                /* Re-acquire lock and start over */
@@ -2476,7 +2476,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
                                                                   oldest_datname,
                                                                   multiWrapLimit - curMulti),
                                         errhint("To avoid a database shutdown, execute a database-wide VACUUM in that database.\n"
-                                                        "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                        "You might also need to commit or roll back old prepared transactions.")));
                else
                        ereport(WARNING,
                                        (errmsg_plural("database with OID %u must be vacuumed before %u more MultiXactId is used",
@@ -2485,7 +2485,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
                                                                   oldest_datoid,
                                                                   multiWrapLimit - curMulti),
                                         errhint("To avoid a database shutdown, execute a database-wide VACUUM in that database.\n"
-                                                        "You might also need to commit or roll back old prepared transactions, or drop stale replication slots.")));
+                                                        "You might also need to commit or roll back old prepared transactions.")));
        }
 }