Skip to content

Commit fdb69dd

Browse files
committed
Fix instability with WAL fsync test in stats.sql
A backend using wal_sync_method set to "open_sync" or "open_datasync" would fail the test checking the WAL sync data in pg_stat_io. These modes guarantee that a sync is done when WAL is written to disk, and the data checked by the test is not incremented in this case, issue_xlog_fsync() doing nothing. Oversight in commit a051e71. Author: Sami Imseih <samimseih@gmail.com> Discussion: https://postgr.es/m/CAA5RZ0uxwg3xAi4nvdBMJ-zJQEeyg+RotuU+ebM2F6CKmnvaYA@mail.gmail.com
1 parent 847bbb2 commit fdb69dd

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/test/regress/expected/stats.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,7 @@ SELECT :io_sum_wal_normal_after_writes > :io_sum_wal_normal_before_writes;
14561456
(1 row)
14571457

14581458
SELECT current_setting('fsync') = 'off'
1459+
OR current_setting('wal_sync_method') IN ('open_sync', 'open_datasync')
14591460
OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
14601461
?column?
14611462
----------

src/test/regress/sql/stats.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,7 @@ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
672672
SELECT current_setting('synchronous_commit') = 'on';
673673
SELECT :io_sum_wal_normal_after_writes > :io_sum_wal_normal_before_writes;
674674
SELECT current_setting('fsync') = 'off'
675+
OR current_setting('wal_sync_method') IN ('open_sync', 'open_datasync')
675676
OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
676677

677678
-- Change the tablespace so that the table is rewritten directly, then SELECT

0 commit comments

Comments
 (0)