Adar Dembo has submitted this change and it was merged. Change subject: log block manager: mark container as read-only after syncing error ......................................................................
log block manager: mark container as read-only after syncing error Currently, container in-memory accounting is updated only after metadata gets successfully fsync()ed. However, it is not safe to do so, because the on-disk state may already contain partial or complete data/metadata at this point. For instance, suppose that SyncData() fails during Close() of block A. Even though Close() itself will fail, it's possible that block A's metadata was successfully written out to disk. Some Kudu operations (e.g. merge compaction) will not crash during a block error like this one, and if block A's container is reused when writing block B, block A's metadata may erroneously point at block B. This patch marks container as read-only if there is error during syncing data and metadata while Close()/FlushDataAsync() a block, to avoid further writes. It also adjusts existing fault injection test to ensure test failure without the fix. Change-Id: I15062b9d82c9cb563fb6bb2af7ec89da5f71e28f Reviewed-on: http://gerrit.cloudera.org:8080/7374 Reviewed-by: Adar Dembo <[email protected]> Tested-by: Kudu Jenkins --- M src/kudu/fs/block_manager-test.cc M src/kudu/fs/log_block_manager.cc M src/kudu/fs/log_block_manager.h 3 files changed, 122 insertions(+), 48 deletions(-) Approvals: Adar Dembo: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/7374 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: I15062b9d82c9cb563fb6bb2af7ec89da5f71e28f Gerrit-PatchSet: 22 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Hao Hao <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot
