stats.sql fails during installcheck on mac - Mailing list pgsql-hackers

From Sami Imseih
Subject stats.sql fails during installcheck on mac
Date
Msg-id CAA5RZ0uxwg3xAi4nvdBMJ-zJQEeyg+RotuU+ebM2F6CKmnvaYA@mail.gmail.com
Whole thread Raw
Responses Re: stats.sql fails during installcheck on mac
Re: stats.sql fails during installcheck on mac
List pgsql-hackers
Hi,

When running "make installcheck" on my mac, I ran into a failure:

"""
@@ -1459,7 +1459,7 @@
  OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
 ?column?
 ----------
- t
+ f
 (1 row)

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

which occurs when regress/sql/stats.sql is checking for # of fsync
calls for wal writesto disk.
This test was added in a051e71e28a1

"""
SELECT current_setting('fsync') = 'off'
OR :io_sum_wal_normal_after_fsyncs > :io_sum_wal_normal_before_fsyncs;
"""

However, because on mac, the default wal_sync_method is open_datasync,
there is no fsync() or similar call being issued when wal is synced to disk.

I think we should modify the test to only check for the failing stat only if
wal_sync_method = fdatasync|fsync|fsync_writethrough
and the io object is 'wal'.
See attached patch with a simple fix to this test.

"make check" does not fail because it runs with fsync = off [1]

Also, The documentation for pg_stat_wal already makes this point clear
in [0] that "wal_sync is only
incremented when the wal_sync_method is either fdatasync, fsync or
fsync_writethrough".

Perhaps, the same clarification will be beneficial for the
pg_stat_io.fsyncs* fields?

[0] https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-WAL-VIEW
[1] https://github.com/postgres/postgres/blob/master/src/test/regress/pg_regress.c#L2485

--
Sami Imseih
Amazon Web Services (AWS)

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reduce "Var IS [NOT] NULL" quals during constant folding
Next
From: Ranier Vilela
Date:
Subject: Re: Non-text mode for pg_dumpall