Skip to content
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

executor, infoschema, util: add sum_errors and sum_warnings to statement summary tables (#16456) #16502

Merged
merged 3 commits into from
Apr 17, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Apr 17, 2020

cherry-pick #16456 to release-4.0


What problem does this PR solve?

Problem Summary:
Add sum_errors and sum_warnings to statements_summary.
These 2 fields indicate the total errors and warnings encountered for each kind of SQL.

What is changed and how it works?

What's Changed:
ONLY summarize runtime errors now. It's a big move to also consider compiler errors, so it's not suitable for 4.0.
MySQL: Statements that has parser errors are not summarized in statement summary tables.
TiDB: Statements that has parser errors or compiler errors are not summarized.

How it Works:
Error: check whether it succeeded.
Warning: get StmtCtx.WarningCount().

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test

Side effects

N/A

Release note

  • Add two fields sum_errors and sum_warnings to statement summary tables.

@sre-bot sre-bot requested a review from a team as a code owner April 17, 2020 02:32
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 17, 2020

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@zimulala zimulala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zimulala zimulala added the status/can-merge Indicates a PR has been approved by a committer. label Apr 17, 2020
@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 17, 2020

/run-all-tests

@sre-bot
Copy link
Contributor Author

sre-bot commented Apr 17, 2020

@sre-bot merge failed.

@djshow832
Copy link
Contributor

/rebuild

1 similar comment
@djshow832
Copy link
Contributor

/rebuild

@djshow832
Copy link
Contributor

/run-all-tests

@bb7133
Copy link
Member

bb7133 commented Apr 17, 2020

Failed CI:

[2020-04-17T10:05:41.429Z] --- FAIL: TestInfo (2.75s)
[2020-04-17T10:05:41.429Z]     leaktest.go:143: Test TestInfo check-count 50 appears to have leaked: github.com/pingcap/tidb/domain.(*Domain).loadSchemaInLoop(0xc001718c60, 0x2faf080)
[2020-04-17T10:05:41.429Z]          /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:494 +0x269                                                                      [2020-04-17T10:05:41.429Z]         created by github.com/pingcap/tidb/domain.(*Domain).Init
[2020-04-17T10:05:41.429Z]          /home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/src/github.com/pingcap/tidb/domain/domain.go:721 +0x5d8
[2020-04-17T10:05:41.429Z] FAIL

https://internal.pingcap.net/idc-jenkins/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/32912/pipeline/85

@bb7133
Copy link
Member

bb7133 commented Apr 17, 2020

/run-unit-test

@bb7133
Copy link
Member

bb7133 commented Apr 17, 2020

Failed CI case:

[2020-04-17T10:22:58.545Z] ----------------------------------------------------------------------
[2020-04-17T10:22:58.545Z] FAIL: db_change_test.go:532: testStateChangeSuite.TestWriteOnly
[2020-04-17T10:22:58.545Z]                                                                                                                                                                                            [2020-04-17T10:22:58.545Z] db_change_test.go:538:
[2020-04-17T10:22:58.545Z]     s.runTestInSchemaState(c, model.StateWriteOnly, true, addColumnSQL, sqls, nil)
[2020-04-17T10:22:58.545Z] db_change_test.go:623:
[2020-04-17T10:22:58.545Z]     c.Assert(errors.ErrorStack(checkErr), Equals, "")
[2020-04-17T10:22:58.545Z] ... obtained string = "" +
[2020-04-17T10:22:58.545Z] ...     "[domain:8028]Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`. [try again later]\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/errors.AddStack\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20190809092503-95897b64e011/errors.go:174\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/errors.Trace\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20190809092503-95897b64e011/juju_adaptor.go:15\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/tidb/store/tikv.(*twoPhaseCommitter).checkSchemaValid\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent

https://internal.pingcap.net/idc-jenkins/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/32927/pipeline

1 similar comment
@bb7133
Copy link
Member

bb7133 commented Apr 17, 2020

Failed CI case:

[2020-04-17T10:22:58.545Z] ----------------------------------------------------------------------
[2020-04-17T10:22:58.545Z] FAIL: db_change_test.go:532: testStateChangeSuite.TestWriteOnly
[2020-04-17T10:22:58.545Z]                                                                                                                                                                                            [2020-04-17T10:22:58.545Z] db_change_test.go:538:
[2020-04-17T10:22:58.545Z]     s.runTestInSchemaState(c, model.StateWriteOnly, true, addColumnSQL, sqls, nil)
[2020-04-17T10:22:58.545Z] db_change_test.go:623:
[2020-04-17T10:22:58.545Z]     c.Assert(errors.ErrorStack(checkErr), Equals, "")
[2020-04-17T10:22:58.545Z] ... obtained string = "" +
[2020-04-17T10:22:58.545Z] ...     "[domain:8028]Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`. [try again later]\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/errors.AddStack\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20190809092503-95897b64e011/errors.go:174\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/errors.Trace\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent/workspace/tidb_ghpr_unit_test/go/pkg/mod/github.com/pingcap/errors@v0.11.5-0.20190809092503-95897b64e011/juju_adaptor.go:15\n" +
[2020-04-17T10:22:58.545Z] ...     "github.com/pingcap/tidb/store/tikv.(*twoPhaseCommitter).checkSchemaValid\n" +
[2020-04-17T10:22:58.545Z] ...     "\t/home/jenkins/agent

https://internal.pingcap.net/idc-jenkins/blue/organizations/jenkins/tidb_ghpr_unit_test/detail/tidb_ghpr_unit_test/32927/pipeline

@bb7133
Copy link
Member

bb7133 commented Apr 17, 2020

/run-unit-test

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@qw4990 qw4990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added the status/LGT2 Indicates that a PR has LGTM 2. label Apr 17, 2020
@bb7133 bb7133 merged commit cb208cd into pingcap:release-4.0 Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/infoschema sig/execution SIG execution sig/sql-infra SIG: SQL Infra status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants