Re: BUG #19360: Bug Report: Logical Replication initial sync fails with "conflict=update_origin_differs" PG12 toPG18
| От | Amit Kapila |
|---|---|
| Тема | Re: BUG #19360: Bug Report: Logical Replication initial sync fails with "conflict=update_origin_differs" PG12 toPG18 |
| Дата | |
| Msg-id | CAA4eK1LxGXR7jOAKh0B8N362S-Q3b6GhBxxcV_HxUaicEPq5Cg@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: BUG #19360: Bug Report: Logical Replication initial sync fails with "conflict=update_origin_differs" PG12 toPG18 (vignesh C <vignesh21@gmail.com>) |
| Ответы |
Re: BUG #19360: Bug Report: Logical Replication initial sync fails with "conflict=update_origin_differs" PG12 toPG18
|
| Список | pgsql-bugs |
On Mon, Dec 29, 2025 at 4:26 PM vignesh C <vignesh21@gmail.com> wrote: > > On Mon, 22 Dec 2025 at 19:00, PG Bug reporting form > <noreply@postgresql.org> wrote: > > > > This can occur in the following scenario: commit timestamp tracking is > enabled on the subscriber; the same table exists on both publisher and > subscriber; a publication is created on the publisher with initial > data; and a subscription is created on the subscriber with origin = > none. During the initial table synchronization, the row is inserted > using a tablesync replication origin, which is dropped once > synchronization completes. If the row is updated on the publisher > after the initial sync, the apply worker attempts to update a row that > was inserted using a different replication origin(tablesync origin), > resulting in an origin mismatch. > > The conflict is logged and logical replication continues normally. No > crash occurs, and the log entry is informational rather than > indicative of a failure. > I agree with this analysis. > These messages can be safely ignored for now. > > We are currently evaluating possible improvements to handle this > scenario more gracefully and to avoid reporting these conflicts in the > future. > One idea to safely ignore these LOGs is we could modify the state management in the catalog pg_subscription_rel to store originID. When a tablesync worker completes, instead of just deleting the origin and setting the relation state to ready, it could record the origin_id it used into pg_subscription_rel. When the apply worker encounters an origin mismatch, it checks pg_subscription_rel for that specific table. If the "old" origin ID matches the one recorded during the sync phase, the worker knows the row is "ours" and suppresses the log. Now, as the origin ID could be reused, we could additionally store local timestamp along with originId in pg_subscription_rel. Then, we can suppress the log if: row_origin_id == srsuboriginid AND row_commit_time <= srsubsynctime. I think addressing this is much more important conflict resolution to avoid doing any wrong resolution for conflicts. -- With Regards, Amit Kapila.
В списке pgsql-bugs по дате отправления: