| From: | Michael Paquier <michael(at)paquier(dot)xyz> |
|---|---|
| To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
| Subject: | pgsql: Lift shutdown assertion in pgstats for WAL senders |
| Date: | 2026-06-05 23:53:35 |
| Message-ID: | E1wVeM3-001GH0-2t@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
Lift shutdown assertion in pgstats for WAL senders
Before v17, WAL senders can shut down after the checkpointer. If a WAL
sender still has pending statistics when the checkpointer has already
exited, its shutdown callback may attempt to report those statistics and
trigger assertions in pgstats. In that case, the pending statistics are
lost.
This commit adjusts the assertion handling so that attempts to report
pending WAL sender statistics after the checkpointer has completed its
final stats flush are skipped.
Preserving the existing assertion would require backpatching an
equivalent of 87a6690cc69, ensuring that the checkpointer is always the
last process to exit. Such a change would be considerably more invasive
and risky for stable branches because it alters the shutdown sequence,
and the consequence is only some loss of stats data for the WAL sender.
This assertion failure was periodically detected in the buildfarm,
leading to spurious failures.
Reported-by: Alexander Lakhin <exclusion(at)gmail(dot)com>
Reviewed-by: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Discussion: https://postgr.es/m/18158-88f667028dbc7e7b@postgresql.org
Backpatch-through: 15-17
Branch
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/830b476d0beae290b7f8d29bee6d13884b287b20
Modified Files
--------------
src/backend/utils/activity/pgstat.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Rowley | 2026-06-06 04:46:44 | pgsql: Fix tuple deforming with virtual generated columns |
| Previous Message | Michael Paquier | 2026-06-05 23:17:27 | pgsql: pg_surgery: Fix off-by-one bug with heap offset |