[cherry-pick]Add workload metric query_be_memory #35911
Merged
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.
Proposed changes
pick #35662
mysql [information_schema]>select * from workload_policy;
+-------+------------------+------------------------------------+--------------+----------+---------+---------+----------------+
| ID | NAME | CONDITION | ACTION | PRIORITY | ENABLED | VERSION | WORKLOAD_GROUP |
+-------+------------------+------------------------------------+--------------+----------+---------+---------+----------------+
| 11020 | cancel_query_mem | query_be_memory_bytes >= 524288000 | cancel_query | 0 | 0 | 1 | |
+-------+------------------+------------------------------------+--------------+----------+---------+---------+----------------+
1 row in set (0.01 sec)
{
"TxnId": 2,
"Label": "hits",
"Comment": "",
"TwoPhaseCommit": "false",
"Status": "Fail",
"Message": "[INTERNAL_ERROR]cancelled: query 1e483ee97b04d9ec-5bdd0aa1b40ab799 cancelled by workload policy: cancel_query_mem, id:11020",
"NumberTotalRows": 463296,
"NumberLoadedRows": 463296,
"NumberFilteredRows": 0,
"NumberUnselectedRows": 0,
"LoadBytes": 398295040,
"LoadTimeMs": 130281,
"BeginTxnTimeMs": 16,
"StreamLoadPutTimeMs": 190,
"ReadDataTimeMs": 3349,
"WriteDataTimeMs": 3480,
"CommitAndPublishTimeMs": 0
}
I20240605 15:13:37.930701 3512264 query_context.cpp:122] Query 1e483ee97b04d9ec-5bdd0aa1b40ab799 deconstructed, , deregister query/load memory tracker, queryId=1e483ee97b04d9ec-5bdd0aa1b40ab799, Limit=2.00 GB, CurrUsed=460.71 MB, PeakUsed=551.86 MB