File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -63,9 +63,17 @@ func shouldBypass(req *tikvrpc.Request) bool {
6363 // Check both coprocessor request type and the request source to ensure the request is an internal analyze request.
6464 // Internal analyze request may consume a lot of resources, bypass it to avoid affecting the user experience.
6565 // This bypass currently only works with NextGen.
66- if config .NextGen && (req .BatchCop ().GetTp () == reqTypeAnalyze || req .Cop ().GetTp () == reqTypeAnalyze ) &&
67- strings .Contains (requestSource , util .InternalTxnStats ) {
68- return true
66+ if config .NextGen && strings .Contains (requestSource , util .InternalTxnStats ) {
67+ var tp int64
68+ switch req .Type {
69+ case tikvrpc .CmdBatchCop :
70+ tp = req .BatchCop ().GetTp ()
71+ case tikvrpc .CmdCop , tikvrpc .CmdCopStream :
72+ tp = req .Cop ().GetTp ()
73+ }
74+ if tp == reqTypeAnalyze {
75+ return true
76+ }
6977 }
7078 // Some internal requests should be bypassed, which may affect the user experience.
7179 // For example, the `alter user password` request completely bypasses resource control.
You can’t perform that action at this time.
0 commit comments