-
Notifications
You must be signed in to change notification settings - Fork 5.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
*: Support SHOW PLACEMENT
for placement policies
#27531
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
SHOW PLACEMENT
for placement policiesSHOW PLACEMENT
for placement policies
…to show_policy_placement
SHOW PLACEMENT
for placement policiesSHOW PLACEMENT
for placement policies
/run-check_dev_2 |
/run-check_dev_2 |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
/run-check_dev_2 |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
infoschema/infoschema.go
Outdated
@@ -406,6 +408,13 @@ func (is *infoSchema) SetBundle(bundle *placement.Bundle) { | |||
is.ruleBundleMap[bundle.ID] = bundle | |||
} | |||
|
|||
func (is *infoSchema) AllPlacementPolicies() (policies []*placementpolicy.PolicyInfo) { | |||
for _, p := range is.policyMap { |
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.
policyMutex
?
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.
After reading the current code, I found AllPlacementPolicies
is not needed any more because PlacementPolicies
did the same work. I'll remove this method and add PlacementPolicies
to the interface.
But I think it is still safe without policyMutex
because infoschema is immutable. The happens-before condition can be established for our current implement
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.
It is just there in case, IMO. You are right that sometimes we are too cautious to do some great works. But this case is a little bit aggressive for me, especially that other policy
APIs are following the conract of the mutex.
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.
OK. Actually I did not see policyMutex
and just follow what the function AllSchemas
did. As other policy APIs use policyMutex
I think we should follow it either.
…to show_policy_placement
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 2d23b1d
|
What problem does this PR solve?
Issue Number: see #26582
Support SHOW PLACEMENT for placement policies
What is changed and how it works?
PlacementSettings
for reuseSHOW PLACEMENT
for placement policiesCheck List
Tests
Release note