{"Entry":{"collection":"waitevent","key":"activity/ReplicationSlotsyncShutdown","name":"ReplicationSlotsyncShutdown","aliases":["ReplicationSlotsyncShutdown"],"metadata":{"aliases":["ReplicationSlotsyncShutdown"],"changed_in":[],"changes":[{"from":"16","moved":null,"renamed":null,"reworded":null,"status":"added","to":"17"}],"content_hash":"0aa560e781076518aafd8187aab2955ca9862c635dcc1b87d99a408ddd964fb8","dossier":{"actions":{"en":["Match the row to backend_type.","Inspect the process-specific backlog and last-progress timestamp.","Fix the missing work signal or stalled upstream phase; do not kill a normally idle worker."],"zh":["先与 backend_type 对照。","检查该进程专属的积压与最后进展时间。","修复缺失的工作信号或停滞的上游阶段，不要终止正常空闲的 worker。"]},"diagnostic_sql":[{"id":"sessions","min_version":"13","sql":"SELECT pid, backend_type, usename, datname, application_name,\n       state, now() - query_start AS query_age,\n       now() - xact_start AS xact_age,\n       wait_event_type, wait_event,\n       pg_blocking_pids(pid) AS blocking_pids,\n       left(query, 160) AS query\nFROM pg_stat_activity\nWHERE wait_event_type = 'Activity'\n  AND wait_event = 'ReplicationSlotsyncShutdown'\nORDER BY query_age DESC NULLS LAST;","title":"Sessions waiting on Activity/ReplicationSlotsyncShutdown","title_zh":"正在等待 Activity/ReplicationSlotsyncShutdown 的会话"},{"id":"cohort","min_version":"13","sql":"SELECT wait_event, count(*) AS waiting_sessions,\n       count(*) FILTER (WHERE state = 'active') AS active_waiters,\n       max(now() - query_start) AS oldest_query\nFROM pg_stat_activity\nWHERE wait_event_type = 'Activity'\nGROUP BY wait_event\nORDER BY waiting_sessions DESC, wait_event;","title":"Current Activity cohort","title_zh":"当前 Activity 等待分布"},{"id":"lock_objects","min_version":"13","sql":"SELECT a.pid, l.locktype, l.mode, l.granted, l.fastpath,\n       d.datname, n.nspname, c.relname,\n       l.page, l.tuple, l.virtualxid, l.transactionid,\n       l.classid, l.objid, l.objsubid\nFROM pg_stat_activity AS a\nLEFT JOIN pg_locks AS l ON l.pid = a.pid\nLEFT JOIN pg_database AS d ON d.oid = l.database\nLEFT JOIN pg_class AS c\n  ON c.oid = l.relation\n AND l.database = (\n       SELECT oid FROM pg_database WHERE datname = current_database()\n     )\nLEFT JOIN pg_namespace AS n ON n.oid = c.relnamespace\nWHERE a.wait_event_type = 'Activity'\n  AND a.wait_event = 'ReplicationSlotsyncShutdown'\nORDER BY a.pid, l.granted, l.locktype, l.mode;","title":"Lock and relation context for these sessions","title_zh":"这些会话的锁与关系上下文"}],"emission":{"status":"active","verified_release":"18.6"},"incident_pattern":{"en":"","zh":""},"mechanism":{"en":"`WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN` at `src/backend/replication/logical/slotsync.c:1732` is the grep-verified reporting path. The public identity/resource is mapped at `src/backend/utils/activity/wait_event_names.txt:66`. The instrumented operation is: Waiting for slot sync worker to shut down. The ReplicationSlotsyncShutdown background path reports this event around its latch wait when its main loop has no immediate work. A signal, timeout, or new work clears the sleep and the process loops again.","zh":"`WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN` 位于 `src/backend/replication/logical/slotsync.c:1732`，是经 grep 核验的报告路径。公共身份/资源映射位于 `src/backend/utils/activity/wait_event_names.txt:66`。探针覆盖的操作是：等待复制槽同步 worker 停止运行。ReplicationSlotsyncShutdown 后台路径在主循环暂时无事可做、进入 latch wait 前报告此事件；信号、计时器或新工作会唤醒进程并进入下一轮循环。"},"metrics":["waiting_sessions","wait_event_share"],"normal":{"en":"This is normally expected idleness for the matching background process.","zh":"对匹配的后台进程而言，这通常是预期空闲。"},"official_descriptions":{"17":"Waiting for slot sync worker to shut down","18":"Waiting for slot sync worker to shut down"},"record_kind":"event","source_locations":[{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"10L, WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN);","grep_pattern":"WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN","grep_verified":true,"kind":"trigger","line":1732,"major":18,"path":"src/backend/replication/logical/slotsync.c","status":"live_trigger","symbol":"WAIT_EVENT_REPLICATION_SLOTSYNC_SHUTDOWN","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/replication/logical/slotsync.c#L1732","version":"18.6"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"REPLICATION_SLOTSYNC_SHUTDOWN\t\"Waiting for slot sync worker to shut down.\"","grep_pattern":"REPLICATION_SLOTSYNC_SHUTDOWN","grep_verified":true,"kind":"catalog_definition","line":66,"major":18,"path":"src/backend/utils/activity/wait_event_names.txt","status":"live_trigger","symbol":"REPLICATION_SLOTSYNC_SHUTDOWN","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/utils/activity/wait_event_names.txt#L66","version":"18.6"}],"source_status":"live_trigger","trouble":{"en":"Investigate only when queued work or a shutdown/failover deadline is not advancing while the process remains here, or when the event appears on an unexpected backend type.","zh":"只有工作队列、关闭或故障切换时限没有推进但进程一直停在这里，或事件出现在不匹配的后端类型上时，才需要调查。"}},"first_version":"17","has_dossier":true,"imported_at":"2026-09-27T17:57:32.493261+08:00","key":"activity/replicationslotsyncshutdown","last_version":"20","name":"ReplicationSlotsyncShutdown","position":14,"present_in":["17","18","19","20"],"slug":"replication-slotsync-shutdown","source_rev":"english-manuals:792571e7d7e21fabb160ec060f7575e3f16edd7bafffea17e275fc3a152f3801","summary":"Waiting for slot sync worker to shut down.","summary_zh":"","type":"Activity","type_slug":"activity","type_variants":["Activity"]}},"Definition":{"Collection":"waitevent","Key":"activity/ReplicationSlotsyncShutdown","SourceDatabase":"center","Version":"18","SourceTable":"waitevent","SourceKey":"activity/replicationslotsyncshutdown","SourceRevision":"english-manuals:792571e7d7e21fabb160ec060f7575e3f16edd7bafffea17e275fc3a152f3801","Facts":{"description":"Waiting for slot sync worker to shut down.","description_zh":"","doc":{"anchor":"WAIT-EVENT-ACTIVITY-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"lang":"en","name":"ReplicationSlotsyncShutdown","source":"english-manual","type":"Activity","zh_from":""},"ManualEvidence":{"doc":{"anchor":"WAIT-EVENT-ACTIVITY-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"waitevent","Key":"activity/ReplicationSlotsyncShutdown","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ReplicationSlotsyncShutdown","Summary":"等待复制槽同步工作进程关闭。","BodyHTML":"\u003cp\u003e等待复制槽同步工作进程关闭。\u003c/p\u003e","SourceRevision":"2026-08-31@34d13c8","ContentHash":"d533c2aff3e94f39dd03bf73178cd2d543e79b4ba54b67d9d59fbf6bc03b3df9","Payload":{"description_zh":"等待复制槽同步工作进程关闭。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
