mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-04-12 20:40:47 +08:00
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 <samimseih@gmail.com> Discussion: https://postgr.es/m/CAA5RZ0uxwg3xAi4nvdBMJ-zJQEeyg+RotuU+ebM2F6CKmnvaYA@mail.gmail.com
This commit is contained in:
parent
847bbb21f8
commit
fdb69dd582
@ -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?
|
||||
----------
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user