-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
log: change slow log time format to compatible with pt-query-digest #10290
log: change slow log time format to compatible with pt-query-digest #10290
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10290 +/- ##
================================================
- Coverage 77.8256% 77.8178% -0.0078%
================================================
Files 410 410
Lines 84715 84577 -138
================================================
- Hits 65930 65816 -114
+ Misses 13856 13845 -11
+ Partials 4929 4916 -13 |
Codecov Report
@@ Coverage Diff @@
## master #10290 +/- ##
================================================
- Coverage 77.6699% 77.6648% -0.0051%
================================================
Files 411 411
Lines 85441 85435 -6
================================================
- Hits 66362 66353 -9
- Misses 14117 14121 +4
+ Partials 4962 4961 -1 |
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
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
/run-all-tests |
@crazycs520 Please cherry-pick this to the release-2.1. |
What problem does this PR solve?
Exec below
pt-query-digest
with--since
command will got error in old tidb slow log. Because of the slow log time format is not compatible with pt-query-digest.pt-query-digest --type slowlog --output report --limit=100% --since "2019-04-28 15:26:06" tidb-slow.log
I try to find the MySQL slow log time format, But i got nothing in MySQL document or in google about the slow log time format. Then I check the MySQL slow log file, and find the most likely time format is
RFC3339Nano
, but not exactly the same.Then I try to use
RFC3339Nano
time format, Thenpt-query-digest
with--since
param will execute successfully. Then I choseRFC3339Nano
format as the new slow log format.What is changed and how it works?
Change slow log time format from "2006-01-02-15:04:05.999999999 -0700" to
RFC3339Nano
("2006-01-02T15:04:05.999999999Z07:00"
).And for
Slow_query
parse slow_log compatibility, I still keep the old time format. Because if user was upgrade from old version, then there maybe 2 different time format in the same slow log file.Check List
Tests
Code changes
Side effects
Related changes