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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyspace: patrol keyspace assignment before the first split #6388
keyspace: patrol keyspace assignment before the first split #6388
Changes from all commits
142e649
f3777c3
0e634d9
552d26f
29d48fd
e9b9ec1
fdbe9d0
7e18fcc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to check if ks.config map already contains the 'group' entry, i.e., already assigned keyspace group? If yes, then skip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many existing keyspaces could we have? If we have too many keyspaces, it could take some time, as for every keyspace, we call saveKeyspaceGroups once. . If this is the case, can we just assign all keyspaces to the keyspace groups first, then call saveKeyspaceGroups just once to flush all 'dirty' keyspace groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could fall into the situation that a keyspace being assigned to multiple keyspace groups.
SaveKeypsaceGroups transaction could fail and return here, which leaves none or some of keyspaces being assigned with keyspace groups. Because patrolKeyspaceAssignmentOnce is still false, next split will trigger patrolKeyspaceAssignment again. For those keyspaces which have been assigned groups in the last round, because we don't persistent group assignment in keyspace meta and don't check if it's already assigned, we could pick a different keyspace group and assign this keyspace to it, which results in this keyspace being assigned to multiple groups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually every tso restart then becoming leader could cause a keyspace being assigned to multiple keyspace groups.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we update keyspace meta (add 'group' entry in the config field) and persistent its group assignment? Do we need to do it? There are two side effects if we don't persistent this info: