-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
SQL: show local node processlist #15455
Conversation
Thanks for taking #10317 over. However, the points raised in there still hold: the current code is subject to a race condition, when queries to the new The proper approach, suggested earlier by Andrei, is to make a copy of the useful Session fields after each statement or each transaction, and only read from that copy in the code that populates the virtual table. The copy would be protected by a mutex. |
@knz , You mean we should lock the field of session when we use them to create table |
Locking the fields used in The proper approach is to copy all the fields in |
@knz , you mean like this? when we create table
|
@knz, Oh, I see. You mean when we begin execute a statement in the session, we should make a copy of the field of this session, and then when we create table So we should add a |
Yes, that is the basic idea. However there is some additional complexity because there may be multiple statements executing in parallel in the session. |
@knz, hou could |
@knz, I just add the statement when we execute the statement in |
@knz, could you help me a review. Thank you very much. |
Dear songhao, we have implemented this feature already in a different way, using the new statements |
@knz, This PR was used to
show local node processlist
, see #7003. And I just refer to you PR #10317.