{"Entry":{"collection":"waitevent","key":"client/ClientRead","name":"ClientRead","aliases":["ClientRead"],"metadata":{"aliases":["ClientRead"],"changed_in":[],"changes":[{"from":"9.6","moved":null,"renamed":null,"reworded":null,"status":"added","to":"10"}],"content_hash":"18dd4873aab7770ba05e70b6e824bdc44242e39251d2eeef1948ad86b02eec43","dossier":{"actions":{"en":["Check state and transaction age before counting the wait as load.","Correlate with the owning application, pool, and network path.","Fix consumer backpressure or pool policy rather than repeatedly terminating connections."],"zh":["先看 state 与事务年龄，再决定它是否算负载。","关联负责的应用、连接池与网络路径。","修复消费者背压或连接池策略，不要反复终止连接。"]},"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 = 'Client'\n  AND wait_event = 'ClientRead'\nORDER BY query_age DESC NULLS LAST;","title":"Sessions waiting on Client/ClientRead","title_zh":"正在等待 Client/ClientRead 的会话"},{"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 = 'Client'\nGROUP BY wait_event\nORDER BY waiting_sessions DESC, wait_event;","title":"Current Client cohort","title_zh":"当前 Client 等待分布"},{"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 = 'Client'\n  AND a.wait_event = 'ClientRead'\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"},"gucs":["max_connections","idle_in_transaction_session_timeout"],"incident_pattern":{"en":"","zh":""},"mechanism":{"en":"`WAIT_EVENT_CLIENT_READ` at `src/backend/libpq/be-secure.c:219` is the grep-verified reporting path. The public identity/resource is mapped at `src/backend/utils/activity/wait_event_names.txt:85`. The instrumented operation is: Waiting to read data from the client. The frontend protocol path reports ClientRead immediately before a socket, TLS/GSS, or replication-client operation blocks. PostgreSQL is waiting for the remote side or network to progress.","zh":"`WAIT_EVENT_CLIENT_READ` 位于 `src/backend/libpq/be-secure.c:219`，是经 grep 核验的报告路径。公共身份/资源映射位于 `src/backend/utils/activity/wait_event_names.txt:85`。探针覆盖的操作是：等待从客户端读取数据。前端协议路径在套接字、TLS/GSS 或复制客户端操作即将阻塞前报告 ClientRead；PostgreSQL 正在等待远端或网络推进。"},"metrics":["waiting_sessions","wait_event_share","active_backends"],"normal":{"en":"Idle ClientRead sessions are normal connection-pool inventory.","zh":"空闲状态的 ClientRead 通常只是连接池存量。"},"official_descriptions":{"13":"Waiting to read data from the client.","14":"Waiting to read data from the client.","15":"Waiting to read data from the client.","16":"Waiting to read data from the client.","17":"Waiting to read data from the client","18":"Waiting to read data from the client"},"record_kind":"event","source_locations":[{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"WAIT_EVENT_CLIENT_READ);","grep_pattern":"WAIT_EVENT_CLIENT_READ","grep_verified":true,"kind":"trigger","line":219,"major":18,"path":"src/backend/libpq/be-secure.c","status":"live_trigger","symbol":"WAIT_EVENT_CLIENT_READ","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/libpq/be-secure.c#L219","version":"18.6"},{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","excerpt":"CLIENT_READ\t\"Waiting to read data from the client.\"","grep_pattern":"CLIENT_READ","grep_verified":true,"kind":"catalog_definition","line":85,"major":18,"path":"src/backend/utils/activity/wait_event_names.txt","status":"live_trigger","symbol":"CLIENT_READ","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/REL_18_6/src/backend/utils/activity/wait_event_names.txt#L85","version":"18.6"}],"source_status":"live_trigger","trouble":{"en":"Investigate active writes, handshakes, old idle-in-transaction sessions, connection exhaustion, or replication-client stalls.","zh":"活动写入、握手、很老的 idle in transaction、连接耗尽或复制客户端停滞时需要调查。"}},"first_version":"10","has_dossier":true,"imported_at":"2026-09-27T17:57:32.513238+08:00","key":"client/clientread","last_version":"20","name":"ClientRead","position":25,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"slug":"client-read","source_rev":"english-manuals:e4d0f46e3c2e6dd7bd435903a84ff5cbef8a1fe203b744d30bbdc7f2e990cc5f","summary":"Waiting to read data from the client.","summary_zh":"","type":"Client","type_slug":"client","type_variants":["Client"]}},"Definition":{"Collection":"waitevent","Key":"client/ClientRead","SourceDatabase":"center","Version":"18","SourceTable":"waitevent","SourceKey":"client/clientread","SourceRevision":"english-manuals:e4d0f46e3c2e6dd7bd435903a84ff5cbef8a1fe203b744d30bbdc7f2e990cc5f","Facts":{"description":"Waiting to read data from the client.","description_zh":"","doc":{"anchor":"WAIT-EVENT-CLIENT-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"},"lang":"en","name":"ClientRead","source":"english-manual","type":"Client","zh_from":""},"ManualEvidence":{"doc":{"anchor":"WAIT-EVENT-CLIENT-TABLE","file":"monitoring-stats.html","lang":"en","sha256":"aa979eed08627fbf715a9d792094a162a73671db5af810f3ab2aad3e073d5722","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"waitevent","Key":"client/ClientRead","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"ClientRead","Summary":"等待从客户端读取数据。","BodyHTML":"\u003cp\u003e等待从客户端读取数据。\u003c/p\u003e","SourceRevision":"2026-08-31@34d13c8","ContentHash":"9f28f0b59fc28e74caad3f7f98507d9940f6eddf603080c8a6d7601c7f02f3d0","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}
