model-writtenrun 1141 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Shinya Kato reported that rapid flush and apply replies could erase valid replication lag measurements during active physical replication, and proposed requiring empty lag samples before clearing the values in #1.
- Fujii Masao reproduced NULL lag during logical replication despite the patch and suggested an inactivity timeout in #2; Shinya instead added unchanged-position checks in #3, explaining that the sender could not know the receiver's status interval or choose a reliable timeout.
- Fujii questioned the resulting doubling of the idle lag-reset delay in #4 and proposed removing fullyAppliedLastTime in #6, but Shinya demonstrated that duplicate physical-replication replies would still clear lag prematurely and retained the logic while adding a walreceiver comment fix in #7.
- Concerned about changing reset timing on stable branches, Fujii supplied a different approach in #8: suppress redundant apply notifications in walreceiver and require both flush and apply positions to catch up before treating the standby as fully applied.
- Chao Li endorsed the approach but requested names that reflected conditional apply-status reporting in #9, while Shinya confirmed the physical-replication fix and reported a remaining logical-replication problem and a comment typo in #10.
- After Fujii questioned the expected behavior in #11, Shinya clarified that NULL values still appeared during continuous logical-replication activity, independently of the status interval, in #12.
- Fujii restored consecutive-position tracking in walsender, removed fullyAppliedLastTime, and retained receiver-side duplicate suppression in #13; Shinya reported that the combined patch worked in #14.
- Fujii incorporated Chao's naming suggestions and corrected comments in #15, proposing that only the walsender changes be backpatched because reducing feedback-message traffic was too invasive for stable branches.
- Chao approved the revised combined patch in #16, and Shinya approved it and supported backpatching the partial mitigation in #17.
- Fujii split the unchanged implementation into a backpatchable walsender fix and a master-only walreceiver change in #19, and Shinya approved the final series in #20.
- The first patch from #19 landed unchanged as eef1ba704d and was backpatched through PostgreSQL 14, while the second landed unchanged on master as 400a790a48.
- Fujii confirmed both patches were pushed in #21, leaving no submitted patch pending; stable branches received the position-tracking mitigation but deliberately omitted duplicate-reply suppression, so repeated identical position reports could still cause premature NULL lag there.