Hao Hao has posted comments on this change. ( http://gerrit.cloudera.org:8080/8162 )
Change subject: KUDU-2055 [part 5]: Coalesce hole punch for LBM ...................................................................... Patch Set 7: (12 comments) http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager-test.cc File src/kudu/fs/log_block_manager-test.cc: http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager-test.cc@284 PS6, Line 284: NO_FATALS(CheckLogMetrics(entity, > Since you're already updating all of this, please switch to the shorter NO_ Done http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager-test.cc@382 PS6, Line 382: {1, &METRIC_block_manager_total_blocks_deleted} })); > This might be flaky; the hole punch can happen as soon as deletion_transact Hmm, misunderstood your previous suggestions. Updated. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager-test.cc@427 PS6, Line 427: {11, &METRIC_block_manager_total_blocks_deleted} })); > This could be flaky, see above. Done http://gerrit.cloudera.org:8080/#/c/8162/5/src/kudu/fs/log_block_manager.cc File src/kudu/fs/log_block_manager.cc: http://gerrit.cloudera.org:8080/#/c/8162/5/src/kudu/fs/log_block_manager.cc@1435 PS5, Line 1435: DCHECK(state_ == CLEAN || state_ == DIRTY) > My working theory is that much of the complexity of this patch is because w I see, I remember the reasons we leave DoCloseBlocks() and DeleteBlock() instead of do noting here are: 1) Abort() can happen in a normal phrase of tserver and current hole repunching cannot clean these gaps. 2) we are going to implement a fine grained abort handling as documented above in future. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc File src/kudu/fs/log_block_manager.cc: http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@1151 PS6, Line 1151: } > Only if PunchHole actually succeeded though, right? Right, updated. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@1249 PS6, Line 1249: container->ToString())); > I think CHECK_OK() is more appropriate if failure means some sort of bug on Done http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@1269 PS6, Line 1269: if (!s.ok()) { > Can this be taken care of by RemoveLogBlocks() too? Right, RegisterDeletion/AddBlock need to be made available for Repair(). And I separate RecordDeletion out from RemoveLogBlocks for the reason I mentioned below. Let me know if it makes sense to you. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@2063 PS6, Line 2063: } else { > std::move(lb) here. Done http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@2079 PS6, Line 2079: if (container->read_only()) { > Make this a cref rather than a copy so you don't need to ref the LogBlock. Done http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@2112 PS6, Line 2112: BlockId block_id = lb->block_id(); > Any particular reason this isn't part of RemoveLogBlocks? Seems like there' I think the main reason is I want to hold the LBM's lock as short as possible. Maybe that is not a big concern? If so, I can move it into RemoveLogBlocks. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/fs/log_block_manager.cc@2594 PS6, Line 2594: b->RegisterDeletion(transaction); : transaction->AddBlock(b); > What's this for? 'transaction' is already behind a shared_ptr. I read here that you need to call shard_from_this() to return a new std::shared_ptr<T> that shares ownership (http://en.cppreference.com/w/cpp/memory/enable_shared_from_this). But after thinking more, this line is redundant, shared_ptr's copy assignment is good enough. Will remove. Not calling NewDeletionTransaction here because it needs a cast from BlockDeletionTransaction to LogBlockDeletionTransaction later when call RegisterDeletion. http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/util/metrics.h File src/kudu/util/metrics.h: http://gerrit.cloudera.org:8080/#/c/8162/6/src/kudu/util/metrics.h@384 PS6, Line 384: kHoles, > See the comment on L361; you need to update Name() too. Done -- To view, visit http://gerrit.cloudera.org:8080/8162 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I7ccc9538b8184f8f7ba8f6118713b82fef433275 Gerrit-Change-Number: 8162 Gerrit-PatchSet: 7 Gerrit-Owner: Hao Hao <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Comment-Date: Tue, 17 Oct 2017 23:15:31 +0000 Gerrit-HasComments: Yes
