pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix race condition in stats.sql added in 5264add7847
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix race condition in stats.sql added in 5264add7847
@ 2022-09-16 18:31  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2022-09-16 18:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in stats.sql added in 5264add7847

Very occasionally the stats test failed due to the number of sessions not
being updated yet. Likely this requires that there is contention on the
database's stats entry. Solve this by forcing pending stats to be flushed
before fetching the stats.

I verified that there are no other test failures after making
pgstat_report_stat() only flush stats when force = true.

Per message from Tom Lane and buildfarm member crake.

Discussion: https://postgr.es/m/3428246.1663271992@sss.pgh.pa.us
Backpatch: 15-, where 5264add7847 added the test

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/885826f95d1c7803d3ff97bde64078b257543266

Modified Files
--------------
src/test/regress/expected/stats.out | 6 ++++++
src/test/regress/sql/stats.sql      | 1 +
2 files changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix race condition in stats.sql added in 5264add7847
@ 2022-09-16 18:31  Andres Freund <andres@anarazel.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Andres Freund @ 2022-09-16 18:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix race condition in stats.sql added in 5264add7847

Very occasionally the stats test failed due to the number of sessions not
being updated yet. Likely this requires that there is contention on the
database's stats entry. Solve this by forcing pending stats to be flushed
before fetching the stats.

I verified that there are no other test failures after making
pgstat_report_stat() only flush stats when force = true.

Per message from Tom Lane and buildfarm member crake.

Discussion: https://postgr.es/m/3428246.1663271992@sss.pgh.pa.us
Backpatch: 15-, where 5264add7847 added the test

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/32914d900f90f7f5238a3856e67f6bc5bf05e1d9

Modified Files
--------------
src/test/regress/expected/stats.out | 6 ++++++
src/test/regress/sql/stats.sql      | 1 +
2 files changed, 7 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-09-16 18:31 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 18:31 pgsql: Fix race condition in stats.sql added in 5264add7847 Andres Freund <andres@anarazel.de>
2022-09-16 18:31 pgsql: Fix race condition in stats.sql added in 5264add7847 Andres Freund <andres@anarazel.de>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox