-
Notifications
You must be signed in to change notification settings - Fork 490
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
*: try to support lock/unlock tables function #305
Conversation
798dc77
to
0f49074
Compare
Please explain what is |
model/model.go
Outdated
} | ||
|
||
// DBTableID is composed by schema ID and table ID. | ||
type DBTableID struct { |
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.
Looks that this is not used anymore, right?
model/model.go
Outdated
|
||
const ( | ||
TableLockNone TableLockType = iota | ||
// TableLockRead means the session with this lock has read permission, other session can't read/write until the lock is released. |
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.
IMHO we need to add more detailed explanations. For example, if the locks are exclusive, or can be shared.
Although the behavior of LOCKS
will be explained in our official document, detailed comments are still useful here for the developers.
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.
I've checked the implementations, this comment is wrong(other session can't read/write ...
), please fix it.
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.
Sorry for my mistakes, PTAL again.
We should also add |
Co-Authored-By: bb7133 <bb7133@gmail.com>
Co-Authored-By: bb7133 <bb7133@gmail.com>
Co-Authored-By: bb7133 <bb7133@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #305 +/- ##
==========================================
- Coverage 53.09% 52.94% -0.16%
==========================================
Files 31 31
Lines 6575 6575
==========================================
- Hits 3491 3481 -10
- Misses 2742 2755 +13
+ Partials 342 339 -3
Continue to review full report at Codecov.
|
Co-Authored-By: bb7133 <bb7133@gmail.com>
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
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?
Help to support lock/unlock tables function in TiDB.
There are 4 table lock types:
READ
,READ LOCAL
,WRITE
,WRITE LOCAL
.Attention:
WRITE LOCAL
is add in TiDB to support TiFlash usage. Mysql doesn't haveWRITE LOCAL
.The
WRITE LOCAL
means the session with this lock has write/read permission, and the other session is still has read permission.READ LOCAL
is not supported in TiDB, only support the syntax currently. Because of we think is it useless.What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes