Hi hackers, Cc people involved in the related work. In the original conflict resolution thread[1], we have decided to split the conflict resolution work into multiple patches to facilitate incremental progress towards supporting conflict resolution in logical replication, and one of the work is statistics collection for the conflicts.
Following the discussions in the conflict resolution thread, the collection of logical replication conflicts is important independently, which can help user understand conflict stats (e.g., conflict rates) and potentially identify portions of the application and other parts of the system to optimize. So, I am starting a new thread for this feature. The idea is to add columns(insert_exists_count, update_differ_count, update_exists_count, update_missing_count, delete_differ_count, delete_missing_count) in view pg_stat_subscription_stats to shows information about the conflict which occur during the application of logical replication changes. The conflict types originate from the committed work which is to report additional information for each conflict in logical replication. The patch for this feature is attached. Suggestions and comments are highly appreciated. [1] https://www.postgresql.org/message-id/CAA4eK1LgPyzPr_Vrvvr4syrde4hyT%3DQQnGjdRUNP-tz3eYa%3DGQ%40mail.gmail.com Best Regards, Hou Zhijie
v1-0001-Collect-statistics-about-conflicts-in-logical-rep.patch
Description: v1-0001-Collect-statistics-about-conflicts-in-logical-rep.patch