Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5463715

Browse files
committed
Relax regression test for fsync check of backend-level stats
One test added in 9aea73f did not take into account that the backend may have some fsync even after a checkpoint. Let's relax it to be more flexible. Per report from buildfarm member grassquit, via Alexander Lakhin. Author: Bertrand Drouvot Discussion: https://postgr.es/m/6143ab0a-9e88-4790-8d9d-50ba45657761@gmail.com
1 parent 5983a4c commit 5463715

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/test/regress/expected/stats.out

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ SELECT :my_io_sum_shared_after_extends > :my_io_sum_shared_before_extends;
12991299
(1 row)
13001300

13011301
-- After a checkpoint, there should be some additional IOCONTEXT_NORMAL writes
1302-
-- and fsyncs in the global stats (not for the backend).
1302+
-- and fsyncs in the global stats (usually not for the backend).
13031303
-- See comment above for rationale for two explicit CHECKPOINTs.
13041304
CHECKPOINT;
13051305
CHECKPOINT;
@@ -1329,8 +1329,7 @@ SELECT :my_io_sum_shared_after_writes >= :my_io_sum_shared_before_writes;
13291329
(1 row)
13301330

13311331
SELECT current_setting('fsync') = 'off'
1332-
OR (:my_io_sum_shared_after_fsyncs = :my_io_sum_shared_before_fsyncs
1333-
AND :my_io_sum_shared_after_fsyncs= 0);
1332+
OR :my_io_sum_shared_after_fsyncs >= :my_io_sum_shared_before_fsyncs;
13341333
?column?
13351334
----------
13361335
t

src/test/regress/sql/stats.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ SELECT sum(extends) AS my_io_sum_shared_after_extends
633633
SELECT :my_io_sum_shared_after_extends > :my_io_sum_shared_before_extends;
634634

635635
-- After a checkpoint, there should be some additional IOCONTEXT_NORMAL writes
636-
-- and fsyncs in the global stats (not for the backend).
636+
-- and fsyncs in the global stats (usually not for the backend).
637637
-- See comment above for rationale for two explicit CHECKPOINTs.
638638
CHECKPOINT;
639639
CHECKPOINT;
@@ -648,8 +648,7 @@ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
648648
WHERE object = 'relation' \gset my_io_sum_shared_after_
649649
SELECT :my_io_sum_shared_after_writes >= :my_io_sum_shared_before_writes;
650650
SELECT current_setting('fsync') = 'off'
651-
OR (:my_io_sum_shared_after_fsyncs = :my_io_sum_shared_before_fsyncs
652-
AND :my_io_sum_shared_after_fsyncs= 0);
651+
OR :my_io_sum_shared_after_fsyncs >= :my_io_sum_shared_before_fsyncs;
653652

654653
-- Change the tablespace so that the table is rewritten directly, then SELECT
655654
-- from it to cause it to be read back into shared buffers.

0 commit comments

Comments
 (0)