pg_stat_io: track I/O for Append-Optimized (AO/AOCO) tables
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 技術スタック
- c, postgresql
調査の方向性
まず pgstat_io.c、pgstat.h、および system_views.sql 内の pg_stat_io 定義を読み、次に src/backend/access/appendonly と src/backend/access/aocs の BufferedRead と BufferedAppend を調べます。それらのインストルメンテーションを bufmgr.c、localbuf.c、md.c と比較します。AO/AOCO の読み取り、書き込み、拡張、fsync が pg_stat_io と関連する gp_stat_io ビューで一貫して表現されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C
- スター
- 1.4k
- フォーク
- 248
- 平均マージ
- 4日 10時間
- マージ済み PR(30日)
- 40
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/cloudberry のほかの issue
-
type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/cloudberry#1885 · リアクション 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
apache/cloudberry#1825 ·
-
type: Bug
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
apache/cloudberry#2048 · リアクション 1 件 ·
-
type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 40/100
apache/cloudberry#2047 ·
-
type: Bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
apache/cloudberry#2046 · コメント 1 件 ·
apache/cloudberry の issue をすべて見る
似ている issue
-
task
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vsanthanam/JBird#429 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
bug documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
es-ude/OnDeviceTraining#459 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bilelmoussaoui/gobject-linter#199 · コメント 1 件 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
bradcypert/plum#53 ·