model-writtenrun 2357 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bertrand Drouvot reported that active WAL senders withheld IO statistics until exit and proposed flushing them inside WalSndLoop(), initially testing logical decoding in #1.
- Michael Paquier recommended placing the flush after the keepalive handling to avoid unnecessary work before shutdown in #2, and Bertrand adopted that placement while switching to a physical-streaming test in #3.
- Andres Freund proposed separating periodic nontransactional statistics reporting from transaction-boundary reporting in #4; Michael supported the broader direction in #5, and Bertrand volunteered to pursue it in #6.
- Michael warned that flushing on every sender-loop iteration could cause excessive locking and contention in #8, then proposed a replication benchmark in #9.
- Bertrand's measurements found substantial overhead in repeated zero-memory checks, so #12 retained the original fix and added a separate backend_has_iostats optimization for backend statistics.
- Michael's further measurements favored flushing near waits in #13, while Bertrand noted that WalSndWaitForWal() only served logical senders in #15; Bertrand consequently proposed a shared, interval-controlled path for both sender types in #16, with polling to stabilize the test.
- Xuneng Zhou reviewed the backend optimization in #17, prompting Bertrand to restore a rebased companion patch alongside the unchanged interval-controlled fix in #19; Xuneng's subsequent measurements supported a one-second interval in #23.
- Michael committed the optimization independently as 6d3ea48ff1, using the companion patch from #19 with additional flag handling for timing updates and backend initialization, then deferred the backpatchable WAL-sender fix until after the release freeze in #25.
- Discussion about exposing statistics internals led Michael to request a sender-local interval constant in #31; Bertrand adopted it in the remaining WAL-sender patch in #32, while retaining the shared flush path.
- Vignesh requested logical-replication coverage in #33 and suggested the subscription test suite in #35; Bertrand added the test in #36, but Vignesh found that it also passed without the fix in #37.
- Michael submitted #38 with separate flush paths for physical and logical senders, avoiding an extra timestamp call in the logical sender's hot loop, and removed the ineffective subscription test.
- Bertrand demonstrated in #39 that resetting statistics after subscription setup made the logical test discriminate correctly, and confirmed that the separate logical flush path also made the test finish promptly.
- Michael committed 039549d70f from #38 with Bertrand's corrected logical test and comment adjustments, confirming in #40 that the fix was backpatched through PostgreSQL 16; the new tests were included only on the development branch.
- The broader reporting design resumed in September: Bertrand proposed separate pending lists and callbacks in #41, while Michael explored reusing pending storage and flush callbacks in #43; Bertrand clarified the need to accommodate statistics kinds containing both transactional and nontransactional metrics in #44.
- Michael asked for concrete reporting requirements and a dedicated design thread in #45, Bertrand agreed in #46, and his final update in #47 said that investigation had begun; both concrete patches had landed, while generalized periodic statistics reporting remained future work.