-
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
domain: record runaway and quarantine query #44654
domain: record runaway and quarantine query #44654
Conversation
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Connor1996 <zbk602423539@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Can we keep the history for now? Users can use |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Is it temporary? otherwise I need to change the doc. |
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.
LGTM
@Connor1996: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest |
IMO, it's not temporary. What do u think? @glorv |
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
/retest-required |
session/bootstrap.go
Outdated
@@ -604,6 +604,31 @@ const ( | |||
KEY (create_time), | |||
KEY (create_user));` | |||
|
|||
// CreateRunawayTable stores the query which is identified as runaway or quarantined because of in watch list. | |||
CreateRunawayTable = `CREATE TABLE IF NOT EXISTS mysql.runaway_queries ( |
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.
CreateRunawayTable = `CREATE TABLE IF NOT EXISTS mysql.runaway_queries ( | |
CreateRunawayTable = `CREATE TABLE IF NOT EXISTS mysql.tidb_runaway_queries ( |
I suggest using tidb_xxx
as the name indicates tidb specific table.
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.
+1.
session/bootstrap.go
Outdated
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;` | ||
|
||
// CreateQuarantineWatchTable stores the condition which is used to check whether query should be quarantined. | ||
CreateQuarantineWatchTable = `CREATE TABLE IF NOT EXISTS mysql.quarantined_watch ( |
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 about tidb_runaway_quarantined_watch
As each quarantined query has a TLL, I think that means they should be GCed over time. We may treat them as logs, gc them after a period of time, e.g. after 30 days or so. |
/test check-dev2 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Connor1996, glorv, nolouch, qw4990 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #43691
Problem Summary:
What is changed and how it works?
Persist the runaway query records in KV data by the admin table
Once identified or watched quarantined are recorded in mysql.RUNAWAY_QUERIES. mysql.QUARANTINED_WATCH only active watch are kept
Check List
Tests
Unit test
Integration test
Manual test (add detailed scripts or steps below)
![image](https://private-user-images.githubusercontent.com/23399268/246379937-f4ac51b7-a250-4ec5-90a7-38a88d11ed5e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NDQ1ODMsIm5iZiI6MTczODg0NDI4MywicGF0aCI6Ii8yMzM5OTI2OC8yNDYzNzk5MzctZjRhYzUxYjctYTI1MC00ZWM1LTkwYTctMzhhODhkMTFlZDVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDEyMTgwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM5MjM0MzYyMjI0NjBhN2Y1ZDRiYTEyM2M2MmJlZGQxN2U5MTUwMjA4MGFlZmM3ZThkMjM2YzMyYjVhMWVhZGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.a8wyn9ltNLiLkD_rAaOlZ3bBhxHhurmFy5rbBx3zkZQ)
![image](https://private-user-images.githubusercontent.com/23399268/246381251-34d75086-6218-4523-ba99-3fc4cb205976.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NDQ1ODMsIm5iZiI6MTczODg0NDI4MywicGF0aCI6Ii8yMzM5OTI2OC8yNDYzODEyNTEtMzRkNzUwODYtNjIxOC00NTIzLWJhOTktM2ZjNGNiMjA1OTc2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA2VDEyMTgwM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyNGZhYTVhOTUwZjI2N2RlNjlkNTM4NDJjNDFkNjQxYjQ0N2JjOWY5MjZjYmQyMDBkOWYxYjdlM2EyOGEwOTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Y7q5E7oSQSE_9xS7XtPhv7boHfjiDfH-hBMIeqEN6dM)
No code
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.