Re: Fix WITHOUT OVERLAPS multirange with location replication

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(at)eisentraut(dot)org>
Subject: Re: Fix WITHOUT OVERLAPS multirange with location replication
Date: 2026-10-09 23:55:17
Message-ID: CA+renyXgBDwOp4bWzuaOO3GeeJRp=Jv=FUyjqtBiOJchr7+cAg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 9, 2026, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> wrote:
>
> Thanks for the patch. I reviewed v1 and tested it manually. I was able
> to reproduce both the wrong-row update/delete and the update_deleted
> misreport (update_deleted reported instead of update_missing with
> retain_dead_tuples) using a multirange key, and the patch fixes both.

Thanks for the review!

> 1) The change to RelationFindDeletedTupleInfoByIndex() doesn't seem to
> be covered by a test. Maybe we could add a case to 035_conflicts.pl?

This was tricky, but I figured out a way to do it. My test adds a row
on the publisher before creating the subscription, then uses
copy_data=false. Then I add & delete a "decoy" row with a different
multirange but the same lossy bounding range. When the publisher
updates the first row, it gets update_deleted before the fix and
update_missing after.

> 2) The header comment of RelationFindReplTupleByIndex() needs an
> update. It still says:
>
> * 'skipduplicates' specifies whether the first matching tuple can be used
> * without comparing it against 'searchslot'.
> -- This no longer holds when the index scan requires a recheck.

Done.

> 3) The commit message could also mention the update_deleted vs.
> update_missing impact, and that this patch fixes it.

Done.

v2 attached, rebased on current master.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

Attachment Content-Type Size
v2-0001-Fix-wrong-replication-for-multirange-WITHOUT-OVER.patch application/octet-stream 12.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Manu 2026-10-09 23:27:39 Re: Partition-aware simplification of constant IN lists after partition pruning