-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
util: record more information before OOM #37987
Merged
ti-chi-bot
merged 40 commits into
pingcap:master
from
mengxin9014:mx/recordMoreInformationBeforeOOM
Oct 12, 2022
Merged
Changes from 34 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
a9bf1e0
record more information before OOM
mengxin9014 0d135f5
change variable name
mengxin9014 4a8330d
modify tests
mengxin9014 6342b71
modify tests
mengxin9014 c707455
auto update viriable
mengxin9014 c997191
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 13d7fe5
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 4da2738
refactor memory usage alarm
mengxin9014 d750a08
Merge branch 'mx/recordMoreInformationBeforeOOM' of github.com:mengxi…
mengxin9014 5284722
add tests
mengxin9014 4895b06
fmt
mengxin9014 526e1bc
fmt
mengxin9014 76bf701
add license header
mengxin9014 de38768
fmt
mengxin9014 e390229
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
hawkingrei d0cf8ca
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 e5d46f8
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 5fc5865
Merge branch 'mx/recordMoreInformationBeforeOOM' of github.com:mengxi…
mengxin9014 64afd47
fmt
mengxin9014 0f64465
modify according comments
mengxin9014 012e99e
modify according comments
mengxin9014 6ebe722
fmt
mengxin9014 5928f68
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 e98b261
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 22d7f9f
change interval time
mengxin9014 7d0260a
Merge branch 'mx/recordMoreInformationBeforeOOM' of github.com:mengxi…
mengxin9014 aaa77a8
modify according comments
mengxin9014 62427a0
deprecate instance tidb memory use ratio
mengxin9014 92f9d10
modify according comments
mengxin9014 a2ebbb3
modify according comments
mengxin9014 2c09f15
change struct name
mengxin9014 78e5cfd
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 98fa4f3
add tests
mengxin9014 2d6d81c
Merge branch 'mx/recordMoreInformationBeforeOOM' of github.com:mengxi…
mengxin9014 491ab76
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 dc32dc6
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 fdc6d37
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
mengxin9014 3d34222
fix tests
mengxin9014 2618c09
Merge branch 'mx/recordMoreInformationBeforeOOM' of github.com:mengxi…
mengxin9014 3141a1e
Merge branch 'master' into mx/recordMoreInformationBeforeOOM
ti-chi-bot File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2039,13 +2039,21 @@ func TestMemoryUsageAlarmVariable(t *testing.T) { | |
tk.MustExec("set @@global.tidb_memory_usage_alarm_ratio=1.1") | ||
tk.MustQuery("SHOW WARNINGS").Check(testkit.Rows("Warning 1292 Truncated incorrect tidb_memory_usage_alarm_ratio value: '1.1'")) | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_ratio").Check(testkit.Rows("1")) | ||
|
||
tk.MustExec("set @@global.tidb_memory_usage_alarm_ratio=-1") | ||
tk.MustQuery("SHOW WARNINGS").Check(testkit.Rows("Warning 1292 Truncated incorrect tidb_memory_usage_alarm_ratio value: '-1'")) | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_ratio").Check(testkit.Rows("0")) | ||
|
||
tk.MustExec("set @@session.tidb_memory_usage_alarm_ratio=0.8") | ||
tk.MustQuery(`show warnings`).Check(testkit.Rows(fmt.Sprintf("Warning %d modifying tidb_memory_usage_alarm_ratio will require SET GLOBAL in a future version of TiDB", errno.ErrInstanceScope))) | ||
require.Error(t, tk.ExecToErr("set @@session.tidb_memory_usage_alarm_ratio=0.8")) | ||
|
||
tk.MustExec("set @@global.tidb_memory_usage_alarm_keep_record_num=1") | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_keep_record_num").Check(testkit.Rows("1")) | ||
tk.MustExec("set @@global.tidb_memory_usage_alarm_keep_record_num=100") | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_keep_record_num").Check(testkit.Rows("100")) | ||
tk.MustExec("set @@global.tidb_memory_usage_alarm_keep_record_num=0") | ||
tk.MustQuery("SHOW WARNINGS").Check(testkit.Rows("Warning 1292 Truncated incorrect tidb_memory_usage_alarm_keep_record_num value: '0'")) | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_keep_record_num").Check(testkit.Rows("1")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a test for the MAXVALUE There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
done. |
||
tk.MustExec("set @@global.tidb_memory_usage_alarm_keep_record_num=10001") | ||
tk.MustQuery("SHOW WARNINGS").Check(testkit.Rows("Warning 1292 Truncated incorrect tidb_memory_usage_alarm_keep_record_num value: '10001'")) | ||
tk.MustQuery("select @@global.tidb_memory_usage_alarm_keep_record_num").Check(testkit.Rows("10000")) | ||
} | ||
|
||
func TestSelectLockInShare(t *testing.T) { | ||
|
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
Oops, something went wrong.
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.
remove this block