[Bug] Split Update silently skips BEFORE UPDATE triggers on a leaf partition
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start by locating the existing check that rejects Split Update on relations with UPDATE triggers, then trace how it handles partition leaves during partial partition expansion. Use the reproduction SQL in the issue on a three-segment cluster and verify the statement either fails clearly before changing data or applies the trigger to all 20 rows. The issue does not name source files or tests, so finding the check and its regression test will require reading around the planner and executor code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Apache Cloudberry version
Reported on PR #2374, commit 482abcb657191a4cb2c53bc5c85eebc6f6df3760, with the PostgreSQL planner and assertions enabled, on a three-segment cluster.
What happened
After partial partition expansion, updating a partition key produces a Split Update plan. A BEFORE UPDATE trigger defined on the second leaf partition is silently skipped: the statement succeeds and updates 20 rows, but the trigger's assignment is not applied.
In the PR discussion, the author in PR referred to the Greenplum documentation stating that user-defined triggers are unsupported. This issue tracks the silent acceptance of an unsupported operation: Cloudberry already has a check intended to reject split updates on relations with UPDATE triggers, but this case bypasses it.
What you think should happen instead
No response
How to reproduce
Run on a cluster with three primary segments:
SET optimizer = off;
CREATE EXTENSION IF NOT EXISTS gp_debug_numsegments;
SELECT gp_debug_set_create_table_default_numsegments(2);
CREATE TABLE tr (a int, b int, c int)
DISTRIBUTED BY (a)
PARTITION BY RANGE (b);
CREATE TABLE tr1 PARTITION OF tr
FOR VALUES FROM (0) TO (10);
CREATE TABLE tr2 PARTITION OF tr
FOR VALUES FROM (10) TO (20);
INSERT INTO tr
SELECT i, 15, 0 FROM generate_series(1, 20) i;
CREATE FUNCTION tr_before() RETURNS trigger AS $$
BEGIN
NEW.c := 999;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER tr_before
BEFORE UPDATE ON tr2
FOR EACH ROW EXECUTE FUNCTION tr_before();
ALTER TABLE tr EXPAND PARTITION PREPARE;
ALTER TABLE tr1 SET WITH (REORGANIZE = TRUE) DISTRIBUTED BY (a);
EXPLAIN (COSTS OFF) UPDATE tr SET b = b + 1;
UPDATE tr SET b = b + 1;
SELECT b, c, count(*)
FROM tr
GROUP BY b, c
ORDER BY b, c;
Actual output
The following output is taken from the original PR report.
QUERY PLAN
---------------------------------------------------------------
Update on tr
Update on tr1 tr_1
Update on tr2 tr_2
-> Explicit Redistribute Motion 3:3 (slice1; segments: 3)
-> Split Update
-> Append
-> Seq Scan on tr1 tr_1
-> Seq Scan on tr2 tr_2
Optimizer: Postgres query optimizer
(9 rows)
UPDATE 20
b | c | count
----+---+-------
16 | 0 | 20
(1 row)
If UPDATE triggers are unsupported for this execution path, reject the statement with a clear error before modifying data. The restriction should apply consistently to all affected leaf partitions.
If the statement is allowed, the trigger must execute, producing b = 16, c = 999 for all 20 rows. Successful execution with the trigger silently skipped should not occur.
Operating System
any
Are you willing to submit PR?
- Yes, I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct.
- Ngôn ngữ chính
- C
- Star
- 1.5k
- Fork
- 280
- Merge trung bình
- 4 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 122
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudberry
-
type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/cloudberry#2459 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
psql tab completion broken for storage servers, tags, profiles and resource groups (pre-PG15 query format)Có thể đã có người làm @allenvox đã nhận 18 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/cloudberry#2316 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
gpexpand first stage fails: 'SyncPackages' object has no attribute 'ret' (extension sync never runs; regression)Có thể đã có người làm @talmacschen-arch đã nhận 166 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
apache/cloudberry#1825 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] ORCA returns wrong system column values through a partially pruned CTE consumerCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởtype: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
apache/cloudberry#2458 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] Window Sort above ROLLUP gets a larger memory quota and runs slower after "Reserve memory for one partition at a time"Có thể đã có người làm @Alena0704 đã nhận 1 ngày trước. Đang mởtype: Bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
apache/cloudberry#2446 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/cloudberry
Issue tương tự
-
HXsetdir strdup leakĐang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
ly05010419/MacNativeGames#2459 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2024.2 Backport Required 2025.2 Backport Required 2026.1 Backport Required 2026.2 Backport Required area/build-framework kind/enhancement priority/medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
yugabyte/yugabyte-db#39930 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
RecompLauncher supportĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
shinyquagsire23/OpenJKDF2#540 ·
Maintainer thường phản hồi trong vòng 12 ngày
-
Prison work hall: laundry and kitchen stations stand at bare walls, the hatch has no counter or signĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Life-Framework/Life-Framework#5939 ·
Maintainer thường phản hồi trong vòng 1 ngày