Hello Tidy Bot, Kudu Jenkins, Adar Dembo, Todd Lipcon,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/12462
to look at the new patch set (#5).
Change subject: KUDU-2690: don't roll log schema on failed alter
......................................................................
KUDU-2690: don't roll log schema on failed alter
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), and can thus
mistakenly lead to updating the log segment schema version, even on
failure. This can lead to a mismatch of schemas between the log segment
headers and the write ops in those log segments, which can lead to a
failure to bootstrap.
This patch addresses this by:
1. making the tablet no-op if it sees that an alter didn't go through,
2. storing the error in the commit message, so further bootstraps will
skip over the op (this is KUDU-860).
Only the former is necessary to prevent the issue, and though the latter
use extra space, it may be helpful for added visibility and debugging.
This patch adds a unit test that reproduced the scenario at the
TabletReplica level. A more end-to-end test that arrives at the reported
state by working around master-level table locking can be found here[1].
[1] https://gist.github.com/andrwng/3a049bb038680cc0254c5ba52b9a7507
Change-Id: Id761851741297e29a4666bec0c34fc4f7285f715
---
M src/kudu/consensus/log.cc
M src/kudu/tablet/tablet.cc
M src/kudu/tablet/tablet_bootstrap.cc
M src/kudu/tablet/tablet_replica-test.cc
M src/kudu/tablet/transactions/alter_schema_transaction.cc
M src/kudu/tablet/transactions/alter_schema_transaction.h
6 files changed, 238 insertions(+), 79 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/62/12462/5
--
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: newpatchset
Gerrit-Change-Id: Id761851741297e29a4666bec0c34fc4f7285f715
Gerrit-Change-Number: 12462
Gerrit-PatchSet: 5
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Reviewer: Todd Lipcon <[email protected]>