Adar Dembo has submitted this change and it was merged.

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
Tested-by: Kudu Jenkins
Reviewed-by: Todd Lipcon <>
M src/kudu/master/
M src/kudu/tablet/tablet_peer.h
M src/kudu/tablet/transactions/
3 files changed, 13 insertions(+), 7 deletions(-)

  Todd Lipcon: Looks good to me, approved
  Kudu Jenkins: Verified

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: I09ff1560d0bd5cecefb08684ecf5c2c992d69d46
Gerrit-PatchSet: 3
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <>
Gerrit-Reviewer: Adar Dembo <>
Gerrit-Reviewer: David Ribeiro Alves <>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to