Hello Dan Burkert, Todd Lipcon,

I'd like you to do a code review.  Please visit

    http://gerrit.cloudera.org:8080/7950

to review the following change.

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
---
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
2 files changed, 99 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/50/7950/1
-- 
To view, visit http://gerrit.cloudera.org:8080/7950
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8c1f48c0febad038833edd555ee88f1db83249d
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to