-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
infoschema: add affected_rows to the processlist table #54488
infoschema: add affected_rows to the processlist table #54488
Conversation
Hi @ekexium. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
5311adf
to
d98e730
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #54488 +/- ##
=================================================
- Coverage 72.8476% 57.4427% -15.4049%
=================================================
Files 1542 1682 +140
Lines 436136 629851 +193715
=================================================
+ Hits 317715 361804 +44089
- Misses 98837 244656 +145819
- Partials 19584 23391 +3807
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2772c86
to
43286ac
Compare
Signed-off-by: ekexium <[email protected]>
43286ac
to
52b509b
Compare
pkg/infoschema/tables.go
Outdated
@@ -854,6 +854,7 @@ var tableProcesslistCols = []columnInfo{ | |||
{name: "TxnStart", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "RESOURCE_GROUP", tp: mysql.TypeVarchar, size: resourcegroup.MaxGroupNameLength, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "SESSION_ALIAS", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "AFFECTED_ROWS", tp: mysql.TypeLonglong, size: 21, flag: mysql.UnsignedFlag}, |
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.
Is there compatibility risks for tools like dashboard?
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 suppose they should not depend on the number of the columns...
@lcwangchao have you met any compatibility problems when adding SESSION_ALIAS?
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 think it's fine. The added row is in the last position. @bb7133 Could you take a look?
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 believe it is fine for compatibility. However, my concern is about the semantics when it is called 'affected rows': all columns in PROCESSLIST
are the 'current status' but AFFECTED_ROWS
means the affected rows by the last statement, which could be confusing.
For example, after executing INSERT INTO ..
, we have:
ID: 2097158
USER: root
HOST: 127.0.0.1:50816
DB: test
COMMAND: Sleep
TIME: 16
STATE: autocommit
INFO: NULL
DIGEST: 04fa858fa491c62d194faec2ab427261cc7998b3f1ccf8f6844febca504cb5e9
MEM: 4096
DISK: 0
TxnStart:
RESOURCE_GROUP: default
SESSION_ALIAS:
AFFECTED_ROWS: 2
2 rows in set (0.01 sec)
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.
How about displaying 0
when INFO
is null or len(INFO) == 0
?
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'm not sure, to be honest. Maybe we could also consider renaming it 'AFFECTED_ROWS_LAST_STATEMENT'?
What is the expected result of this column for pipelined DMLs?
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.
It's introduced to reveal the current progress of the statement during its execution, as a pipelined DML may run for a long time. So 'AFFECTED_ROWS_LAST_STATEMENT' is not a good idea I suppose.
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.
Or just rename it "CURRENT_AFFECTED_ROWS" to distinguish them and make it clear.
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.
Sounds good
pkg/infoschema/tables.go
Outdated
@@ -854,6 +854,7 @@ var tableProcesslistCols = []columnInfo{ | |||
{name: "TxnStart", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "RESOURCE_GROUP", tp: mysql.TypeVarchar, size: resourcegroup.MaxGroupNameLength, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "SESSION_ALIAS", tp: mysql.TypeVarchar, size: 64, flag: mysql.NotNullFlag, deflt: ""}, | |||
{name: "AFFECTED_ROWS", tp: mysql.TypeLonglong, size: 21, flag: mysql.UnsignedFlag}, |
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 think it's fine. The added row is in the last position. @bb7133 Could you take a look?
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
4f535ba
to
c093336
Compare
/retest |
@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, tangenta The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ekexium: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/retest |
@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
What problem does this PR solve?
Issue Number: close #54486
Problem Summary:
We need a straightforward way to know the progress of long-running statements.
What changed and how does it work?
Add a column
affected_rows
toinformation_schema.processlist
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.