-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: add tidb_enable_noop_functions to default disable get_lock()/release_lock() #10987
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 |
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.
LGTM
/run-all-tests |
/run-all-tests |
…release_lock functions
/run-all-tests |
1 similar comment
/run-all-tests |
/run-all-tests |
@@ -50,6 +50,7 @@ func (s *testClientSuite) TestPanicInRecvLoop(c *C) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why adding a sleep
?
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.
@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")
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.
TiDB 3.0 may also have this problem. /cc @hicqu
/run-all-tests |
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.
LGTM
What problem does this PR solve?
Fixes #10929
This adds the variable
tidb_enable_noop_functions
to 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_functions
isfalse
, thus users must manually set session/global totrue
to 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