I have implemented this solution in the attached patch. The patch
adds a new field to pg_subscription_rel, srtablesyncoriginid, which
stores the tablesync worker's origin ID for each relation. These origin
IDs are loaded into a per-subscription hash table after the tablesync
COPY completes, and also when the apply worker starts, thereby avoiding
repeated catalog lookups. During conflict detection, the apply worker
checks this hash table to determine whether the conflict origin ID
matches one of the saved tablesync origin IDs for the subscription. If a
match is found, the conflict is treated as originating from the initial
table synchronization and logging is suppressed. I have not included
documentation updates in this patch. If this approach is considered
acceptable, I can prepare the corresponding documentation changes as
well.
regards,
Ajin Cherian
Fujitsu Australia