[DRAFT] tablet picker refactor#12094
Closed
pbibra wants to merge 7 commits into
Closed
Conversation
Signed-off-by: Priya Bibra <pbibra@slack-corp.com>
Contributor
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
pbibra
commented
Jan 19, 2023
| // All provided tablet types are given equal priority. This is the default. | ||
| TabletPickerTabletOrder_Any TabletPickerTabletOrder = "Any" | ||
| // Provided tablet types are expected to be prioritized in the given order. | ||
| TabletPickerTabletOrder_InOrder TabletPickerTabletOrder = "InOrder" |
Contributor
Author
There was a problem hiding this comment.
change these to iota
pbibra
commented
Jan 19, 2023
| ts *topo.Server, | ||
| cells []string, | ||
| localCell, keyspace, shard, tabletTypesStr string, | ||
| options *TabletPickerOptions, |
Signed-off-by: 'Priya Bibra' <pbibra@slack-corp.com>
Signed-off-by: 'Priya Bibra' <pbibra@slack-corp.com>
Signed-off-by: Priya Bibra <pbibra@slack-corp.com>
Contributor
Author
|
closing in favor of: #12282 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR adds options to the
TabletPickerthat allow for selecting cell preference in addition to changing default behavior to give priority to the local cell and any alias it belongs to. We are also introducing a new way to select tablet order which should eventually replace thein_order:hint currently includedtabletTypesStr.The following changes are made to the
NewTabletPickerfunction signature (i.e. theTabletPicker's instantiation):before:
after:
Where
ctx,localCell,optionare all new parameters.optionis of typeTabletPickerOptionsand includes two fields,CellPrefandTabletOrder.CellPref-> "PreferLocalWithAlias" (default) or "OnlySpecified"TabletOrder-> "Any" (default) or "InOrder"The above are defined as enum strings.
The following illustrates the behavior with different option combinations. Assume the following setup:
localCell = us-east-1aalias = region1 -> {us-east-1a, us-east-1b, us-east-1c}`cells = {us-west-1a, us-west-1b}
tablets:
When "PreferLocalWithAlias" is selected,
localCellmust be non-empty:tabletTypeStr), theTabletPickerwill first pick tablets in thelocalCelland subsequently pick tablets in any alias the local cell belongs to. Finally, it will pick tablets belonging tocellsif any additional ones are specified. The tablet type in this scenario does not matter since "Any" was selected.tabletTypeStr = REPLICA,PRIMARYtablet priority possibility:
tabletTypeStr), theTabletPickerwill first pick tablets in thelocalCellthat also respect the tablet type ordering and subsequently pick tablets in any alias the local cell belongs to with the tablet type order. Finally, it will pick tablets belonging tocellsif any additional ones are specified. The tablet type in this scenario is respected within each grouping of tablets (i.e. local cell, alias, all others)tabletTypeStr = in_order:REPLICA,PRIMARYtablet priority possibility:
When "OnlySpecified" is selected as the cell preference:
tabletTypeStr), theTabletPickerwill only pick tablets belonging to cells specified in thecellsparameter. It will ignore tablet type ordering in this case.tabletTypeStr = REPLICA,PRIMARYtablet priority possibility:
tabletTypeStr), theTabletPickerwill only pick tablets belonging to cells specified in thecellsparameter, but will respect the tablet type ordering.tabletTypeStr = in_order:REPLICA,PRIMARYtablet priority possibility:
Related Issue(s)
#11999
Checklist
Deployment Notes