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

session: refine error message desensitization (#19409) #20004

Merged
merged 7 commits into from
Sep 17, 2020

Conversation

ti-srebot
Copy link
Contributor

cherry-pick #19409 to release-4.0


Signed-off-by: crazycs520 crazycs520@gmail.com

What problem does this PR solve?

Close #18566 (comment)

  • Make Duplicate entry error message desensitization.

Below is the test SQL:

create table t (id int auto_increment, b int,  unique index (id));
insert into t values  (1,1),(1,1);
begin;
insert into t values  (1,1);
insert into t values  (1,1);
  • change variable name from tidb_log_desensitization to tidb_redact_log .

related log:

[2020/08/24 20:26:01.567 +08:00] [WARN] [session.go:476] ["can not retry txn"] [conn=1] [label=general] [error="[kv:1062]Duplicate entry '?' for key '?'"] [IsBatchInsert=false] [IsPessimistic=false] [InRestrictedSQL=false] [tidb_retry_limit=10] [tidb_disable_txn_auto_retry=true]
[2020/08/24 20:26:01.567 +08:00] [WARN] [session.go:492] ["commit failed"] [conn=1] ["finished txn"="Txn{state=invalid}"] [error="[kv:1062]Duplicate entry '?' for key '?'"]
[2020/08/24 20:26:01.567 +08:00] [ERROR] [conn.go:744] ["command dispatched failed"] [conn=1] [connInfo="id:1, addr:127.0.0.1:60651 status:10, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:0, autocommit:1"] [sql="insert into t values ( ... )"] [txn_mode=OPTIMISTIC] [err="[kv:1062]Duplicate entry '?' for key '?'"]
[2020/08/24 20:26:01.567 +08:00] [INFO] [2pc.go:717] ["2PC clean up done"] [conn=1] [txnStartTS=418977405093019648]
[2020/08/24 20:26:01.663 +08:00] [ERROR] [conn.go:744] ["command dispatched failed"] [conn=1] [connInfo="id:1, addr:127.0.0.1:60651 status:11, collation:utf8_general_ci, user:root"] [command=Query] [status="inTxn:1, autocommit:1"] [sql="insert into t values ( ... )"] [txn_mode=OPTIMISTIC] [err="[kv:1062]Duplicate entry '?' for key '?'"]

Related changes

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

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Side effects

  • Performance regression
    • Consumes more CPU
    • Consumes more MEM
    • Breaking backward compatibility: change variable name from tidb_log_desensitization to tidb_redact_log .

Release note

  • Refine error message desensitization.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@SunRunAway
Copy link
Contributor

@crazycs520 Please resolve the conflicts

Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Signed-off-by: crazycs520 <crazycs520@gmail.com>
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 17, 2020
Copy link
Contributor

@SunRunAway SunRunAway left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 17, 2020
@SunRunAway
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 17, 2020
@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit c8cdbc3 into pingcap:release-4.0 Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/config security Everything related with security sig/execution SIG execution 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.

4 participants