summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier2025-04-12 04:09:48 +0000
committerMichael Paquier2025-04-12 04:09:48 +0000
commitfdb69dd582427e4976897d544867e65a0e767002 (patch)
tree2f31095fc939fc05fc343fbadb8bfbff1769067d /src
parent847bbb21f8c4eb0e2b47417684ad2ba9255c9e80 (diff)
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 a051e71e28a1. Author: Sami Imseih <[email protected]> Discussion: https://postgr.es/m/CAA5RZ0uxwg3xAi4nvdBMJ-zJQEeyg+RotuU+ebM2F6CKmnvaYA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/stats.out1
-rw-r--r--src/test/regress/sql/stats.sql1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/test/regress/expected/stats.out b/src/test/regress/expected/stats.out
index cd08a2ca0af..776f1ad0e53 100644
--- a/src/test/regress/expected/stats.out
+++ b/src/test/regress/expected/stats.out
@@ -1456,6 +1456,7 @@ SELECT :io_sum_wal_normal_after_writes > :io_sum_wal_normal_before_writes;
(1 row)
SELECT current_setting('fsync') = 'off'
+ OR current_setting('wal_sync_method') IN ('open_sync', 'open_datasync')
OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
?column?
----------
diff --git a/src/test/regress/sql/stats.sql b/src/test/regress/sql/stats.sql
index c223800fd19..232ab8db8fa 100644
--- a/src/test/regress/sql/stats.sql
+++ b/src/test/regress/sql/stats.sql
@@ -672,6 +672,7 @@ SELECT sum(writes) AS writes, sum(fsyncs) AS fsyncs
SELECT current_setting('synchronous_commit') = 'on';
SELECT :io_sum_wal_normal_after_writes > :io_sum_wal_normal_before_writes;
SELECT current_setting('fsync') = 'off'
+ OR current_setting('wal_sync_method') IN ('open_sync', 'open_datasync')
OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
-- Change the tablespace so that the table is rewritten directly, then SELECT