model-writtenrun 9934 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Shveta Malik reported that dropping a publication or removing a table before its initial synchronization could cause all rows and columns to be copied, bypassing the former publication filters; her initial patch raises errors for empty publication-query results so synchronization remains pending instead of incorrectly completing #1.
- Shveta noted that changing publish_via_partition_root before synchronization would now require REFRESH PUBLICATION to clear errors for formerly published relations #2; Shlok Kyal reproduced the original bug across PostgreSQL 15 through 19 and master, and identified the same cause allowing a replacement unlogged table to be copied #3.
- Peter Smith questioned repeated errors and suggested warning instead, alongside row-count and test improvements #4; Shveta incorporated those improvements while defending ERROR because it preserves pending synchronization, error statistics, and disable_on_error handling without depending on a future per-table resynchronization feature #5.
- Peter accepted the ERROR rationale and approved the revised patch, but suggested automatically removing unpublished tables from pg_subscription_rel as another possible approach #7.
- Ajin Cherian identified a recovery problem when disable_on_error disables the whole subscription, preventing REFRESH PUBLICATION #8; Shveta tested temporarily turning disable_on_error off, enabling the subscription, refreshing it, and restoring the setting, while also noting that repairing publication on the publisher could allow recovery #9 #10. Ajin endorsed documenting the workaround and explained why republishing would not suit every case #11.
- Shveta rejected automatic removal from pg_subscription_rel because republished tables would remain excluded until an explicit refresh, workers would acquire new catalog-removal responsibilities, and partition-root changes would receive only a partial refresh; she retained the error-based approach #12.
- Shveta expanded the series with a separate recovery-documentation patch while leaving the code and tests unchanged #13. Peter reaffirmed approval of the code patch and requested clearer documentation wording and placement of the recovery procedure under ALTER SUBSCRIPTION #14.
- Vignesh C proposed removing post-error inserts and refresh testing as redundant #15; Shveta removed the inserts and catchup wait but retained checks that no data was copied and that REFRESH PUBLICATION removes tables stuck in DATASYNC, distinguishing this from existing READY-state coverage #16.
- The fourth version also split the documentation between CREATE SUBSCRIPTION and ALTER SUBSCRIPTION, incorporating Peter's wording with adjustments explaining that errors recur after re-enabling the subscription #16 #17. Vignesh accepted the retained testing and requested back-branch patches #18.
- Shveta deferred back-branch patches until the approach was approved and questioned whether this behavior change should be backpatched in the absence of field reports #19; Vignesh accepted the deferral and registered a CommitFest entry #20.
- Peter requested shorter recovery instructions that emphasized temporarily disabling disable_on_error without enumerating failure causes or repeating full commands #21; Shveta incorporated this with adjustments in the fifth version, leaving the code and tests unchanged #23, and Peter approved the revised documentation #24.
- Shlok demonstrated that replacing a published table with a view, materialized view, or foreign table before synchronization also allowed unintended copying on HEAD, and confirmed that the fifth version correctly rejected these cases and unlogged tables; he proposed filtering relation kind and persistence in the initial remote lookup #25.
- Shveta opposed adding relation-kind and persistence filters because publication eligibility belongs to the publisher and duplicating those rules on the subscriber would require ongoing maintenance; the existing publication-membership checks already reject the replacement relations #26.
- At the last message, the code fix and recovery documentation remain uncommitted in the supplied record, with additional testing supporting the current approach, committer approval still pending, and backpatch scope unresolved #23 #25 #26 #19.