Adar Dembo has submitted this change and it was merged. Change subject: catalog_manager: improve IsAlterInProgress performance ......................................................................
catalog_manager: improve IsAlterInProgress performance To mentally prepare for KUDU-1807, I decided to also tackle the O(n) behavior of IsAlterInProgress. It's not nearly as bad as IsCreateInProgress (since we aren't taking cow locks on each tablet) but is still not great since IsAlterInProgress is called repeatedly by clients. The solution involves a new map in TableInfo to track the schema versions of all tablets. Keeping the map up-to-date requires additional work when adding/removing tablets and when tablet reports include a schema change, but these are infrequent operations relative to IsAlterInProgress so I figured the trade off is worth it. I'm not particularly happy about the lock acquisition in set_reported_schema_version() but couldn't see a good way to avoid it. I looped 1000 runs of alter_table-randomized-test. The ~5 failures I saw were due to KUDU-1539, which I don't think this patch makes us any more or less vulnerable to. Change-Id: Id8c1f48c0febad038833edd555ee88f1db83249d Reviewed-on: http://gerrit.cloudera.org:8080/7950 Reviewed-by: Dan Burkert <[email protected]> Tested-by: Kudu Jenkins Reviewed-by: Todd Lipcon <[email protected]> --- M src/kudu/master/catalog_manager.cc M src/kudu/master/catalog_manager.h 2 files changed, 105 insertions(+), 22 deletions(-) Approvals: Dan Burkert: Looks good to me, approved Todd Lipcon: Looks good to me, approved Kudu Jenkins: Verified -- To view, visit http://gerrit.cloudera.org:8080/7950 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8c1f48c0febad038833edd555ee88f1db83249d Gerrit-PatchSet: 4 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Todd Lipcon <[email protected]>
