[Bug] Cross-partition UPDATE into a foreign partition silently loses rows

Offen
#2,235 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c, postgresql, sql
Bereich
databases

Rechercherichtung

Start by tracing partition row movement through the UPDATE executor and the postgres_fdw foreign-partition write path; the reproduction uses batch_size '10' and moves 25 rows from local partition p1 to foreign partition p2. Check the existing tests for partition updates with foreign tables, then add a regression case showing all 25 rows reach p2 after the update.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

type: Bug
Apache Cloudberry version

No response

What happened

An UPDATE that moves rows from a local partition to a postgres_fdw foreign partition commits, but the rows are deleted from the local partition and never reach the foreign table.

What you think should happen instead

No response

How to reproduce
-- in database fdwr
CREATE TABLE r2 (a int, b int) DISTRIBUTED BY (b);

-- in another database
CREATE EXTENSION postgres_fdw;
CREATE SERVER s FOREIGN DATA WRAPPER postgres_fdw
    OPTIONS (host '/tmp', port '7000', dbname 'fdwr', batch_size '10');
CREATE USER MAPPING FOR current_user SERVER s;
CREATE TABLE part (a int, b int) PARTITION BY LIST (a) DISTRIBUTED BY (b);
CREATE TABLE p1 PARTITION OF part FOR VALUES IN (1);
CREATE FOREIGN TABLE p2 PARTITION OF part FOR VALUES IN (2)
    SERVER s OPTIONS (table_name 'r2');
INSERT INTO part SELECT 1, i FROM generate_series(1, 25) i;
UPDATE part SET a = 2 WHERE a = 1;
SELECT count(*) FROM p1;  -- 0
SELECT count(*) FROM p2;  -- 0, expected 25
Operating System

ubuntu24

Anything else

No response

Are you willing to submit PR?
  • Yes, I am willing to submit a PR!
Code of Conduct
Vorherrschende Sprache
C
Sterne
1.4k
Forks
268
Ø Merge
4 T. 3 Std.
Gemergte PRs (30 T.)
78

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/cloudberry

Alle Issues in apache/cloudberry

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.