Andrew Wong has uploaded a new change for review. http://gerrit.cloudera.org:8080/6706
Change subject: KUDU-1952 Don't use round-robin for block placement ...................................................................... KUDU-1952 Don't use round-robin for block placement This is the first of a multi-patch patchset to mitigate the single-disk failure. Throughout the code, the term "DataDir" refers to a data directory, which is often mounted on a distinct disk. Thus, "disks" and "data directories" will be used interchangeably. This patch adds a mapping from tablet to a set of disks and uses it to replace the existing round-robin placement of blocks. Tablets are mapped to a fixed number of disks (i.e. a DataDirGroup). New blocks are placed randomly in directories within each tablet's DataDirGroup. Tablet-to-group mappings are generated and stored as metadata upon tablet creation, or upon tablet replacement during a tablet copy. During group creation, disks are added to groups by randomly selecting two available directories and selecting the one with fewer tablets on it. This avoids pigeonholing new tablets to disks with relatively few tablets, while still trending towards filling underloaded disks. Groups are maintained when restarting the server, as they are flushed with metadata, and are deleted upon tablet deletion. When loading tablet data from a previous version of Kudu, the tablet's superblock will not have a DataDirGroup. One will be generated containing all data directories, as the tablet's data may already be spread across any number of disks. As this patch only addresses block placement, it does not itself mitigate single-disk failure. Given this, and given the tradeoff between I/O and failure disk-failure tolerance, the default behavior will be to spread tablet data across all disks. A design doc can be found here: https://docs.google.com/document/d/1zZk-vb_ETKUuePcZ9ZqoSK2oPvAAaEV1sjDXes8Pxgk/edit?usp=sharing Change-Id: I9828147f4fa5c4d7f6ed23441dca5a116b8cb11b Use DataDirGroupPB and add locks Change-Id: Ifaf50772cfa71c3ee5f61db9c2a4ae85b0d6e2b2 No longer output DataDirGroup Favor Create call and then Get calls. Still TODO: handle upgrade case Change-Id: I4d42d1444c60450ced2450b4ae9c0a51a3a30ef2 Add use_all_dirs flag to CreateDataDirGroup Add a flag to CreateDataDirGroup to use all dirs in cases where old tablet data is being bootstrapped. Since we can't tell which dirs the old tablets are striped across, we must assume the data spans all tablets. Change-Id: Ibdaa2c53ef2c596e6d473a663c5c3d3e5593875b Avoid unnecessary CreateBlockOption plumbing Replace CreateBlockOption with tablet_id string where possible. Change-Id: I3ede0ea2b0299fda097baf79d93eeac36c2e0765 --- M src/kudu/fs/block_manager-stress-test.cc M src/kudu/fs/block_manager-test.cc M src/kudu/fs/block_manager.h A src/kudu/fs/data_dir_group.h M src/kudu/fs/data_dirs.cc M src/kudu/fs/data_dirs.h M src/kudu/fs/file_block_manager.cc M src/kudu/fs/file_block_manager.h M src/kudu/fs/fs.proto M src/kudu/fs/fs_manager.cc M src/kudu/fs/fs_manager.h M src/kudu/fs/log_block_manager-test.cc M src/kudu/fs/log_block_manager.cc M src/kudu/fs/log_block_manager.h M src/kudu/tablet/delta_compaction.cc M src/kudu/tablet/delta_compaction.h M src/kudu/tablet/delta_tracker.cc M src/kudu/tablet/diskrowset.cc M src/kudu/tablet/metadata.proto M src/kudu/tablet/multi_column_writer.cc M src/kudu/tablet/multi_column_writer.h M src/kudu/tablet/tablet_bootstrap-test.cc M src/kudu/tablet/tablet_metadata.cc M src/kudu/tablet/tablet_metadata.h M src/kudu/tserver/tablet_copy_client-test.cc M src/kudu/tserver/tablet_copy_client.cc M src/kudu/tserver/tablet_copy_client.h M src/kudu/tserver/ts_tablet_manager.cc M src/kudu/tserver/ts_tablet_manager.h 29 files changed, 702 insertions(+), 161 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/06/6706/1 -- To view, visit http://gerrit.cloudera.org:8080/6706 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ede0ea2b0299fda097baf79d93eeac36c2e0765 Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Andrew Wong <aw...@cloudera.com>