Andrew Wong has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/8465


Change subject: KUDU-2202 avoid block ID reuse for missing dirs
......................................................................

KUDU-2202 avoid block ID reuse for missing dirs

The block manager is initially only aware of the blocks it reads when
first loading the FS layout. If the opening of a directory fails (e.g.
due to a disk failure), the server can still start up, but it may not
know about some blocks, and may end up assigning them to a new tablet.
If the blocks ID is used by two tablets, we can get into situations
where deleting one will delete data for the other.

To prevent this, a new API has been added to the block managers to grant
external components the ability to notify the block manager of block
IDs. The largest block ID is kept track of when opening and reading a
tablet's metadata. Once all rowsets and orphaned blocks have been seen,
the block manager is notified of the highest block ID in the tablet's
superblock.

This patch only targets the LBM, which assigns blocks sequentially,
and therefore only needs to know about the largest block ID referenced
by tablets.

An integration test is added to ts_recovery-itest to ensure block ID
reuse does not happen.

Change-Id: I06f10e95278dafdedcab432a7d4d1dc5c59bf4cc
---
M src/kudu/fs/block_id.h
M src/kudu/fs/block_manager.h
M src/kudu/fs/file_block_manager.cc
M src/kudu/fs/file_block_manager.h
M src/kudu/fs/log_block_manager.cc
M src/kudu/fs/log_block_manager.h
M src/kudu/integration-tests/ts_recovery-itest.cc
M src/kudu/tablet/metadata-test.cc
M src/kudu/tablet/rowset_metadata.cc
M src/kudu/tablet/rowset_metadata.h
M src/kudu/tablet/tablet_metadata.cc
11 files changed, 210 insertions(+), 58 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/65/8465/1
--
To view, visit http://gerrit.cloudera.org:8080/8465
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I06f10e95278dafdedcab432a7d4d1dc5c59bf4cc
Gerrit-Change-Number: 8465
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <aw...@cloudera.com>

Reply via email to