-
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
infoschema/slow_query: fix token too long #10328
Merged
crazycs520
merged 18 commits into
pingcap:master
from
crazycs520:fix-slow-log-token-too-long
May 9, 2019
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1664104
infoschema/slow_query: fix token too long
crazycs520 c9f0daf
fix ci
crazycs520 13919dc
use reader.ReadLine
crazycs520 c68b4da
use MaxOfMaxAllowedPacket to check single line limit
crazycs520 b4e610e
Merge branch 'master' of https://github.com/pingcap/tidb into fix-slo…
crazycs520 775be13
refine code
crazycs520 be791f4
fix bug
crazycs520 c0a67fa
fix ci
crazycs520 214a046
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 690d5dc
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 b5e905f
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 b6a6b6b
refine code
crazycs520 0f827ba
remove useless code
crazycs520 3481e69
Merge branch 'master' into fix-slow-log-token-too-long
eurekaka 7b0528f
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 b44fafd
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 ef8efe7
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 077daf3
Merge branch 'master' into fix-slow-log-token-too-long
crazycs520 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Can we use
bufio.Reader.ReadLine
to completely avoid this error?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.
We can use ReadLine to implement a new scanner
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.
Great idea. Other question, should we add a max-single-line-length-limit? If user executes a long query.
At first, I think if we don't limit the max-single-line-length, then parse slow log may consume a lot of memory and then may make TiDB-server killed by the system.
But after careful consideration, I think no need to add max-single-line-length, the first reason is we have log rotate, the other reason is executing the long query may make tidb-server killed in executing. 😂 What do you think? @eurekaka @winkyao
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.
https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_allowed_packet should limit the input query size?
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.
done. PTAL @eurekaka @winkyao