Todd Lipcon has posted comments on this change. Change subject: fs: generate report during Open ......................................................................
Patch Set 1: (8 comments) only skimmed through so far since I see David took a look http://gerrit.cloudera.org:8080/#/c/6581/1//COMMIT_MSG Commit Message: Line 7: fs: generate report during Open do you have any measurement of whether this affects startup time on a system with lots of containers? http://gerrit.cloudera.org:8080/#/c/6581/1/src/kudu/fs/fs_report.cc File src/kudu/fs/fs_report.cc: Line 65: it = missing_block_by_tablet_id.equal_range(it->first).second) { Do we ever expect this to be a big map? It seems like this loop might end up being klog(n) instead of k + log(n) since you are calling equal_range for every element that you hit? The nested iterator with the same name as the outer iterator is also pretty confusing. From reading the code I can't quite tell if it's correct. If we expect this to usually be small anyway, maybe it would be simpler to just use a map<string, list<string>> so we can use simpler foreach loops? PS1, Line 68: bool first = true; : for (auto it = range.first; it != range.second; it++) { : if (first) { : first = false; : } else { : block_str += ", "; : } : block_str += it->second; : } if you did the map<string,list<>> above, you could save a bunch of LOC here too and just use a JoinStrings() call Line 78: s += Substitute("Fatal error: tablet $0 missing blocks: [ $1 ]\n", can use SubstituteAndAppend Line 228: s += Substitute("Misaligned block in container $0: $1\n", SubstituteAndAppend PS1, Line 324: if (malformed_record_check && other.malformed_record_check) { : malformed_record_check->MergeFrom(other.malformed_record_check.get()); : } else if (other.malformed_record_check) { : malformed_record_check = other.malformed_record_check; : } hrm, this is very repetitive. you think it's worth doing a templated function or macro? Line 405: LOG(INFO) << ToString(); LOG has the downisde of a maximum 32kb (maybe 64kb?) limit, which I could see being annoying if you get a truncated report http://gerrit.cloudera.org:8080/#/c/6581/1/src/kudu/fs/fs_report.h File src/kudu/fs/fs_report.h: Line 44: Entry(BlockId block_id, std::string tablet_id); if this is just a simple assignment constructor, maybe it's not necessary and you could just use brace-initialization? -- To view, visit http://gerrit.cloudera.org:8080/6581 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcc1d512e2bed103c8d41623a63b4d071532b35e Gerrit-PatchSet: 1 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes