-
Notifications
You must be signed in to change notification settings - Fork 88
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
feat: add support for Row Affinity app profiles #2341
Merged
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b18d5ca
Create of methods, add unit tests
djyau e3be203
Add unit tests for BigtableInstanceAdminClientTests
djyau 8019c29
Add tests for Create and Update App Profile
djyau d10c5cf
Add integration test
djyau 047b046
Rename ofWithRowAffinity to withRowAffinity
djyau 464d1bb
Merge branch 'main' of sso://cloud-bigtable-internal/java-bigtable in…
djyau 4f197d4
Run mvn com.coveo:fmt-maven-plugin:format
djyau c6f6a78
Remove extra test for cluster IDs - one is enough
djyau fecd6ea
Add unit test for row affinity with set of strings
djyau 7ba35f8
Run formatter
djyau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
I think withRowAffinity is a bit less akward
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.
Also can you describe what the difference between this variant and withRowAffinity(String... clusterIds)
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.
Also is it possible to update an app profile to change cluster ids? or to change the routing away from row affinity?
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.
Also do you need to update the mask?
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.
Yes - Row affinity, when enabled, routes single row key requests deterministically to the same cluster each time to improve read-your-writes consistency.
When row affinity is enabled with a cluster group (with cluster IDs specified), then when the user adds a new cluster to their instance, it does not affect which clusters each row key routes to. It is a way to protect read-your-writes consistency from being impacted negatively from new clusters as well as from attempts to delete clusters (since you cannot delete a cluster if its in the cluster group). Without the cluster group, when a user adds a new cluster, row keys will undergo a shuffling of which cluster they route to, which temporarily breaks read-your-writes consistency.
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.
I don't think so, but correct me if I am wrong: row affinity is a subfield/submessage of MultiClusterRoutingUseAny (routing policy), and we already have existing methods for updating the routing policy with the appropriate mask: https://github.com/googleapis/java-bigtable/blob/main/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/models/UpdateAppProfileRequest.java#L106-L125
It should be possible to do both of these. The user should call UpdateAppProfileRequest::SetRoutingPolicy and supply a routing policy with new cluster ids or with row affinity absent