fixes #3284 updates tablet locs using conditional mutations #3317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updates tablet locations using conditional mutations. Two supporting changes were made and one bug was fixes while making this change.
The first supporting change was streamlining handling of conditional mutations with a result of UNKNOWN. An UNKNOWN result on a conditional mutation occurs when the RPC for the conditional mutation has an error. In this case the conditional mutation may or may not have gone through. The tablet must be read to know what happened. This update adds support for automatically reading the tablet and checking it via a lambda. This makes it easy to write code for handling the unknown case.
The second supporting change was combining code that was mostly the same in ZooTabletStateStore and MetaDataStateStore by making both extend AbstractStateStore and use common code. This change allowed the updates to use conditional mutations to be made in one place instead of two.
The bug was with the new conditional writer code, it only supported writing tablets of the same table. The code was changed to only require that tablets be on the same datalevel. This change allowed ITs that create multiple tables to run.
Some places in the code that set locations were not changed to use conditional mutations. Comments were placed in the code for these.