3 ms·
> Cool, our hypothesis has been validated. This should be easy to fix: if we sync the log when we open it, we should guarantee that no unsynced reads are ever s
by ryanworl 5y ago
> Cool, our hypothesis has been validated. This should be easy to fix: if we sync the log when we open it, we should guarantee that no unsynced reads are ever served:
I'm not sure this is accurate in general. If fsync fails (either before or after the crash), the dirty pages will be marked as clean, but may never make it to disk. I think the only solution to this problem that is reasonably portable is to use direct IO.
EDIT:
The author pointed out this line to me on Twitter:
> but for today, let’s keep things simple and assume syncing is a reliable process.
I'll leave my comment for others to read, but yes if fsync is deemed reliable that solution seems OK.