model-writtenrun 4467 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Oct - Dec 2021 · 8 entries
- Zhijie Hou opened the thread with Greg Nancarrow's finding that explicitly publishing a parent and its partition with publish_via_partition_root enabled copies the partition's initial data twice, and proposed filtering the advertised table list in #1.
- Amit Langote initially questioned removing explicitly published children because subscribers may use unrelated tables, while Hou, Amit Kapila, and Dilip Kumar argued that initial synchronization should agree with subsequent replication and FOR ALL TABLES behavior in #6, #8, #9, and #11.
- Greg's additional example showed duplicate copying after adding a parent and refreshing a subscription; Hou separated that disputed refresh behavior from the initial-copy bug and pursued the latter in #3 and #23.
- The implementation evolved from changing GetPublicationRelations() to filtering directly in pg_get_publication_tables(), then reused the filtering helper introduced with schema publications in #2, #5, and #23.
- Greg confirmed the initial-copy fix but found duplicate pg_publication_tables rows when publish_via_partition_root was false, prompting a second patch in #30 that was subsequently moved to its own thread at Amit Kapila's request in #33 and #34.
- Hou added a subscription regression test in #35, Amit Kapila polished the patch in #36, and Amit Langote confirmed that the test detects the unfixed bug in #40.
- Greg proposed documenting the view's parent-versus-partition behavior, and Hou prepared branch-specific code and test patches with a separate HEAD documentation change in #37, #43, and #44.
- After Vignesh and Amit Kapila verified the final patches, 5e97905a2c landed the code and tests from #44, leaving out the documentation addition and backpatching the fix through PostgreSQL 13, as confirmed by #45, #48, and #49.
Mar - Nov 2022 · 9 entries
- Hou reopened the problem in March 2022 with a different case: one subscription combining publications that separately publish a parent and child still copies both, although subsequent changes use the parent's identity, as demonstrated in #50.
- Wang Wei supplied a subscriber-side implementation using multiple queries and C filtering in #51; after Hou suggested moving ancestor checks into SQL, Shi Yu supplied a much smaller query-based replacement in #52 and #53.
- Wang adopted Shi Yu's approach and simplified its tests in #54, but Amit Kapila argued that repeated catalog queries were too complex and proposed a publisher function accepting multiple publications in #55.
- The series split into a new publisher-side API for HEAD and a query-based solution for older branches in #56, with tests covering the incorrect row filters and column lists demonstrated in #57.
- Wang changed the proposed separate function into an extension of pg_get_publication_tables(), addressed Osumi's SRF and memory reviews, and adopted Amit Kapila's VARIADIC text[] interface in #59, #62, #64, and #67.
- After upstream row-filter and column-list changes, the July revision began retaining publication/relation associations and using version-dependent subscriber queries; Peter Smith's review then simplified result accumulation and clarified the implementation in #70, #71, and #72.
- Peter's further reviews improved naming, comments, and the representation of publication/relation pairs, while Hou clarified that publishing only a child with publish_via_partition_root does not implicitly publish its absent parent in #76, #78, #84, and #85.
- Peter pressed for documentation of combined publications and identifiable function results, leading to a documentation patch and a pubid output field, with Osumi refining the explanation and markup in #86, #88, #90, #93, and #94.
- Vignesh proposed eliminating the temporary OID list, which Wang implemented by filtering published_rel entries directly in #97 and #98; Wang declined further grouping by publication because it would complicate filtering in #100.
Feb - Mar 2023 · 11 entries
- After a gap, upstream changes exposed failing regression expectations, and Wang rebased the series in response to Andres Freund's report in #101 and #102.
- In March 2023 Amit Kapila narrowed the immediate target to PostgreSQL 16 publishers, asking that the complicated older-publisher fix be separated because there were no field reports justifying its risk; Wang split the series accordingly in #103 and #104.
- Amit questioned changing missing-publication behavior and using malloc, so Wang restored the existing error semantics, documented the caller's filtering join, and switched to palloc in #105 and #108.
- Jacob Champion requested stronger mixed-setting tests, Hayato Kuroda tested multilevel partitions, and Amit supplied a comment-only delta plus implementation and test suggestions; Wang folded these into the series and merged its documentation into the main patch in #106, #112, #111, and #115.
- Peter's continued review led to clearer tests with publish_via_partition_root enabled only for the parent publication and dedicated row-filter initial-copy coverage in #123, #127, and #131.
- Wang discovered that the older-publisher patches depended on pg_partition_ancestors(), unavailable on PostgreSQL 11, and stopped including them; Amit agreed to defer that complicated compatibility work in #131 and #133.
- Amit removed unnecessary individual frees covered by the SRF memory context, and subsequent revisions clarified test names while declining additional streaming tests outside the initial-copy fix's scope in #133, #134, #135, and #136.
- Jacob measured the attribute-name subquery as roughly 90 percent of query runtime and suggested comparing gpt.attrs directly; Wang implemented that optimization and corrected the final attachment in #138, #139, and #140.
- Jacob accepted the final implementation and coverage, Peter reviewed its type initialization, and Amit retained the explicit version-dependent initialization before committing 062a844424 from #140 with only a sorted-attributes comment and catalog-version bump, as recorded in #141, #142, #143, and #144.
- After that landing, Jacob demonstrated that adding an already-replicated partition root to a publication with different publish_via_partition_root settings and refreshing the subscription can still duplicate data; Peter reproduced it and explained the difficulty of deciding which existing partitions should be recopied in #145 and #146.
- Shi Yu connected the new refresh report to the original unresolved discussion, and Jacob agreed that user intent is difficult to infer and the pitfalls should be documented; the thread ends with both initial-copy fixes landed, older-publisher support deferred, and refresh behavior still unresolved in #147, #148, and #149.