Andrew Wong has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/12462


Change subject: wip: KUDU-2690: don't roll log schema on failed alter
......................................................................

wip: KUDU-2690: don't roll log schema on failed alter

wip: I'm not convinced this is the only pathway that this race can
surface, given how contrived the sleeps I added are.

It is possible to update the log segment header schema version based on
an AlterSchema operation that failed. This is because an alter operation
that didn't succeed (e.g. because of a schema version mismatch) is
treated as a successful _transaction_ (similar to how we treat a
duplicated insert transaction as a successful transaction). This can
lead to a mismatch of schemas between the log segment headers and the
write ops in those log segments, and can lead to a failure to bootstrap.

wip: I considered persisting the result in the CommitMsg per KUDU-860,
but opted not to since it doesn't seem necessary; if everything is
working properly, we should get the same result upon attempting to apply
an alter (and then we would proceed to do nothing if the operation
didn't succeed.

A test is added that, without the fix for KUDU-2690, would crash 95% of
the time.

Change-Id: Id761851741297e29a4666bec0c34fc4f7285f715
---
M src/kudu/consensus/log.cc
M src/kudu/integration-tests/alter_table-test.cc
M src/kudu/master/catalog_manager.h
M src/kudu/mini-cluster/internal_mini_cluster.cc
M src/kudu/mini-cluster/internal_mini_cluster.h
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet_bootstrap.cc
M src/kudu/tablet/transactions/alter_schema_transaction.cc
M src/kudu/tablet/transactions/alter_schema_transaction.h
M src/kudu/tablet/transactions/transaction_driver.cc
10 files changed, 241 insertions(+), 10 deletions(-)



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

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id761851741297e29a4666bec0c34fc4f7285f715
Gerrit-Change-Number: 12462
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <[email protected]>

Reply via email to