[tablet, queryrules] Extend query rules to check comments#7784
Merged
rafael merged 9 commits intovitessio:masterfrom Apr 19, 2021
Merged
[tablet, queryrules] Extend query rules to check comments#7784rafael merged 9 commits intovitessio:masterfrom
rafael merged 9 commits intovitessio:masterfrom
Conversation
372425e to
54898e7
Compare
added 9 commits
April 15, 2021 00:56
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
…o work as expected Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Fix bug in how we attach RE to the rule in rulesctl Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Signed-off-by: Richard Bailey <rbailey@slack-corp.com>
Member
|
From our discussions, going to merge this to our branch and start playing with it in our environment. |
rafael
approved these changes
Apr 19, 2021
This was referenced Apr 19, 2021
8 tasks
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 makes three changes
fsnotifyto watch for changes vs the rules filerulesctlDetails: Watching the file
We use fsnotify which seems to be the generally accepted approach. There are some gymnastics necessary as watching the specific file is prone to losing track of it in the event that the file is deleted+recreated. To handle this case we watch the directory containing the file and react only when the node we receive events for matches the file we are watching.
Details: Filtering on MarginComments
This was mostly plumbing within the
Ruleitself + the application callstack as thetabletserver/query_executor::QueryExecutorhas already baked margin comments into it during the initial phase of the Execute call.Evaluation is similar to but not the same as the Query regexp because that is stable across query shapes (otherwise it wouldn't be the same query). For margin comments we need to defer evaluation until after the plan cache which is why Query & comments take different paths.
Test failures
The only listed failure is
endtoend/tabletmanager/tablegcwhich seems unlikely to be related afaict.Related Issue(s)
n/a
Checklist
Deployment Notes
No changes necessary for existing deployments.
Impacted Areas in Vitess
Components that this PR will affect: