RE: Conflict detection for update_deleted in logical replication
Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>
Attachments
- v40-0001-Retain-the-information-useful-for-detecting-conf.patch (application/octet-stream) patch v40-0001
- v40-0002-Introduce-a-new-GUC-max_conflict_retention_durat.patch (application/octet-stream) patch v40-0002
- v40-0003-Re-create-the-replication-slot-if-the-conflict-r.patch (application/octet-stream) patch v40-0003
- v40-0004-Add-a-tap-test-to-verify-the-management-of-the-n.patch (application/octet-stream) patch v40-0004
- v40-0005-Support-the-conflict-detection-for-update_delete.patch (application/octet-stream) patch v40-0005
- v40-0006-Allow-altering-retain_conflict_info-for-enabled-.patch (application/octet-stream) patch v40-0006
On Mon, Jun 23, 2025 at 3:02 PM Amit Kapila wrote:
>
> On Fri, Jun 20, 2025 at 4:48 PM Zhijie Hou (Fujitsu)
> <houzj.fnst@fujitsu.com>
> wrote:
> >
> > Here is the V39 patch set which includes the following changes:
> >
>
> 1.
> -static void
> -create_conflict_slot_if_not_exists(void)
> +void
> +ApplyLauncherCreateConflictDetectionSlot(void)
>
> I am not so sure about adding ApplyLauncher in front of this function
> name. I see most others exposed from this file add such a prefix, but
> this one looks odd to me as it has nothing specific to the launcher, though we use it in launcher?
> How about CreateConflictDetectionSlot(void)?
Agreed and changed as suggested.
>
> 2.
> static void
> create_logical_replication_slots(void)
> {
> + if (!count_old_cluster_logical_slots())
> + return;
> +
>
> Doing this count twice (once here and once at the caller of
> create_logical_replication_slots) seems redundant.
I have changed to check the slot numbers before entering the function and
declared a flag to save the results of Count_old_xxslots() function to avoid
counting it twice.
>
> Apart from the above, attached please find a diff patch atop 0001,
> 0002, 0003. I think the first three patches look in a reasonable shape
> now, can we merge them (0001, 0002, 0003)?
Thanks for the diff, it looks good to me.
I have merged 0001~0003 and the diff.
Here is the V40 patch set which includes the following changes:
0001:
* Merged V39-0001 ~ 0003 into one patch.
* Addressed the comments above.
* Addressed Shveta's comments[1].
0002:
No change
0003:
No change
0004:
No change
0005:
No change
0006:
No change
[1] https://www.postgresql.org/message-id/CAJpy0uChWC4MLt_d8EwmKRrYKQYfVQKJrng4KVgktr5v25HP5w%40mail.gmail.com
Best Regards,
Hou zj
Commits
-
Fix intermittent BF failures in 035_conflicts.
- 0f42206531b3 19 (unreleased) landed
-
Resume conflict-relevant data retention automatically.
- 0d48d393d465 19 (unreleased) landed
-
Fix intermittent test failure introduced in 6456c6e2c4.
- 01d793698f59 19 (unreleased) landed
-
Fix Coverity issue reported in commit a850be2fe.
- 5ac3c1ac22cb 19 (unreleased) landed
-
Add test to prevent premature removal of conflict-relevant data.
- 6456c6e2c4ad 19 (unreleased) landed
-
Post-commit review fixes for 228c370868.
- 1f7e9ba3ac4e 19 (unreleased) landed
-
Add max_retention_duration option to subscriptions.
- a850be2fe653 19 (unreleased) landed
-
Detect and report update_deleted conflicts.
- fd5a1a0c3e56 19 (unreleased) landed
-
Preserve conflict-relevant data during logical replication.
- 228c37086855 19 (unreleased) landed
-
Integrate FullTransactionIds deeper into two-phase code
- 62a17a92833d 19 (unreleased) cited
-
Improve checks for GUC recovery_target_timeline
- fd7d7b719137 19 (unreleased) cited
-
Prevent excessive delays before launching new logrep workers.
- fd519419c948 18.0 cited
-
Keep WAL segments by slot's last saved restart LSN
- ca307d5cec90 18.0 cited
-
Rework some code handling pg_subscription data in psql and pg_dump
- 08691ea958c2 18.0 cited
-
Use generateClonedIndexStmt to propagate CREATE INDEX to partitions.
- 68dfecbef210 18.0 cited