pg_stat_io: track I/O for Append-Optimized (AO/AOCO) tables
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Tranquilo
- Stack tecnológico
- c, postgresql
- Área
- databases, observability
Línea de trabajo
Empieza leyendo pgstat_io.c, pgstat.h y las definiciones de pg_stat_io en system_views.sql; después, inspecciona BufferedRead y BufferedAppend en src/backend/access/appendonly y src/backend/access/aocs. Compara su instrumentación con bufmgr.c, localbuf.c y md.c. Se considera terminado cuando las lecturas, escrituras, extensiones y fsyncs de AO/AOCO estén representadas de forma coherente en pg_stat_io y en las vistas gp_stat_io relacionadas.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 1.4k
- Forks
- 248
- Merge medio
- 4 d 10 h
- PR fusionados (30 d)
- 40
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/cloudberry
-
type: Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
apache/cloudberry#1885 · 2 reacciones ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
apache/cloudberry#1825 ·
-
type: Bug
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
apache/cloudberry#2048 · 1 reacción ·
-
type: Bug
Dificultad 4/5 3-5 días Aptitud para principiantes 40/100
apache/cloudberry#2047 ·
-
type: Bug
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
apache/cloudberry#2046 · 1 comentario ·
Todos los issues de apache/cloudberry
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bradcypert/plum#53 ·
-
Component: GLib
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Status: Opened
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nextbsd/nextbsd-userland#285 ·