Re: Checkpoint not retrying failed fsync?
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-05T23:36:39Z
Lists: pgsql-hackers
Attachments
- draft.patch (application/octet-stream) patch
On Fri, Apr 6, 2018 at 11:34 AM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote: >>>>>> "Thomas" == Thomas Munro <thomas.munro@enterprisedb.com> writes: > > >> As far as I can tell from reading the code, if a checkpoint fails the > >> checkpointer is supposed to keep all the outstanding fsync requests for > >> next time. Am I wrong, or is there some failure in the logic to do this? > > Thomas> Yikes. I think this is suspicious: > > Yes, tracing through a checkpoint shows that this is clearly wrong. > > Thomas> Why is it OK to unlink the bitmapset? We still need its > Thomas> contents, in the case that the fsync fails! > > Right. > > But I don't think just copying the value is sufficient; if a new bit was > set while we were processing the old ones, how would we know which to > clear? We couldn't just clear all the bits afterwards because then we > might lose a request. Agreed. The attached draft patch handles that correctly, I think. -- Thomas Munro http://www.enterprisedb.com
Commits
-
Don't forget about failed fsync() requests.
- 1556cb2fc5c7 12.0 landed
- 2b2010d12a62 9.4.21 landed
- a4a4aede5fab 9.5.16 landed
- a4d6d6a25c12 9.6.12 landed
- 28117764db7e 10.7 landed
- 542e6f3861ce 11.2 landed