diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 4852044300..b8680cc8fd 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -5899,7 +5899,12 @@ ScheduleBufferTagForWriteback(WritebackContext *wb_context, IOContext io_context { PendingWriteback *pending; - if (io_direct_flags & IO_DIRECT_DATA) + /* + * As pg_flush_data() doesn't do anything with fsync disabled, there's no + * point in tracking in that case. + */ + if (io_direct_flags & IO_DIRECT_DATA || + !enableFsync) return; /*