{"Entry":{"collection":"waitevent","key":"io/ReplicationSlotWrite","name":"ReplicationSlotWrite","aliases":["ReplicationSlotWrite"],"metadata":{"aliases":["ReplicationSlotWrite"],"changed_in":[],"changes":[{"from":"9.6","moved":null,"renamed":null,"reworded":null,"status":"added","to":"10"}],"content_hash":"2fa8963694a26a1a81affe388105ef50f65a5dc9ed89cfee378f8194d3ffdfe3","dossier":{"actions":{"en":["Confirm the workload phase should touch this file class.","Correlate with pg_stat_io where available and per-device latency.","Fix the access path, burst shape, or affected storage tier before tuning unrelated memory settings."],"zh":["确认当前负载阶段本来就应访问这类文件。","在可用版本上关联 pg_stat_io 与具体设备延迟。","先修复访问路径、突发形状或受影响存储层，再调整无关的内存参数。"]},"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 = 'IO'\n  AND wait_event = 'ReplicationSlotWrite'\nORDER BY query_age DESC NULLS LAST;","title":"Sessions waiting on IO/ReplicationSlotWrite","title_zh":"正在等待 IO/ReplicationSlotWrite 的会话"},{"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 = 'IO'\nGROUP BY wait_event\nORDER BY waiting_sessions DESC, wait_event;","title":"Current IO cohort","title_zh":"当前 IO 等待分布"},{"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 = 'IO'\n  AND a.wait_event = 'ReplicationSlotWrite'\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_SLOT_WRITE` at `src/backend/replication/slot.c:2384` is the grep-verified reporting path. The public identity/resource is mapped at `src/backend/utils/activity/wait_event_names.txt:245`. The instrumented operation is: Waiting for a write to a replication slot control file. PostgreSQL reports ReplicationSlotWrite around the instrumented file or asynchronous-I/O operation named by this event. The backend resumes after the kernel, storage stack, or I/O worker completes that step.","zh":"`WAIT_EVENT_REPLICATION_SLOT_WRITE` 位于 `src/backend/replication/slot.c:2384`，是经 grep 核验的报告路径。公共身份/资源映射位于 `src/backend/utils/activity/wait_event_names.txt:245`。探针覆盖的操作是：等待向复制槽控制文件写入数据。PostgreSQL 在 ReplicationSlotWrite 所表示的文件或异步 I/O 操作周围报告此事件；内核、存储栈或 I/O worker 完成该步骤后，后端继续执行。"},"metrics":["waiting_sessions","wait_event_share","io_read_time","io_write_time"],"normal":{"en":"The wait is normal when the workload is expected to perform this read, write, sync, allocation, or completion operation at the observed rate.","zh":"当负载本来就应以当前速率执行对应的读取、写入、同步、分配或完成操作时，这项等待正常。"},"official_descriptions":{"13":"Waiting for a write to a replication slot control file.","14":"Waiting for a write to a replication slot control file.","15":"Waiting for a write to a replication slot control file.","16":"Waiting for a write to a replication slot control file.","17":"Waiting for a write to a replication slot control file","18":"Waiting for a write to a replication slot control file"},"record_kind":"event","source_locations":[{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"pgstat_report_wait_start(WAIT_EVENT_REPLICATION_SLOT_WRITE);","grep_pattern":"WAIT_EVENT_REPLICATION_SLOT_WRITE","grep_verified":true,"kind":"trigger","line":2384,"major":18,"path":"src/backend/replication/slot.c","status":"live_trigger","symbol":"WAIT_EVENT_REPLICATION_SLOT_WRITE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/replication/slot.c#L2384","version":"18.6"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"REPLICATION_SLOT_WRITE\t\"Waiting for a write to a replication slot control file.\"","grep_pattern":"REPLICATION_SLOT_WRITE","grep_verified":true,"kind":"catalog_definition","line":245,"major":18,"path":"src/backend/utils/activity/wait_event_names.txt","status":"live_trigger","symbol":"REPLICATION_SLOT_WRITE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/utils/activity/wait_event_names.txt#L245","version":"18.6"}],"source_status":"live_trigger","trouble":{"en":"Investigate when it persists with foreground latency, many concurrent waiters, storage tail latency, throttling, or errors.","zh":"若它持续存在并伴随前台延迟、大量并发等待者、存储长尾延迟、限速或错误，应当调查。"}},"first_version":"10","has_dossier":true,"imported_at":"2026-09-27T17:57:32.638254+08:00","key":"io/replicationslotwrite","last_version":"20","name":"ReplicationSlotWrite","position":91,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"slug":"replication-slot-write","source_rev":"english-manuals:5047ed42bf9949168c75ca379e27960313068bc54e3ff2bf37e382b085e1c1c9","summary":"Waiting for a write to a replication slot control file.","summary_zh":"","type":"IO","type_slug":"io","type_variants":["IO"]}},"Definition":{"Collection":"waitevent","Key":"io/ReplicationSlotWrite","SourceDatabase":"center","Version":"18","SourceTable":"waitevent","SourceKey":"io/replicationslotwrite","SourceRevision":"english-manuals:5047ed42bf9949168c75ca379e27960313068bc54e3ff2bf37e382b085e1c1c9","Facts":{"description":"Waiting for a write to a replication slot control file.","description_zh":"","doc":{"anchor":"WAIT-EVENT-IO-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"lang":"en","name":"ReplicationSlotWrite","source":"english-manual","type":"IO","zh_from":""},"ManualEvidence":{"doc":{"anchor":"WAIT-EVENT-IO-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"waitevent","Key":"io/ReplicationSlotWrite","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ReplicationSlotWrite","Summary":"等待对复制槽控制文件的写入。","BodyHTML":"\u003cp\u003e等待对复制槽控制文件的写入。\u003c/p\u003e","SourceRevision":"2026-08-31@34d13c8","ContentHash":"201b40ed108421bc9f03d63bef8966181540a3799325fbabe5995540fa8ef607","Payload":{"description_zh":"等待对复制槽控制文件的写入。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
