pg_stat_io: track I/O for Append-Optimized (AO/AOCO) tables
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- c, postgresql
- Ambito
- databases, observability
Direzione di ricerca
Inizia leggendo pgstat_io.c, pgstat.h e le definizioni di pg_stat_io in system_views.sql, quindi esamina BufferedRead e BufferedAppend in src/backend/access/appendonly e src/backend/access/aocs. Confronta la loro strumentazione con quella di bufmgr.c, localbuf.c e md.c. Il lavoro è completo quando le letture, scritture, estensioni e fsync di AO/AOCO sono rappresentate in modo coerente in pg_stat_io e nelle viste gp_stat_io correlate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
pg_stat_io (inherited from the PostgreSQL 16 merge) gives per-backend,
per-IO-object, per-context I/O statistics, and Cloudberry already exposes
cluster-wide rollups via gp_stat_io and gp_stat_io_summary. However, the
underlying counters are only incremented on the shared-buffer-manager path
(bufmgr.c, localbuf.c, md.c). Append-Optimized (AO) and
Append-Optimized Column-Oriented (AOCO) table I/O is not counted at all.
Because AO/AOCO storage bypasses the shared buffer pool and uses its own
BufferedRead / BufferedAppend layer, reads, writes, and extends against
these tables are invisible to pg_stat_io. For a workload built primarily on
AO/AOCO tables — which is common in Cloudberry analytics deployments — the view
significantly under-reports actual physical I/O.
Current behavior
grep -rn pgstat_count_io_op src/backend/access/appendonly src/backend/access/aocs
returns no matches — the AO/AOCO read/write paths contain no
instrumentation.- I/O counters are populated only from
bufmgr.c,localbuf.c, andmd.c,
i.e. the heap / index / temp-relation paths inherited from PostgreSQL. - As a result,
pg_stat_io(andgp_stat_io/gp_stat_io_summary) reflect
heap/index/catalog I/O but omit the storage format that defines Cloudberry.
Expected behavior
I/O performed by AO/AOCO tables should be reflected in pg_stat_io, so that
operators can observe physical I/O for the storage types they actually use.
Proposed approach (for discussion)
Instrument the AO/AOCO buffered I/O layer with pgstat_count_io_op[_time]()
calls, analogous to the existing md.c instrumentation:
- Reads — in the AO/AOCO
BufferedReadpath (bufmgrequivalent for AO),
countIOOP_READ. - Writes / extends — in the
BufferedAppend/ segment-file extend path,
countIOOP_WRITEandIOOP_EXTEND. - fsync — where AO segment files are flushed (
register_dirty_segment/
mdimmedsyncequivalents).
Open design questions:
- IOOBJECT classification. AO/AOCO data does not live in shared buffers,
soIOOBJECT_RELATION(which today implies buffer-pool involvement) may be
misleading. Options: reuseIOOBJECT_RELATION, or add a new IO object
(e.g.IOOBJECT_AO_RELATION) to keep AO I/O distinguishable. Adding an enum
value changes the fixed-size shared stats struct and the
pg_stat_io/pg_stat_get_io()output shape, so it needs care. - IOCONTEXT mapping. AO has no shared-buffer eviction/reuse semantics, so
hits/evictions/reusesare not meaningful; only
reads/writes/extends/fsyncswould be populated. Decide how the
non-applicable columns are reported (zero vs. NULL). op_bytes. AO varblocks are variable-sized rather thanBLCKSZ-aligned,
so the per-op byte accounting differs from the heap path.
Impact / motivation
- Observability parity: AO/AOCO is the primary storage format for many
Cloudberry analytics workloads, yet is the one formatpg_stat_iocan't see. - Capacity planning & troubleshooting: physical read/write volume for AO tables
is currently only obtainable indirectly.
Notes
- Affects:
main. - Related existing surfaces:
pg_stat_ioview (system_views.sql),
gp_stat_io/gp_stat_io_summary(system_views_gp*.sql),
pgstat_io.c,pgstat.hIO enums.
- Lingua principale
- C
- Stelle
- 1.4k
- Fork
- 248
- Merge medio
- 4g 10h
- PR unite (30g)
- 40
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/cloudberry
-
type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apache/cloudberry#1885 · 2 reazioni ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
apache/cloudberry#1825 ·
-
type: Bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
apache/cloudberry#2048 · 1 reazione ·
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
apache/cloudberry#2047 ·
-
type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
apache/cloudberry#2046 · 1 commento ·
Tutte le issue di apache/cloudberry
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
bradcypert/plum#53 ·
-
Component: GLib
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
nextbsd/nextbsd-userland#285 ·