Enable parallel VACUUM (currently disabled via GPDB_14_MERGE_FIXME due to lock issues)
@chenjinbao1989 がすでに取り組んでいます。
2026年7月21日 から。
評価
この issue はまだ評価されていません。
説明
Summary
PostgreSQL 16's parallel VACUUM (parallel index vacuuming) is currently disabled in Cloudberry. VACUUM (PARALLEL n) is accepted syntactically, but at runtime the parallel option is silently downgraded to serial with a WARNING, on both the coordinator and every segment. The real parallel code path is compiled out.
Where
src/backend/access/heap/vacuumlazy.c:3209
/* GPDB_14_MERGE_FIXME: Don't support parallel vacuum now, we need to fix lock issues. */
if (nworkers > 0 && vacrel->do_index_vacuuming && vacrel->nindexes > 1)
ereport(WARNING,
(errmsg("disabling parallel option of vacuum on \"%s\" --- cannot vacuum tables in parallel",
vacrel->relname)));
#if 0
else
... /* the actual parallel_vacuum_init() / parallel path is #if 0'd out */
So any table with more than one index that is asked to vacuum in parallel hits this guard, and the upstream parallel path below it is dead-coded via #if 0.
Reproduction
Environment: PostgreSQL 16.9 / Apache Cloudberry 3.0.0-devel (main, c781604c5bad), 3 primary segments.
CREATE TABLE pv_demo(id int, a int, b int, c text) DISTRIBUTED BY (id);
INSERT INTO pv_demo SELECT g,g,g,md5(g::text) FROM generate_series(1,1000000) g;
CREATE INDEX ON pv_demo(a);
CREATE INDEX ON pv_demo(b);
CREATE INDEX ON pv_demo(c);
DELETE FROM pv_demo WHERE id % 3 = 0;
VACUUM (PARALLEL 3, VERBOSE) pv_demo;
Output:
WARNING: disabling parallel option of vacuum on "pv_demo" --- cannot vacuum tables in parallel
WARNING: disabling parallel option of vacuum on "pv_demo" --- cannot vacuum tables in parallel (seg0 ... )
WARNING: disabling parallel option of vacuum on "pv_demo" --- cannot vacuum tables in parallel (seg1 ... )
WARNING: disabling parallel option of vacuum on "pv_demo" --- cannot vacuum tables in parallel (seg2 ... )
INFO: finished vacuuming "postgres.public.pv_demo": index scans: 1
The vacuum completes, but serially (index scans: 1, no parallel workers launched).
Root cause
Per the in-tree comment, parallel vacuum was left disabled during the PG14→PG16 merge because of unresolved lock issues in the MPP context (parallel workers inside a QE backend vs. the segment-local locking / dispatch model). The parallel path was #if 0'd rather than adapted.
Proposed work
- Resolve the lock issues that block backend-parallel index vacuuming inside a segment QE.
- Re-enable the
#if 0'd parallel path (parallel_vacuum_init()etc.) soVACUUM (PARALLEL n)and autovacuum can use parallel workers per segment. - If it cannot be supported in the MPP model, replace the silent runtime downgrade with clear documentation and, ideally, a one-time notice rather than a per-relation
WARNING.
Notes
max_parallel_maintenance_workerscurrently defaults to2but has no effect on VACUUM because of the guard above.- Scope: heap tables with 2+ indexes. AO/AOCO tables use a different vacuum path and are out of scope for this specific guard.
- 主要言語
- 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
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#120318 · コメント 1 件 ·
-
issue: bug report
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
darktable-org/darktable#22386 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100