model-writtenrun 8470 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tom Pang reported that unlogged hint bits persisted on a rewound standby could contradict the new primary’s transaction outcomes, and supplied a TAP reproducer where a prepared transaction aborted on one timeline but committed on another, leaving its row incorrectly invisible after rewind #1.
- Sebastian Webber confirmed the same failure on master and branch heads from PostgreSQL 14 through 19rc1, explaining the replay-wait and build adjustments needed to run the reproducer on older branches #2.
- Jan Nidzwetzki traced the problem to standbys replaying checkpoint records without necessarily completing restartpoints, allowing older dirty buffers to carry divergent hints to disk; he also identified exposure after promotion before the first checkpoint and explained why missing restartpoint history, unavailable WAL, and index hints obstructed a complete fix inside pg_rewind #3.
- Jan’s proposed backend fix remembers redo pointers and oldestActiveXid values for four replayed checkpoints to identify safe transaction hints, suppresses unsafe hints on dirty recovery buffers, and WAL-logs unsafe transaction hints after promotion until the first checkpoint completes; restricted index hints are skipped, and clean buffers receive additional WAL protection for hints inherited from recovery #3.
- Jan incorporated and expanded Tom’s reproducer to cover standby and post-promotion cases, including a clean-buffer scenario controlled by an injection point; preliminary benchmarks showed mostly unchanged performance with some first-scan costs, and the thread ends with the first fix submitted for feedback and no linked commit #3.