pendingOps table is not cleared with fsync=off

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-05-08T21:21:18Z
Lists: pgsql-hackers

Attachments

Hi!

I noticed that commit 3eb77eba5a changed the logic in 
ProcessSyncRequests() (formerly mdsync()) so that if you have fsync=off, 
the entries are not removed from the pendingOps hash table. I don't 
think that was intended.

I propose the attached patch to move the test for enableFsync so that 
the entries are removed from pendingOps again. It looks larger than it 
really is because it re-indents the block of code that is now inside the 
"if (enableFsync)" condition.

- Heikki

Commits

  1. Move check for fsync=off so that pendingOps still gets cleared.

  2. Refactor the fsync queue for wider use.