-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
asim: add zone config satisfiability check #110968
base: master
Are you sure you want to change the base?
Conversation
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
Please only review the last two commits. The first commit is from #110967. |
19e3e9e
to
086b773
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
086b773
to
81801f8
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
81801f8
to
e0401dc
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
e0401dc
to
129b919
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
129b919
to
3bb1ece
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
3bb1ece
to
e371177
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
e371177
to
1bcb99b
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
1bcb99b
to
cc18873
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
cc18873
to
5cd6735
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
5cd6735
to
6336704
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
I was unable to automatically find a reviewer. You can try CCing one of the following members:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
6336704
to
30ce904
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
I expect that the second commit will require a few iterations of review. Let me know if you would like me to pull the first commit into its own PR to get the trivial part in first |
28a99fc
to
6d71d49
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
6d71d49
to
b985879
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
b985879
to
1486ffa
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
1486ffa
to
1910e7d
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
1910e7d
to
fb4ee49
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
fb4ee49
to
b91baf8
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
b91baf8
to
10a5973
Compare
Thank you for updating your pull request. Before a member of our team reviews your PR, I have some potential action items for you:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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'm still reviewing the config_validator.go
changes. Flushing some comments.
Reviewed 5 of 5 files at r1, 9 of 14 files at r2, 3 of 4 files at r3, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @wenyihu6)
pkg/kv/kvserver/asim/validator/config_validator.go
line 156 at r3 (raw file):
// Otherwise, it returns error (not `nil`). func (m *mockAllocator) processConstraintsHelper( constraintsConjunction []roachpb.ConstraintsConjunction,
nit: naming this constraintConjunctions
would be clearer, because this is a bag of conjunctions.
pkg/kv/kvserver/asim/validator/config_validator.go
line 384 at r3 (raw file):
// non-voters are then assigned as needed. If any zones or regions lack // available nodes for assignment, the constraint is considered as // unsatisfiable.
This is a great high level summary of the algorithm. Could you expand this further, and explain why this algorithm will work given the limitations (assumptions)?
IIUC the algorithm works because of the structure of region-zone hierarchy. Where there intersection of any two region-region or zone-zone combos is empty, and node's only have a region and zone locality.
Could you think of an example where this wouldn't work, if we allow for intersecting constraint conjunctions? No need to solve this here, but it would be good to write out.
pkg/kv/kvserver/asim/validator/validator_test.go
line 172 at r3 (raw file):
description: "insufficient replicas for region constraint", constraint: "num_replicas=28 num_voters=28 " + "constraints={'+region=US_East':17,'+region=US_West':2,'+region=EU':10}",
nit: wouldn't this also fail due to sum(constraints) not matching the num_replicas (28 vs 29)? It might help to reduce EU:9
to make the test case focus on just US_East
having a constrained num_replicas greater than the stores in number of stores in US_East
.
pkg/kv/kvserver/asim/validator/validator_test.go
line 233 at r3 (raw file):
}, } for _, tc := range testCases {
Nice tests!
Previously, kvoli (Austen) wrote…
I'm not sure if I'm understanding this correctly. Could you give me an example on what non-empty region-region combo means and when node has more than one region or zone locality? My understanding was that regions or zones are non-overlapping. And each node have unique region and zone locality. And clusterInfo.Regions would specify regions, zones, and nodes under it. |
Previously, wenyihu6 (Wenyi Hu) wrote…
or do you mean there exists duplicate constraints for the same region value (something like constraints={'+region=US_East':1,'+region=US_East':2})? I will address the comments once I've finished procrastinating and https://en.wikipedia.org/wiki/BoJack_Horseman |
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @wenyihu6)
pkg/kv/kvserver/asim/validator/config_validator.go
line 384 at r3 (raw file):
Previously, wenyihu6 (Wenyi Hu) wrote…
or do you mean there exists duplicate constraints for the same region value (something like constraints={'+region=US_East':1,'+region=US_East':2})?
Using attributes, which constraints can match on, it is possible, and something we support (begrudgingly at this stage).
e.g. locality=region=a,zone=a1 attributes=disk
This patch corrects a typo where "US_East_3" was duplicated. It corrects it to "US_East_4". Release Note: none Epic: none
Now that we have added the option to generate random span configurations in cockroachdb#110967, we want to have a way to check whether these configurations are satisfiable with the cluster setting. This patch adds the validation check. Please note that the validation process can be expensive with a time complexity of O(max(node count in the cluster, number of replica constraints, number of voter constraints)). To perform this validation and see which span config could lead to failure, please use following command: ``` "eval" [verbose=validate] ``` See also: cockroachdb#110967 Part of: cockroachdb#106192 Release Note: none Epic: none
Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
asim: correct a typo in ComplexConfig
This patch corrects a typo where "US_East_3" was duplicated. It corrects it to
"US_East_4".
Release Note: none
Epic: none
asim: add zone config satisfiability check
Now that we have added the option to generate random span configurations in
#110967, we want to have a way to check whether these configurations are
satisfiable with the cluster setting.
This patch adds the validation check. Please note that the validation process can
be expensive with a time complexity of O(max(node count in the cluster, number of
replica constraints, number of voter constraints)). To perform this validation
and see which span config could lead to failure, please use following command:
See also: #110967
Part of: #106192
Release Note: none
Epic: none