Re: Conflict detection for update_deleted in logical replication
Masahiko Sawada <sawada.mshk@gmail.com>
On Mon, Jul 7, 2025 at 12:29 PM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote: > > Dear Sawada-san, > > > What does each duration mean in these results? Can we interpret the > > test case of max_conflict_retention_duration=120s that when 7 clients > > and 15 clients are working on the publisher and the subscriber > > respectively, the TPS on the subscriber was about one fourth (17835.3 > > vs. 4707)? > > Firstly, this workload is done to prove that users can tune their workload to keep > enabling the update_deleted detections. Let me describe what happened there with > the timetable since the test starts. > > 0-162s: > Number of clients on both publisher/subscriber was 15. TPS was 17835.3 on the > publisher and 4571.8 on the subscriber. This means that retained dead tuples on > the subscriber may reduce the performance to around 1/4 compared with publisher, > and the workload on the publisher is too heavy to keep working the update_deleted > detection. > > 163-314s: > Number of clients was 7 on publisher, and 15 on subscriber. TPS was 9503.8 on > the publisher and 4707 on the subscriber. This means that N=7 on the publisher > was still too many thus conflict slot must be invalidated. > > 315-597s: > Number of clients was 3 on publisher, and 15 on subscriber. TPS was 4243.9 on > the publisher and 19568.4 on the subscriber. Here the conflict slot could survive > during the benchmark because concurrency on the publisher was reduced. > Performance could be improved on the subscriber side because dead tuples can be > reduced here. Thank you for your explanation! Since this feature is designed to reliably detect conflicts on the subscriber side, this scenario, where both the publisher and subscriber are under load, represents a typical use case. The fact that the subscriber can withstand the case where N=7 on the publisher and N=15 on the subscriber with retain_conflict_info = false, but fails to do so when retain_conflict_info = true, might suggests a significant performance impact from enabling this feature. In these test cases, was autovacuum disabled? I'm curious whether users would experience permanently reduced transaction throughput, or if this performance drop is temporary and recovers after autovacuum runs. 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