Re: Conflict detection for update_deleted in logical replication
Dilip Kumar <dilipbalaut@gmail.com>
On Thu, Jul 17, 2025 at 4:44 PM shveta malik <shveta.malik@gmail.com> wrote: > > On Thu, Jul 17, 2025 at 9:56 AM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > > > I was just thinking about what are the most practical use cases where > > a user would need multiple active writer nodes. Most applications > > typically function well with a single active writer node. While it's > > beneficial to have multiple nodes capable of writing for immediate > > failover (e.g., if the current writer goes down), or they select a > > primary writer via consensus algorithms like Raft/Paxos, I rarely > > encounter use cases where users require multiple active writer nodes > > for scaling write workloads. > > Thank you for the feedback. In the scenario with a single writer node > and a subscriber with RCI enabled, we have not observed any > regression. Please refer to the test report at [1], specifically test > cases 1 and 2, which involve a single writer node. Next, we can test a > scenario with multiple (2-3) writer nodes publishing changes, and a > subscriber node subscribing to those writers with RCI enabled, which > can even serve as a good use case of the conflict detection we are > targeting through RCI enabling. +1 > > One common use case for multiple active writer nodes is in > > geographically distributed systems. Here, a dedicated writer in each > > zone can significantly reduce write latency by sending writes to the > > nearest zone. > > > > In a multi-zone replication setup with an active writer in each zone > > and data replicated across all zones, performance can be impacted by > > factors like network latency. However, if such configurations are > > implemented wisely and subscriptions are managed effectively, this > > performance impact can be minimized. > > > > IMHO, the same principle applies to this case when > > ‘retain_conflict_info’ is set to ON. If this setting is enabled, it > > should only be used where absolutely essential. Additionally, the user > > or DBA must carefully consider other factors. For instance, if they > > use a single subscriber in each zone and subscribe to everything > > across all zones, performance will significantly degrade. However, if > > managed properly by subscribing only to data relevant to each zone and > > using multiple subscribers for parallel apply of different > > tables/partitions to reduce delay, it should work fine. > > > > Strongly agree with this. We tested scenarios involving multiple > subscribers, each subscribing to exclusive data, as well as > publishers using row filters. In both cases, no regressions were > observed. Please refer to the test results at [2] and [3]. Right, thanks for pointing me to the related test cases. -- Regards, Dilip Kumar Google
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