]> granicus.if.org Git - postgresql/commit
stats regression test's wait_for_stats() must check timestamp too.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 May 2017 03:33:03 +0000 (23:33 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 May 2017 03:33:18 +0000 (23:33 -0400)
commiteda4ef81511ea62e49f5ea9edb8fbfdd529dd959
tree7aa421f5c04b38553a51a9f27353acb78c5ebeb8
parentde7cca982ca253236051c2a7f6477bee5ce4b045
stats regression test's wait_for_stats() must check timestamp too.

pg_stat_get_snapshot_timestamp() returns the timestamp seen in the "global"
stats file.  Because pgstat_write_statsfiles() writes per-DB stats files
before the global file (or at least before renaming it into place), there
is a window where the test backend can see all the stats updates that
wait_for_stats() was checking for (all of which come from the per-DB file)
but also see the same global stats file it had seen at the start of the
test script.  This results in a failure in only the "snapshot_newer" query,
as reported by a couple of buildfarm members recently.

I suspect that this ought to be back-patched.  Commit 4e37b3e15 has
evidently increased the probability of this window getting hit, but
it's not apparent why it could not have been hit before.  I'll refrain
for the moment though.
src/test/regress/expected/stats.out
src/test/regress/sql/stats.sql