model-writtenrun 3701 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Aug 2022 · 1 entry
- Tomas Vondra reopened sequence decoding and replication after an earlier attempt had been reverted, adopting Hannu Krosing's idea of tracking touched sequences and logging their state at transaction end #1.
Nov 2022 · 3 entries
- The November rebase exposed a fundamental ordering problem: sequence-state records could be replayed in commit order that reversed their actual changes, while holding sequence locks until commit caused serialization, deadlock risks and prepared-transaction blocking #3.
- Robert Haas argued that replication must preserve observable ordering, while Andres Freund questioned commit-based handling of nontransactional changes and identified a premature snapshot-construction problem in logical-message decoding #5 #9 #7 #10.
- Tomas supplied a separate logical-message fix, then revised it to retain snapshot construction in decode.c following Andres's review #11 #12 #13.
Jan - Jun 2023 · 11 entries
- In January, Tomas abandoned commit-time sequence logging and returned to decoding existing sequence WAL, treating newly created or altered relfilenodes transactionally and other sequence changes nontransactionally; he framed WAL-ahead values as acceptable for failover #13.
- Andres's review led Tomas to split the feature into decoding infrastructure, test_decoding support and built-in replication, while a temporary parallel-apply workaround kept the series testable until the underlying issue was fixed #16 #24 #25 #27.
- Tomas committed the snapshot-fix component of #27 as 7fe1aa991b, with comment and commit-message refinements, and subsequently resent the remaining sequence patches #33.
- Jonathan S. Katz tested synchronous and asynchronous replication and raised bidirectional-use questions; Tomas clarified that the replicated sequence state was intended for failover rather than concurrent value generation at both ends #30 #31.
- John Naylor found that FOR ALL TABLES incorrectly published sequence changes, and Tomas corrected the publication object-type checks #35 #37.
- Masahiko Sawada found subscription-refresh, parallel-apply and SKIP problems, leading Tomas to use shared relation-cache filtering and proper replication-step transaction handling #38 #40.
- Initial-copy testing revealed that directly read sequence state differed from decoded WAL state, and discussion of concurrent ALTER SEQUENCE led to a synchronization interlock and reconstruction of the WAL-ahead value #42 #45 #49 #55.
- Older-subscriber testing exposed protocol compatibility problems, so Tomas added version negotiation and a sequences subscription option, while replacing a special locking function with LOCK support for sequences following Peter Eisentraut's suggestion #56 #63 #66.
- Alvaro Herrera contributed an independent cleanup that removed enormous runs of psql alignment padding from test_decoding output, and Tomas incorporated it while fixing negotiation and subscription-refresh defects #68 #69.
- Tomas deferred the sequence feature to PostgreSQL 17 because its protocol decisions were not ready to become lasting compatibility commitments, and Peter subsequently advocated simpler protocol-version checking #69 #70.
- After a gap, Ashutosh Bapat rebased the series and reviewed its WAL tracking, test coverage, replication interface and initial synchronization, proposing storage-create records and page-LSN filtering #72 #74 #76 #79 #80.
Jul - Oct 2023 · 9 entries
- Tomas's July redesign folded accumulated fixups together, replaced the internal sequence-state tuple with one safe value, simplified test_decoding output and adopted protocol-version checking instead of the subscription capability option #83.
- Ashutosh's review persuaded Tomas to remove the initial-sync locking interlock, and subsequent testing confirmed that an older subscriber rejected sequence replication while table-only replication continued to work #84 #86 #91 #92.
- Tomas replaced the extra sequence-WAL created flag with XLOG_SMGR_CREATE decoding, corrected early XID assignment, and incorporated Ashutosh's attached terminology and comment fixups #100 #101 #102 #103.
- Amit Kapila reproduced an origin-filtering loop, and Tomas added XLOG_INCLUDE_ORIGIN to sequence WAL records #105 #114.
- With Amit Kapila and Bharath Rupireddy supporting the independent cleanup, Alvaro committed the test-output component of #114 with only comment refinements as d6677b93c7; the separately listed candidate c5c5832600 is its PostgreSQL 14 backport, not another development #105 #106 #116.
- Amit's reports of sequences moving backward after synchronization prompted an initial catchup-LSN fix, followed by pg_sequence_state(), which returns the sequence page LSN so older changes can be skipped; the remaining series also dropped the committed output cleanup #107 #119 #122 #124 #127.
- Tomas moved relfilenode tracking into transaction-local hash tables and experimented with deferring nontransactional changes until the next commit through a fake subtransaction, but the latter approach created difficult snapshot-ownership problems #136 #137.
- After discussion of restart-related backward movement, Tomas retained immediate application, abandoned the fake-transaction experiment, consolidated the other improvements and added replication-origin LSN advancement #142 #143.
- Dilip Kumar's analysis of immediate subtransaction assignments enabled simpler hash bookkeeping and combined classification/XID lookup, while Zhijie Hou's later review produced streaming and transaction-cleanup fixes #150 #151 #153 #158 #159.
Nov 2023 - Mar 2024 · 10 entries
- In November, Tomas prepared the infrastructure and test_decoding portions for possible independent commit, added slot-upgrade handling and proposed limiting hash lookup to the current top-level transaction, while leaving built-in replication for further work #160.
- Amit warned that transaction assignments might not yet be known, and Hayato Kuroda supplied an alternative that classified changes using relation-cache information recorded in WAL; Tomas extended its boolean flag to the creating subtransaction's XID after finding lost advances on rollback #161 #162 #166 #169.
- Further tests showed that subtransaction rollback could erase the relation-cache history needed by that alternative, so Tomas restored reorderbuffer tracking and added subtransaction tests and Peter Smith's review fixes #173 #170 #175.
- Performance testing motivated a global relfilenode hash table, but Tomas found that it did not eliminate the cost of starting and aborting a transaction for each nontransactional sequence change #181 #185 #198.
- Dilip revisited batching nontransactional changes and identified possible misclassification when snapshot state advanced between relfilenode creation and a sequence update; subsequent analysis showed those startup changes were discarded, while recording relfilenodes earlier raised cleanup concerns #189 #191 #204 #205 #207 #209 #211.
- Following discussions about failover, upgrades and overhead, Tomas restored an explicit default-off subscription option so users not replicating sequences could avoid decoding costs, and supplied alternative approaches to documenting or preventing startup misclassification #218.
- Robert Haas challenged ordering guarantees and identified insufficient locking when ALTER TABLE changed an owned sequence's persistence; Tomas agreed that the locking defect was independent of sequence decoding #221 #222.
- Robert and Tomas clarified that nontransactional sequence WAL records must retain their order relative to transaction commits, and Robert requested that this requirement be documented explicitly #223 #224 #225.
- Further review found that fast-forward mode never built the relfilenode tracking table, making its transactional classification unreliable and requiring clearer code and comments #230 #237 #238.
- At the thread's end, only the independent snapshot fix and test-output cleanup had landed from this work; Tomas deferred sequence decoding and replication beyond PostgreSQL 17 because startup classification remained fragile and explicit versus automatic publication of sequences backing SERIAL or BIGSERIAL columns was unresolved #240.