Re: pg_stat_replication.*_lag sometimes shows NULL during active replication
Shinya Kato <shinya11.kato@gmail.com>
From: Shinya Kato <shinya11.kato@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-26T05:40:37Z
Lists: pgsql-hackers
On Thu, Mar 26, 2026, 00:30 Fujii Masao <masao.fujii@gmail.com> wrote: > On Wed, Mar 25, 2026 at 4:03 PM Shinya Kato <shinya11.kato@gmail.com> > wrote: > > Thanks for the updated patch. LGTM. > > > > Regarding the backpatch, I'd personally appreciate it if the walsender.c > changes were backpatched to stable branches. As you noted, it don't fully > solve the reported issue, but they do help reduce the cases where lag > columns in pg_stat_replication unexpectedly become NULL. > > > > Even a partial mitigation in the back branches would be valuable for > users running stable releases. > > +1 > > I've split the changes into two patches. > > Patch 0001 fixes premature NULL lag reporting in walsender. I will commit > it > and backpatch it to all supported branches. > > Patch 0002 avoids sending duplicate WAL locations in standby status > replies. > I will commit this to master only. > Thanks, LGTM. Best regards, Shinya Kato >
Commits
-
Avoid sending duplicate WAL locations in standby status replies
- 400a790a48eb 19 (unreleased) landed
-
Fix premature NULL lag reporting in pg_stat_replication
- bf7ecf35318d 14.23 landed
- 246c296f00ae 15.18 landed
- f4210500156a 16.14 landed
- fdce5de552c2 17.10 landed
- 98e96e579b91 18.4 landed
- eef1ba704dde 19 (unreleased) landed