{"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"}],"derived_content_hash":"eff3e08120e7e678b37507521e99af297db54e99620d5ce58a28e5f744e689ec","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:48f130d61c46e7589d1d5e04f23766734c6355564ca2318cc9551ad177c12aa9","versions":{"18":"18.7","19":"19rc2"}},"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"],"repair_provenance":{"original_source_revision":"english-manuals:6427b6e4bb67ec26463dd7e972d457aca969ff14a5176cc6cadee9fb6f64f12f","receipt_sha256":"eb4ea0496c583bd4dfd200078f98c7dfa91142d2223c92bffdbbd9a7003dc8d3","repair":"wiki-repair-20261023"},"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":"wiki-repair-20261023:48f130d61c46e7589d1d5e04f23766734c6355564ca2318cc9551ad177c12aa9","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_active_replication_origins","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_active_replication_origins","SourceRevision":"wiki-repair-20261023:48f130d61c46e7589d1d5e04f23766734c6355564ca2318cc9551ad177c12aa9","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.","description_zh":"指定同时可以跟踪多少个复制源（参见第 48 章），从而实际上限制了服务器上可以创建多少逻辑复制订阅。将其设置为低于当前正在跟踪的复制源数量（体现在 pg_replication_origin_status 中）会阻止服务器启动。默认值为 10。该参数只能在服务器启动时设置。max_active_replication_origins 至少必须设置为订阅者上要添加的订阅数量，再加上一些用于表同步的预留。","description_zh_html":"\u003cp\u003e\n\t        指定同时可以跟踪多少个复制源（参见\u003ca class=\"xref\" href=\"/zh/docs/18/replication-origins.html\" title=\"第 48 章 复制进度跟踪\"\u003e第 48 章\u003c/a\u003e），从而实际上限制了服务器上可以创建多少逻辑复制订阅。将其设置为低于当前正在跟踪的复制源数量（体现在 \u003ca class=\"link\" href=\"/zh/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 至少必须设置为订阅者上要添加的订阅数量，再加上一些用于表同步的预留。\n\t       \u003c/p\u003e","doc":{"anchor":"GUC-MAX-ACTIVE-REPLICATION-ORIGINS","file":"runtime-config-replication.html","lang":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","slug":"18"},"doc_html":"\u003cp\u003e\n        Specifies how many replication origins (see\n        \u003ca class=\"xref\" href=\"/docs/18/replication-origins.html\" title=\"Chapter 48. Replication Progress Tracking\"\u003eChapter 48\u003c/a\u003e) can be tracked simultaneously,\n        effectively limiting how many logical replication subscriptions can\n        be created on the server. Setting it to a lower value than the current\n        number of tracked replication origins (reflected in\n        \u003ca class=\"link\" href=\"/docs/18/view-pg-replication-origin-status.html\" title=\"53.19. pg_replication_origin_status\"\u003epg_replication_origin_status\u003c/a\u003e)\n        will prevent the server from starting. It defaults to 10. This parameter\n        can only be set at server start.\n\n        \u003ccode class=\"literal\"\u003emax_active_replication_origins\u003c/code\u003e must be set to at least the\n        number of subscriptions that will be added to the subscriber, plus some\n        reserve for table synchronization.\n       \u003c/p\u003e","doc_same_as":"","documentation_revision":{"inputs":[{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","version":"18.7"},{"file":"runtime-config-replication.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"83907b5f469e979a7b9ec875b5e7bdaa2ef6b85596ca31b45174f68cd7398b18","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"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","translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/runtime-config-replication.html","sha256":"52bd5892f7e5511d05f46fc0c13a017de85307c674a9014948eb4ad480326c15"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"unit":null,"vartype":"integer","zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-ACTIVE-REPLICATION-ORIGINS","file":"runtime-config-replication.html","lang":"en","sha256":"c0b8bd86131ec62d4df97ce480d004aa7e3544477d053f0c2d4047b9edad5cc0","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_active_replication_origins","SourceDatabase":"center","Version":"18","Locale":"en","Title":"max_active_replication_origins","Summary":"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.","BodyHTML":"\u003cp\u003e\n        Specifies how many replication origins (see\n        \u003ca href=\"/docs/18/replication-origins.html\" rel=\"nofollow\"\u003eChapter 48\u003c/a\u003e) can be tracked simultaneously,\n        effectively limiting how many logical replication subscriptions can\n        be created on the server. Setting it to a lower value than the current\n        number of tracked replication origins (reflected in\n        \u003ca href=\"/docs/18/view-pg-replication-origin-status.html\" rel=\"nofollow\"\u003epg_replication_origin_status\u003c/a\u003e)\n        will prevent the server from starting. It defaults to 10. This parameter\n        can only be set at server start.\n\n        \u003ccode\u003emax_active_replication_origins\u003c/code\u003e must be set to at least the\n        number of subscriptions that will be added to the subscriber, plus some\n        reserve for table synchronization.\n       \u003c/p\u003e","SourceRevision":"wiki-repair-20261023:48f130d61c46e7589d1d5e04f23766734c6355564ca2318cc9551ad177c12aa9","ContentHash":"bf86c610518e2debb3756b4ebac10ae6072ce19fc0cd71f84731b06560c14063","Payload":{"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."}},"RequestedLocale":"en","Fallback":false,"Versions":["18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
