Re: Conflict detection for update_deleted in logical replication
Masahiko Sawada <sawada.mshk@gmail.com>
On Thu, Jan 23, 2025 at 3:47 AM Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com> wrote: > > On Wednesday, January 22, 2025 7:54 PM Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com> wrote: > > On Saturday, January 18, 2025 11:45 AM Zhijie Hou (Fujitsu) > > <houzj.fnst@fujitsu.com> wrote: > > > I think invalidating the slot is OK and we could also let the apply > > > worker to automatic recovery as suggested in [1]. > > > > > > Here is the V24 patch set. I modified 0004 patch to implement the slot > > > Invalidation part. Since the automatic recovery could be an > > > optimization and the discussion is in progress, I didn't implement that part. > > > > The implementation is in progress and I will include it in next version. > > > > Here is the V25 patch set that includes the following change: > > > > 0001 > > > > * Per off-list discussion with Amit, I added few comments to mention the > > reason of skipping advancing xid when table sync is in progress and to mention > > that the advancement will not be delayed if changes are filtered out on > > publisher via row/table filter. > > > > 0004 > > > > * Fixed a bug that the launcher would advance the slot.xmin when some apply > > workers have not yet started. > > > > * Fixed a bug that the launcher did not advance the slot.xmin even if one of the > > apply worker has stopped conflict retention due to the lag. > > > > * Add a retain_conflict_info column in the pg_stat_subscription view to > > indicate whether the apply worker is effectively retaining conflict > > information. The value is set to true only if retain_conflict_info is enabled > > for the associated subscription, and the retention duration for conflict > > detection by the apply worker has not exceeded > > max_conflict_retention_duration. Thanks Kuroda-san for contributing codes > > off-list. > > Here is V25 patch set which includes the following changes: > > 0004 > * Addressed Nisha's comments[1]. > * Fixed a cfbot failure[2] in the doc. I have one question about the 0004 patch; it implemented max_conflict_retntion_duration as a subscription parameter. But the launcher invalidates the pg_conflict_detection slot only if all subscriptions with retain_conflict_info stopped retaining dead tuples due to the max_conflict_retention_duration parameter. Therefore, even if users set the parameter to a low value to avoid table bloats, it would not make sense if other subscriptions set it to a larger value. Is my understanding correct? Regards, -- Masahiko Sawada Amazon Web Services: https://aws.amazon.com
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