Hello David Ribeiro Alves, Todd Lipcon,

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


to review the following change.

Change subject: master: only use tablet reports to notify master of altered 

master: only use tablet reports to notify master of altered tablets

One or more alter table operations are not considered finished until the
master is sure that all altered tablets have the newest schema version.
Today the master is notified of these schema version changes via tablet
report or via response to the AlterSchema() RPC, whichever comes first.
Notification via AlterSchema() RPC response, however, is unsafe in a world
with a single leader election lock, because taking the lock in an RPC
response can lead to deadlocks.

To avoid this, let's use tablet reports as the sole notification channel.
The completion of an AlterSchema() transaction now marks the tablet as
dirty; otherwise, there's no knowing exactly when the master would see the
altered tablet in a tablet report.

This notification change does not perfectly preserve existing semantics. For
example, if AlterSchema() had returned TABLET_NOT_FOUND, the old code would
make a "fake" call to CatalogManager::HandleTabletSchemaVersionReport() with
the new schema version, potentially unblocking clients who are waiting on
the alter table operation to complete. The new code can't do this; if tablet
reports are the only notification mechanism, a tablet that isn't found will
never report in. This can lead to client timeouts, though I'm unsure as to
whether this is a bad thing or not.

There are no new tests, but without the AlterSchema() change, many existing
tests failed with timeouts in client-issued alter table operations.

Change-Id: I09ff1560d0bd5cecefb08684ecf5c2c992d69d46
M src/kudu/master/catalog_manager.cc
M src/kudu/tablet/tablet_peer.h
M src/kudu/tablet/transactions/alter_schema_transaction.cc
3 files changed, 13 insertions(+), 7 deletions(-)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I09ff1560d0bd5cecefb08684ecf5c2c992d69d46
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: David Ribeiro Alves <dral...@apache.org>
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>

Reply via email to