HomePhabricator

Merge #13039: Add logging and error handling for file syncing

Description

Merge #13039: Add logging and error handling for file syncing

Summary:
PR13039 backport https://github.com/bitcoin/bitcoin/pull/13039/files
cf02779 Add logging and error handling for file syncing (Wladimir J. van der Laan)

Pull request description:

Add logging and error handling inside, and outside of FileCommit.
Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption.
(c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/)

EINVAL is handled specially to avoid crashing out on (network, fuse) filesystems that don't handle `f[data]sync`.

I checked that the syncing inside leveldb is already generating an I/O error as appropriate.

Depends on D3582

Test Plan: make check

Reviewers: deadalnix, Fabien, jasonbcox, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D3583

Details

Provenance
Wladimir J. van der Laan <laanwj@gmail.com>Authored on Apr 23 2018, 12:29
Mark Lundeberg <36528214+markblundeberg@users.noreply.github.com>Committed on Jul 9 2019, 18:50
markblundebergPushed on Jul 9 2019, 18:54
Reviewer
Restricted Project
Differential Revision
D3583: Merge #13039: Add logging and error handling for file syncing
Parents
rSTAGING2ef4a66327a3: Optimize PNG images
Branches
Unknown
Tags
Unknown
References
tag: phabricator/base/10149