log: change slow log time format to compatible with pt-query-digest #10290
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.
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