Alexey Serbin has posted comments on this change.

Change subject: Create ConsensusMetadataManager
......................................................................


Patch Set 17:

(9 comments)

some nits.

http://gerrit.cloudera.org:8080/#/c/7191/17/src/kudu/consensus/consensus_meta.cc
File src/kudu/consensus/consensus_meta.cc:

PS17, Line 73: Status ConsensusMetadata::DeleteOnDiskData(FsManager* 
fs_manager, const string& tablet_id) {
             :   string cmeta_path = 
fs_manager->GetConsensusMetadataPath(tablet_id);
             :   
RETURN_NOT_OK_PREPEND(fs_manager->env()->DeleteFile(cmeta_path),
             :                         Substitute("Unable to delete consensus 
metadata file for tablet $0",
             :                                    tablet_id));
             :   return Status::OK();
             : }
style nit: consider re-ordering the methods to match their declaration order in 
the .h file (feel free to ignore if it's not a common practice right now).


http://gerrit.cloudera.org:8080/#/c/7191/17/src/kudu/consensus/consensus_meta_manager-stress-test.cc
File src/kudu/consensus/consensus_meta_manager-stress-test.cc:

PS17, Line 95: TEST_F(ConsensusMetadataManagerStressTest, 
CreateLoadDeleteTSANTest) {
Should it be run only when KUDU_ALLOW_SLOW_TESTS is enabled?  60 seconds seems 
like a long time to run it every time.


PS17, Line 98: kNumOpsPerThread = 1000
Did you try to run it under ASAN configuration with --stress-cpu-threads=8?  It 
would be nice to check that it's not about to timeout in that case.


PS17, Line 141: scoped_refptr<ConsensusMetadata> cmeta;
nit: is it possible to make this private for the 'kLoad' case scope only?


PS17, Line 163: break;
Is it intentional that the previous state is not stored in the prev_states in 
thise case?  If so, could you please add a comment explaining why?


PS17, Line 187: ops_performed.load(std::memory_order_relaxed)
I think it's possible to use just 'ops_performed' here.


http://gerrit.cloudera.org:8080/#/c/7191/17/src/kudu/consensus/consensus_meta_manager-test.cc
File src/kudu/consensus/consensus_meta_manager-test.cc:

PS17, Line 43: virtual
nit: consider dropping 'virtual' since override is 'present'.


PS17, Line 104: Status s = cmeta_manager_->Create(kTabletId, config_, 
kInitialTerm, &cmeta);
Is it worth adding a check that it's not possible to create a meta with 
different initial term?


http://gerrit.cloudera.org:8080/#/c/7191/17/src/kudu/consensus/consensus_meta_manager.cc
File src/kudu/consensus/consensus_meta_manager.cc:

PS17, Line 50:  DCHECK(cmeta_out);
nit: this a little bit not symmetric -- Create() allows to pass null pointer 
for cmeta_out.  Maybe, allow passing nullptr  for cmeta_out in this case as 
well?  That could get rid of some extra lines in the tests as well.


-- 
To view, visit http://gerrit.cloudera.org:8080/7191
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia30c05dd0feec2b7530205f4d17dfc079a1c3451
Gerrit-PatchSet: 17
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Mike Percy <mpe...@apache.org>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <davidral...@gmail.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Mike Percy <mpe...@apache.org>
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-HasComments: Yes

Reply via email to