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

Ouverte
#2,235 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
c, postgresql, sql
Domaine
databases

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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
Langage dominant
C
Étoiles
1.4k
Forks
268
Merge moyen
4 j 3 h
PR mergées (30 j)
78

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/cloudberry

Toutes les issues de apache/cloudberry

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.