-- Minimal repro: v3/v4 ROLLBACK of N FILEOPS operations costs ~N x (fsync of -- the file + fsync of its parent directory), applied inline before ROLLBACK -- returns (fileops_sync_inverse() after every inverse). Same with crash-loser -- undo before the cluster opens. Run with psql against a v4 build: -- CREATE EXTENSION test_fileops; then \i this file, once with fsync=on and -- once after ALTER SYSTEM SET fsync=off; SELECT pg_reload_conf(); -- Measured (NVMe, btrfs), N=1000: v2 1.9 ms | v4 (no cassert) 638 ms with -- fsync=on, 1.4 ms with fsync=off. SELECT test_fileops_create_tempfile('fsync_repro.dat') AS f \gset BEGIN; SELECT count(test_fileops_chmod(:'f', 384 + (g % 2) * 36)) FROM generate_series(1, 1000) g; \timing on ROLLBACK; \timing off