{"Entry":{"collection":"guc","key":"max_repack_replication_slots","name":"max_repack_replication_slots","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Replication / Sending Servers","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"18","status":"added","to":"19"}],"content_hash":"6217b77aff4e1469e93ca58bd0ee35dbc03ecfe8648b2cac072968fe98a4e024","context":"","default_changed_in":[],"default_history":[{"from":"19","to":"19","value":"5"}],"editorial":{"advice":{"olap":"Account for large transactions, bulk loads, slow apply, and long-distance links. A short timeout can make shutdown faster but transfer recovery work and inconsistency risk to the next startup.","oltp":"Model normal failover and worst-case lag before setting a bound. Observe sender state, retained WAL, shutdown time, and receiver catch-up; preserve enough capacity for monitoring and planned switchovers.","small":"Use few slots and senders, watch pg_wal disk consumption, and keep timeout behavior explicit. Test shutdown and restart with the receiver both healthy and unavailable."},"mechanism":["PostgreSQL describes max_repack_replication_slots as follows: “Sets the maximum number of replication slots for use by REPACK.” The value is fixed when the server starts, so changing it requires a controlled restart. The atlas measures it in PG19 Beta 3; boot_val is the compiled or initialized baseline, not proof of a running cluster's effective setting.","PostgreSQL 19's REPACK command can use dedicated replication slots to reorganize a relation concurrently while tracking changes. This startup ceiling reserves how many such slots the server can support; it interacts with the overall replication-slot and WAL-sender budgets and with retained-WAL disk risk.","Read it together with max_replication_slots, max_wal_senders, wal_level, max_slot_wal_keep_size. Check SHOW and pg_settings on the target server, verify the source and pending_restart fields, and compare workload, logs, and resource metrics before and after any change."],"pitfalls":["Treating the measured boot_val for max_repack_replication_slots as proof of the effective value on an initialized or managed cluster.","Applying a change as though it were immediate while pg_settings reports postmaster context.","Changing this setting in isolation without checking the linked limits, observability, and rollback path.","Depending on beta behavior in production without retesting the PostgreSQL 19 final release."],"references":[{"title":"PostgreSQL 19 Beta 4: max_repack_replication_slots","url":"https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-MAX-REPACK-REPLICATION-SLOTS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_replication_slots","max_wal_senders","wal_level","max_slot_wal_keep_size","wal_sender_shutdown_timeout"],"summary":"max_repack_replication_slots — Sets the maximum number of replication slots for use by REPACK. Observed in PG19 Beta 4; its last measured boot default is 5 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"19","group":"Replication","group_slug":"replication","imported_at":"2026-09-27T17:57:31.734207+08:00","intro_commit":{"authored_at":"2026-04-07T16:55:29+02:00","discussion":["https://postgr.es/m/202604012148.nnnmyxxrr6nh@alvherre.pgsql"],"hash":"e76d8c749c3152657711ed733f0aea61c0e36a91","subject":"Reserve replication slots specifically for REPACK","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=e76d8c749c3152657711ed733f0aea61c0e36a91"},"key":"max_repack_replication_slots","last_version":"20","max_val":"","min_val":"","name":"max_repack_replication_slots","position":281,"present_in":["19","20"],"short_desc":"Specifies the maximum number of replication slots for use of the REPACK command.","short_desc_zh":"","source_rev":"english-manuals:55ecc9dacaa1d3e4ab833a01ab5da30d0f8238f31d8f74967433f6f9e070fb40","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_repack_replication_slots","SourceDatabase":"center","Version":"20","SourceTable":"guc","SourceKey":"max_repack_replication_slots","SourceRevision":"english-manuals:55ecc9dacaa1d3e4ab833a01ab5da30d0f8238f31d8f74967433f6f9e070fb40","Facts":{"boot_val":null,"category":"Sending Servers","context":"","description":"Specifies the maximum number of replication slots for use of the REPACK command. The default is 5. This parameter can only be set at server start.","doc":{"anchor":"GUC-MAX-REPACK-REPLICATION-SLOTS","file":"runtime-config-replication.html","lang":"en","sha256":"5170b5139753c7441f6fd08cbfe72a6ddbff25b9b340bfb6a73f70d2d32c2ca3","slug":"devel"},"documented":true,"enumvals":[],"extra_desc":"","lang":"en","max_val":null,"metadata_version":"","min_val":null,"name":"max_repack_replication_slots","short_desc":"","source":"english-manual","unit":"","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-REPACK-REPLICATION-SLOTS","file":"runtime-config-replication.html","lang":"en","sha256":"5170b5139753c7441f6fd08cbfe72a6ddbff25b9b340bfb6a73f70d2d32c2ca3","slug":"devel"}},"MeasuredEvidence":{"metadata_version":""}},"Text":{"Collection":"guc","Key":"max_repack_replication_slots","SourceDatabase":"center","Version":"20","Locale":"en","Title":"max_repack_replication_slots","Summary":"Specifies the maximum number of replication slots for use of the REPACK command. The default is 5. This parameter can only be set at server start.","BodyHTML":"\u003cp\u003eSpecifies the maximum number of replication slots for use of the REPACK command. The default is 5. This parameter can only be set at server start.\u003c/p\u003e","SourceRevision":"english-manuals:55ecc9dacaa1d3e4ab833a01ab5da30d0f8238f31d8f74967433f6f9e070fb40","ContentHash":"1c7b8319dcbc9c9e8011b077bfd611540d47f8ebc47a3a476f92ef259478ff31","Payload":{"description":"Specifies the maximum number of replication slots for use of the REPACK command. The default is 5. This parameter can only be set at server start."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
