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

Revert "executor: fix show global variables return session variables also (#19341) (#21045)" #26240

Merged
merged 3 commits into from
Sep 13, 2021

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Jul 14, 2021

This reverts commit a1bdbef.

What problem does this PR solve?

Issue Number: close #24326 for TiDB v4.0

Problem Summary:

  • Manual test (add detailed scripts or steps below)

The following code is used to do the tests:

class Test1 {    
   public static void main(String[] args) throws Exception {    
        System.setProperty( "oracle.jdbc.Trace", Boolean.TRUE.toString() );    
        Class.forName("com.mysql.jdbc.Driver").newInstance();    
        String url = "jdbc:mysql://address=(protocol=tcp)(host=127.0.0.1)(port=4000)(user=root)/test?&useUnicode=true&characterEncoding=UTF-8";    
        Connection conn = DriverManager.getConnection(url, "", "");    
        DatabaseMetaData meta = conn.getMetaData();    
        System.out.println("Driver version: " + meta.getDriverVersion());    
        System.out.println("Server version: " + meta.getDatabaseProductVersion());    
    
        int connId = 0;    
        while (connId < 20) {    
            try {    
                long startTime = System.currentTimeMillis();    
                conn = DriverManager.getConnection(url, "", "");    
                long duration = System.currentTimeMillis() - startTime;    
                System.out.println("Time for onConnection #" + connId + ": " + duration);    
                connId ++;    
            } catch (Exception e) {    
                System.out.println("Exception: "+e);    
                e.printStackTrace();    
            } finally {    
                conn.close();    
            }    
        }    
    }    
}   

Before this PR, a long connection duration can be noticed because of #24326 and the MySQL connector bug #75592:

Driver version: mysql-connector-java-5.1.34 ( Revision: [email protected] )
Server version: 5.7.25-TiDB-v4.0.14
Time for onConnection #0: 71
Time for onConnection #1: 53
Time for onConnection #2: 48
Time for onConnection #3: 45
Time for onConnection #4: 74
Time for onConnection #5: 63
Time for onConnection #6: 44
Time for onConnection #7: 42
Time for onConnection #8: 37
Time for onConnection #9: 40
Time for onConnection #10: 50
Time for onConnection #11: 68
Time for onConnection #12: 40
Time for onConnection #13: 56
Time for onConnection #14: 41
Time for onConnection #15: 43
Time for onConnection #16: 41
Time for onConnection #17: 48
Time for onConnection #18: 96
Time for onConnection #19: 54

After reverting the commit, the duration of connection reduced:

Driver version: mysql-connector-java-5.1.34 ( Revision: [email protected] )
Server version: 5.7.25-TiDB-v4.0.14-1-geea91a40c
Time for onConnection #0: 12
Time for onConnection #1: 18
Time for onConnection #2: 16
Time for onConnection #3: 16
Time for onConnection #4: 24
Time for onConnection #5: 27
Time for onConnection #6: 25
Time for onConnection #7: 17
Time for onConnection #8: 19
Time for onConnection #9: 17
Time for onConnection #10: 16
Time for onConnection #11: 15
Time for onConnection #12: 17
Time for onConnection #13: 21
Time for onConnection #14: 14
Time for onConnection #15: 15
Time for onConnection #16: 14
Time for onConnection #17: 16
Time for onConnection #18: 18
Time for onConnection #19: 15

Side effects

Documentation

  • To be added

Release note

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 14, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • guo-shaoge
  • zimulala

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added do-not-merge/cherry-pick-not-approved size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 14, 2021
@github-actions github-actions bot added the sig/execution SIG execution label Jul 14, 2021
@qw4990
Copy link
Contributor

qw4990 commented Jul 15, 2021

/run-all-tests

@qw4990
Copy link
Contributor

qw4990 commented Jul 15, 2021

/run-integration-test

@guo-shaoge
Copy link
Collaborator

/run-integration-common-test
/run-common-test

@bb7133
Copy link
Member Author

bb7133 commented Jul 17, 2021

/run-integration-common-test
/run-common-test

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.

After reverting the commit, duration of connection reduced.

Could you briefly describe the reduction in execution time? The approximate time is reduced from how many milliseconds to how many milliseconds?

@zhouqiang-cl
Copy link
Contributor

/hold

@ti-chi-bot ti-chi-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 19, 2021
@ti-chi-bot
Copy link
Member

@bb7133: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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/test-infra repository.

@ti-chi-bot ti-chi-bot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 13, 2021
@zhouqiang-cl
Copy link
Contributor

/unhold

@ti-chi-bot ti-chi-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 13, 2021
@zhouqiang-cl zhouqiang-cl removed the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Sep 13, 2021
zimulala
zimulala previously approved these changes Sep 13, 2021
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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 13, 2021
@zimulala zimulala dismissed their stale review September 13, 2021 08:27

You need two LGTMS

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Sep 13, 2021
@bb7133
Copy link
Member Author

bb7133 commented Sep 13, 2021

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 38c283b

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 13, 2021
@ti-chi-bot ti-chi-bot merged commit 647e246 into pingcap:release-4.0 Sep 13, 2021
@zhouqiang-cl zhouqiang-cl added this to the v4.0.15 milestone Sep 14, 2021
@bb7133 bb7133 deleted the bb7133/revert_21045 branch December 29, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Cherry pick PR approved by release team. sig/execution SIG execution size/M Denotes a PR that changes 30-99 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants