{"Entry":{"collection":"guc","key":"max_active_replication_origins","name":"max_active_replication_origins","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Replication / Subscribers","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"17","status":"added","to":"18"}],"content_hash":"f8551b29e05db83a5e137a65e5c6b29ce953700565bc321d05973a94ec5c5f50","context":"","default_changed_in":[],"default_history":[{"from":"18","to":"19","value":"10"}],"editorial":{"advice":{"olap":"Read standbys and logical subscribers often see long queries or large transactions. Put explicit bounds on replay/apply and monitor lag, worker saturation, slot restart_lsn, and conflict cancellations.","oltp":"Size max_active_replication_origins from topology, failover roles, slot/subscription count, and reconnect headroom. Test worst-case primary latency, standby replay, and disk retention before production.","small":"Configure only replication capacity that is actually used. Even a small topology needs bounded timeouts and slot lifecycle; unlimited retention is not reliability."},"mechanism":["Sets the maximum number of active replication origins. The value is fixed when the server starts, so changing it requires a restart.","Each active logical replication origin tracks remote progress so apply can avoid replaying changes twice. The startup allocation effectively bounds concurrently active subscriptions/origins and consumes shared resources even though dormant catalog rows need not all be active.","Monitor and change max_active_replication_origins together with max_logical_replication_workers, max_replication_slots, track_commit_timestamp. Validate on the relevant server role and real workload, then use its postmaster context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Changing it on the wrong primary, standby, sender, or subscriber role.","Watching only configured bytes/time instead of actual lag, slot position, and worker state.","Failing over to a node that lacks the old primary's capacity or prerequisites.","Using infinite waits or WAL retention to hide a failed consumer."],"references":[{"title":"PostgreSQL 19 Beta 4: max_active_replication_origins","url":"https://www.postgresql.org/docs/19/runtime-config-replication.html#GUC-MAX-ACTIVE-REPLICATION-ORIGINS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_logical_replication_workers","max_replication_slots","track_commit_timestamp","max_parallel_apply_workers_per_subscription","max_sync_workers_per_subscription","hot_standby"],"summary":"max_active_replication_origins — Sets the maximum number of active replication origins. Observed in PG18–19 Beta 4; its last measured boot default is 10 in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"18","group":"Replication","group_slug":"replication","imported_at":"2026-09-27T17:57:31.67107+08:00","intro_commit":{"authored_at":"2025-03-21T12:20:15-07:00","discussion":["https://postgr.es/m/b81db436-8262-4575-b7c4-bc0c1551000b@app.fastmail.com"],"hash":"04ff636cbce4b91fba1f334e1bc0dc88686e7b2d","subject":"Add GUC option to control maximum active replication origins.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=04ff636cbce4b91fba1f334e1bc0dc88686e7b2d"},"key":"max_active_replication_origins","last_version":"20","max_val":"","min_val":"","name":"max_active_replication_origins","position":261,"present_in":["18","19","20"],"short_desc":"Specifies how many replication origins (see Chapter 48) can be tracked simultaneously, effectively limiting how many logical replication subscriptions can be created on the server.","short_desc_zh":"","source_rev":"english-manuals:6427b6e4bb67ec26463dd7e972d457aca969ff14a5176cc6cadee9fb6f64f12f","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_active_replication_origins","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_active_replication_origins","SourceRevision":"english-manuals:6427b6e4bb67ec26463dd7e972d457aca969ff14a5176cc6cadee9fb6f64f12f","Facts":{"boot_val":"10","category":"Replication / Subscribers","context":"postmaster","description":"Specifies how many replication origins (see Chapter 48) can be tracked simultaneously, effectively limiting how many logical replication subscriptions can be created on the server. Setting it to a lower value than the current number of tracked replication origins (reflected in pg_replication_origin_status) will prevent the server from starting. It defaults to 10. This parameter can only be set at server start. max_active_replication_origins must be set to at least the number of subscriptions that will be added to the subscriber, plus some reserve for table synchronization.","doc":{"anchor":"GUC-MAX-ACTIVE-REPLICATION-ORIGINS","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"},"documented":true,"enumvals":null,"extra_desc":null,"lang":"en","max_val":"262143","metadata_version":"18","min_val":"0","name":"max_active_replication_origins","short_desc":"Sets the maximum number of active replication origins.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-ACTIVE-REPLICATION-ORIGINS","file":"runtime-config-replication.html","lang":"en","sha256":"c78480a202f8579e2655e080060afe4859c9eb26a16318fb9099dabb178fb32d","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_active_replication_origins","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"max_active_replication_origins","Summary":"","BodyHTML":"\u003cp\u003e指定同时可以跟踪多少个复制源（参见\u003ca href=\"/docs/18/replication-origins.html\" rel=\"nofollow\"\u003e第 48 章\u003c/a\u003e），从而实际上限制了服务器上可以创建多少逻辑复制订阅。将其设置为低于当前正在跟踪的复制源数量（体现在\u003ca href=\"/docs/18/view-pg-replication-origin-status.html\" rel=\"nofollow\"\u003epg_replication_origin_status\u003c/a\u003e中）会阻止服务器启动。默认值为 10。该参数只能在服务器启动时设置。\u003ccode\u003emax_active_replication_origins\u003c/code\u003e至少必须设置为订阅者上要添加的订阅数量，再加上一些用于表同步的预留。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"999ef26cc746e21624da210c2b7fb8698e6b3428a327f441b74a2c28633d668c","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定同时可以跟踪多少个复制源（参见\u003ca href=\"/docs/18/replication-origins.html\" title=\"第 48 章 复制进度跟踪\"\u003e第 48 章\u003c/a\u003e），从而实际上限制了服务器上可以创建多少逻辑复制订阅。将其设置为低于当前正在跟踪的复制源数量（体现在\u003ca href=\"/docs/18/view-pg-replication-origin-status.html\" title=\"53.19. pg_replication_origin_status\"\u003epg_replication_origin_status\u003c/a\u003e中）会阻止服务器启动。默认值为 10。该参数只能在服务器启动时设置。\u003ccode class=\"literal\"\u003emax_active_replication_origins\u003c/code\u003e至少必须设置为订阅者上要添加的订阅数量，再加上一些用于表同步的预留。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
