-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supply RangeDescriptor to Split/Merge/Change Funcs
For #2152 This commit modifies AdminSplit, AdminMerge and ChangeReplicas to accept a RangeDescriptor object. The RangeDescriptor is used as a form of optimistic locking. All of these operations will ultimately modify the RangeDescriptor in some way; to ensure that no other concurrent operations modify the RangeDescriptor, a copy of the original RangeDescriptor is captured before the modified RangeDescriptor is computed. The original RangeDescriptor is passed to a ConditionalPut as the first operation in the transaction, causing it to fail if concurrent modifications have already committed. However, capturing the original RangeDescriptor inside of the Split/Merge/Change methods is insufficient. In most cases, the decision to call Split/Merge/Change is made by another method based on the RangeDescriptor, and the decision may have been different if a concurrent change is applied first. Therefore, the original RangeDescriptor needs to be captured before calling Split/Merge/Change. This commit modifies all three methods to use the new pattern, with a required RangeDescriptor being passed to the method. Note that the behavior of Split and Merge is still not optimal, because the call to AdminSplit or AdminMerge is always routed through Raft. This pattern is unnecessary in cases where the split/merge decision is computed on the server.
- Loading branch information
Matt Tracy
committed
Aug 26, 2015
1 parent
4458654
commit 9ffbd1a
Showing
7 changed files
with
102 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters