bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off
authorAndres Freund
Tue, 8 Oct 2024 15:37:45 +0000 (11:37 -0400)
committerAndres Freund
Tue, 8 Oct 2024 15:37:45 +0000 (11:37 -0400)
commit488f826c729bd570c36df369fa8ac90c9a5a1b46
tree6e8ee0e4ac43568b77875364ecf98dab982963fe
parentc01fd93088da36f2473a6b1bad3fce3e04c685a1
bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off

As pg_flush_data() doesn't do anything with fsync disabled, there's no point
in tracking the buffer for writeback. Arguably the better fix would be to
change pg_flush_data() to flush data even with fsync off, but that's a
behavioral change, whereas this is just a small optimization.

Reviewed-by: Heikki Linnakangas
Reviewed-by: Noah Misch
Discussion: https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi
src/backend/storage/buffer/bufmgr.c