*: add tidb_enable_noop_functions to default disable get_lock()/release_lock()#10987
*: add tidb_enable_noop_functions to default disable get_lock()/release_lock()#10987cfzjywxk merged 7 commits intopingcap:masterfrom
Conversation
|
/run-all-tests |
|
please follow the contributing guide to refactor the PR title: https://github.com/pingcap/community/blob/master/commit-message-pr-style.md |
Codecov Report
@@ Coverage Diff @@
## master #10987 +/- ##
================================================
- Coverage 81.6366% 81.1225% -0.5141%
================================================
Files 420 420
Lines 91726 89472 -2254
================================================
- Hits 74882 72582 -2300
- Misses 11563 11636 +73
+ Partials 5281 5254 -27 |
|
@zz-jason PTAL |
|
@cfzjywxk I think a better behavior instead of "function not found" would be to suggest the user can change the setting to have syntax-only support. With the current behavior I don't believe many users will discover that such a setting exists (see #10065 for an example error). I also prefer a name like cc @pingcap/usability-team |
|
I don't like |
+1 for this name |
|
@morgo PTAL |
|
LGTM |
|
/run-all-tests |
|
/run-all-tests |
…release_lock functions
|
/run-all-tests |
1 similar comment
|
/run-all-tests |
|
/run-all-tests |
| time.Sleep(time.Second) | ||
| c.Assert(failpoint.Disable("github.com/pingcap/tidb/store/tikv/panicInFailPendingRequests"), IsNil) | ||
| c.Assert(failpoint.Disable("github.com/pingcap/tidb/store/tikv/gotErrorInRecvLoop"), IsNil) | ||
| time.Sleep(time.Second) |
There was a problem hiding this comment.
@zz-jason new case "client_fail_test" not stable may fail running "make test", like:
FAIL: client_fail_test.go:34: testClientSuite.TestPanicInRecvLoop
client_fail_test.go:59:
c.Assert(err, IsNil)
... value *errors.fundamental = injected error in batchRecvLoop ("injected error in batchRecvLoop")
|
/run-all-tests |
What problem does this PR solve?
Fixes #10929
This adds the variable
tidb_enable_noop_functionsto control usage of NOOP funcs in tidb such as get_lock, release_lock (always return 1), since the current behavior could be dangerous for apps relying on these functions working correctly.The default for
tidb_enable_noop_functionsisfalse, thus users must manually set session/global totrueto have unsafe behavior.What is changed and how it works?
add global/session variable "tidb_enable_noop_functions" to control usage of noop functions,
default these usage will report "function xxx has only noop implementation in tidb now, use tidb_enable_noop_functions to enable these functions"". while set true, these functions can be
used like before
Check List
Tests
Code changes
Side effects
applications using former version of tidbs have to set "tidb_enable_noop_functions" to true to meet their needs
Related changes