{"Entry":{"collection":"waitevent","key":"io/BasebackupWrite","name":"BasebackupWrite","aliases":["BaseBackupWrite","BasebackupWrite"],"metadata":{"aliases":["BaseBackupWrite","BasebackupWrite"],"changed_in":["17"],"changes":[{"from":"14","moved":null,"renamed":null,"reworded":null,"status":"added","to":"15"},{"from":"16","moved":null,"renamed":{"from":"BaseBackupWrite","to":"BasebackupWrite"},"reworded":null,"status":"changed","to":"17"}],"content_hash":"c28e266475fc7a9702ad218548ef660f5d16f9bf312154f17dfc3a5cfb0fcc04","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 = 'BasebackupWrite'\nORDER BY query_age DESC NULLS LAST;","title":"Sessions waiting on IO/BasebackupWrite","title_zh":"正在等待 IO/BasebackupWrite 的会话"},{"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 = 'BasebackupWrite'\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_BASEBACKUP_WRITE` at `src/backend/backup/basebackup_server.c:168` is the grep-verified reporting path. The public identity/resource is mapped at `src/backend/utils/activity/wait_event.c:547`. The instrumented operation is: Waiting for base backup to write to a file. PostgreSQL reports BasebackupWrite 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_BASEBACKUP_WRITE` 位于 `src/backend/backup/basebackup_server.c:168`，是经 grep 核验的报告路径。公共身份/资源映射位于 `src/backend/utils/activity/wait_event.c:547`。探针覆盖的操作是：等待基础备份向文件写入数据。PostgreSQL 在 BasebackupWrite 所表示的文件或异步 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":{"17":"Waiting for base backup to write to a file","18":"Waiting for base backup to write to a file"},"record_kind":"event","source_locations":[{"commit":"7d3e000c5961a544302072058a1184e9a588837b","excerpt":"mysink-\u003efilepos, WAIT_EVENT_BASEBACKUP_WRITE);","grep_pattern":"WAIT_EVENT_BASEBACKUP_WRITE","grep_verified":true,"kind":"trigger","line":168,"major":16,"path":"src/backend/backup/basebackup_server.c","status":"live_trigger","symbol":"WAIT_EVENT_BASEBACKUP_WRITE","tag":"REL_16_15","url":"https://github.com/postgres/postgres/blob/REL_16_15/src/backend/backup/basebackup_server.c#L168","version":"16.15"},{"commit":"7d3e000c5961a544302072058a1184e9a588837b","excerpt":"event_name = \"BaseBackupWrite\";","grep_pattern":"BaseBackupWrite","grep_verified":true,"kind":"catalog_definition","line":547,"major":16,"path":"src/backend/utils/activity/wait_event.c","status":"live_trigger","symbol":"BaseBackupWrite","tag":"REL_16_15","url":"https://github.com/postgres/postgres/blob/REL_16_15/src/backend/utils/activity/wait_event.c#L547","version":"16.15"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"mysink-\u003efilepos, WAIT_EVENT_BASEBACKUP_WRITE);","grep_pattern":"WAIT_EVENT_BASEBACKUP_WRITE","grep_verified":true,"kind":"trigger","line":166,"major":18,"path":"src/backend/backup/basebackup_server.c","status":"live_trigger","symbol":"WAIT_EVENT_BASEBACKUP_WRITE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/backup/basebackup_server.c#L166","version":"18.6"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"BASEBACKUP_WRITE\t\"Waiting for base backup to write to a file.\"","grep_pattern":"BASEBACKUP_WRITE","grep_verified":true,"kind":"catalog_definition","line":201,"major":18,"path":"src/backend/utils/activity/wait_event_names.txt","status":"live_trigger","symbol":"BASEBACKUP_WRITE","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/utils/activity/wait_event_names.txt#L201","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":"15","has_dossier":true,"imported_at":"2026-09-27T17:57:32.544788+08:00","key":"io/basebackupwrite","last_version":"20","name":"BasebackupWrite","position":40,"present_in":["15","16","17","18","19","20"],"slug":"basebackup-write","source_rev":"english-manuals:57b0503e957fa78f5e4a097ce7b2bb7c9de5dca7995dd6120f953f8603ea67b9","summary":"Waiting for base backup to write to a file.","summary_zh":"","type":"IO","type_slug":"io","type_variants":["IO"]}},"Definition":{"Collection":"waitevent","Key":"io/BasebackupWrite","SourceDatabase":"center","Version":"18","SourceTable":"waitevent","SourceKey":"io/basebackupwrite","SourceRevision":"english-manuals:57b0503e957fa78f5e4a097ce7b2bb7c9de5dca7995dd6120f953f8603ea67b9","Facts":{"description":"Waiting for base backup to write to a file.","description_zh":"","doc":{"anchor":"WAIT-EVENT-IO-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"lang":"en","name":"BasebackupWrite","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/BasebackupWrite","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"BasebackupWrite","Summary":"等待基础备份写入文件。","BodyHTML":"\u003cp\u003e等待基础备份写入文件。\u003c/p\u003e","SourceRevision":"2026-08-31@34d13c8","ContentHash":"d0c3dbb676525b9b5318594090fc9fc103d4aadb9725ea6d51cda6d0c65a2422","Payload":{"description_zh":"等待基础备份写入文件。","zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
