From 7f534bdb15e89ca3ed88712c457cee7d69892da3 Mon Sep 17 00:00:00 2001 From: Aleksander Alekseev Date: Mon, 16 Jan 2023 12:23:30 +0300 Subject: [PATCH v3 1/4] Correct the docs about preventing XID wraparound Prior to this commit the documentation was somewhat misleading. It stated that the system will "shutdown" in order to prevent XID wraparound. This is not what actually happens though. Actually the system refuses to allocate new XIDs. XIDs are allocated lazily and not needed for checking the visibility rules. Thus read-only transaction will continues to execute. Additionally, read-write transactions that are in progress and have an allocated XID will continue to execute and can be committed. Author: Aleksander Alekseev Reviewed-by: John Naylor Discussion: https://postgr.es/m/CAJ7c6TM2D277U2wH8X78kg8pH3tdUqebV3_JCJqAkYQFHCFzeg@mail.gmail.com --- doc/src/sgml/maintenance.sgml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/src/sgml/maintenance.sgml b/doc/src/sgml/maintenance.sgml index 9cf9d030a8..92d99a8f8c 100644 --- a/doc/src/sgml/maintenance.sgml +++ b/doc/src/sgml/maintenance.sgml @@ -663,24 +663,24 @@ HINT: To avoid a database shutdown, execute a database-wide VACUUM in that data 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 shut down and refuse to start any new - transactions once there are fewer than three million transactions left - until wraparound: + If these warnings are ignored, the system will refuse to allocate new XIDs + once there are fewer than three million transactions left until wraparound: ERROR: database is not accepting commands to avoid wraparound data loss in database "mydb" HINT: Stop the postmaster and vacuum that database in single-user mode. + In this condition any transactions already started can continue. + Only new read-only transactions can be started. + The three-million-transaction safety margin exists to let the administrator recover without data loss, by manually executing the - required VACUUM commands. However, since the system will not - execute commands once it has gone into the safety shutdown mode, + required VACUUM commands. However the only way to do this is to stop the server and start the server in single-user - mode to execute VACUUM. The shutdown mode is not enforced - in single-user mode. See the reference - page for details about using single-user mode. + mode to execute VACUUM. See the + reference page for details about using + single-user mode. -- 2.39.2