Content-Length: 266374 | pFad | http://github.com/postgrespro/postgres/commit/488f826c729bd570c36df369fa8ac90c9a5a1b46

C6 bufmgr: Return early in ScheduleBufferTagForWriteback() if fsync=off · postgrespro/postgres@488f826 · GitHub
Skip to content

Commit 488f826

Browse files
committed
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 <hlinnaka@iki.fi> Reviewed-by: Noah Misch <noah@leadboat.com> Discussion: https://postgr.es/m/1f6b50a7-38ef-4d87-8246-786d39f46ab9@iki.fi
1 parent c01fd93 commit 488f826

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5899,7 +5899,12 @@ ScheduleBufferTagForWriteback(WritebackContext *wb_context, IOContext io_context
58995899
{
59005900
PendingWriteback *pending;
59015901

5902-
if (io_direct_flags & IO_DIRECT_DATA)
5902+
/*
5903+
* As pg_flush_data() doesn't do anything with fsync disabled, there's no
5904+
* point in tracking in that case.
5905+
*/
5906+
if (io_direct_flags & IO_DIRECT_DATA ||
5907+
!enableFsync)
59035908
return;
59045909

59055910
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/488f826c729bd570c36df369fa8ac90c9a5a1b46

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy