merge-delete isolation test fails since 85f55534e80 - Mailing list pgsql-hackers

From Trakshan Mishra
Subject merge-delete isolation test fails since 85f55534e80
Date
Msg-id CACRpqq9M5qo4RVDrpsPix2qTF4jh31RO06zjk1voJnkfpdGZ7g@mail.gmail.com
Whole thread
Responses Re: merge-delete isolation test fails since 85f55534e80
List pgsql-hackers
Hi,

The merge-delete isolation test fails on master for me. It is not
intermittent -- 5 runs out of 5 -- and the failing permutations are all
the WHEN NOT MATCHED BY SOURCE ones.

master @ 89829354de1
Ubuntu 26.04.1 LTS, x86_64, gcc 15.2.0
meson 1.10.1, --buildtype=debug -Dcassert=true -Dtap_tests=enabled
-Dreadline=disabled

Bisected to 85f55534e80 ("Fix concurrent delete handling in MERGE ...
WHEN NOT MATCHED BY SOURCE"):

9bfdcfbfcf9 (parent) 3 of 3 runs pass
85f55534e80 3 of 3 runs fail
89829354de1 (master) 5 of 5 runs fail

That commit added both the fix and these permutations, so what is
failing is the test the commit shipped with.

The row inserted by the WNMBS action looks like it has lost its values.
On the plain table:

step merge_wnmbs_src2: <... completed>
-merge_action|key|val
-INSERT | 2|merge2
+ERROR: null value in column "key" of relation "target" violates
not-null constraint

on the partitioned one:

+ERROR: no partition of relation "target_pa" found for row

and the trigger variant prints the row, which is empty:

-s2: NOTICE: Insert: (2,merge2_tg)
+s2: NOTICE: Insert: (,)

Five permutations fail, all of them a delete followed by a WNMBS merge:

delete_pa merge_wnmbs_src2_pa c1 select2_pa c2
delete_tg merge_wnmbs_src2_tg c1 select2_tg c2
update delete merge_wnmbs_src2 c1 select2 c2
update_pa delete_pa merge_wnmbs_src2_pa c1 select2_pa c2
update_tg delete_tg merge_wnmbs_src2_tg c1 select2_tg c2

I have only tested master. The commit is marked backpatch-through 17,
so REL_17/18/19 may be affected as well, but I have not checked them.

Happy to test a patch, or to send the full regression.diffs if that is
useful.

Regards,
Trakshan Mishra

pgsql-hackers by date:

Previous
From: Nazir Bilal Yavuz
Date:
Subject: Re: pgindent to ignore build directories
Next
From: Alexander Korotkov
Date:
Subject: Re: pgsql: JSON_TABLE: propagate table-level ON ERROR to columns per SQL st