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

config: set the default value of auto_tls to false #27486

Merged
merged 3 commits into from
Nov 4, 2021

Conversation

bb7133
Copy link
Member

@bb7133 bb7133 commented Aug 23, 2021

What is changed and how it works?

What's Changed:

As described in the title, we would set the default value of auto_tls to false for compatibility with earlier releases:

In #24141 the 'automatical creation of TLS certificates' is introduced for the consideration of MySQL's default behavior. However, when the client specifies to use an encrypted connection(the default behavior for most clients/connectors), a performance regression can be noticed.

The problem here is, many of the users may not be aware if they're using a client with the encrypted connection, so we decided to set the default value of auto_tls in the code to avoid the potential performance regression while keeping it to true in the config example file.

However, the value in the config example file will be kept to true so that it is recommended(mostly for new clusters).

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Start a new TiDB with a configuration that does not contain auto_tls, and confirm that the default value is false.

Documentation

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Aug 23, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • xiongjiwei

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 release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 23, 2021
Copy link
Contributor

@dveeden dveeden left a comment

Choose a reason for hiding this comment

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

First a practical issue: This causes TestConfig to fail:

[2021-08-23T06:21:19.441Z]         	            	Diff:
[2021-08-23T06:21:19.441Z]         	            	--- Expected
[2021-08-23T06:21:19.441Z]         	            	+++ Actual
[2021-08-23T06:21:19.441Z]         	            	@@ -71,3 +71,3 @@
[2021-08-23T06:21:19.441Z]         	            	   EnableSEM: (bool) false,
[2021-08-23T06:21:19.441Z]         	            	-  AutoTLS: (bool) false,
[2021-08-23T06:21:19.441Z]         	            	+  AutoTLS: (bool) true,
[2021-08-23T06:21:19.441Z]         	            	   MinTLSVersion: (string) ""
[2021-08-23T06:21:19.441Z]         	Test:       	TestConfig
[2021-08-23T06:21:19.441Z] --- FAIL: TestConfig (0.02s)

The problem here is, many of the users may not be aware if they're using a client with the encrypted connection, so we decided to set the default value of auto_tls in the code to avoid the potential performance regression while keeping it to true in the config example file.

Here the choice is between Security and Performance.

This can delay the initial startup of the server by a little. I'm not sure if this is really a problem. I expect the performance impact to be minimal when running.

I would opt to keep this enabled and allow people to turn it of if the performance impact is problematic.

Leaving this enabled would:

  • Result in a secure-by-default situation. Especially for those setups where there is not enough infrastructure and/or knowledge to setup TLS.
  • Result in more testing with TLS etc.
  • Make it easier for people to use caching_sha2_password as without TLS this won't work.

I don't think this is a very technical decision to be made. This is mostly a strategic one. I'm fine with both options, but I would prefer TLS to be on by default.

@bb7133 bb7133 force-pushed the bb7133/default_autotls branch from 9a86520 to 2f4b4f3 Compare August 23, 2021 10:26
@bb7133
Copy link
Member Author

bb7133 commented Aug 23, 2021

@dveeden Thanks for your comment.

I would opt to keep this enabled and allow people to turn it of if the performance impact is problematic.

The default behavior TiDB when upgrading should be kept as before, so we don't want to make it changed.

For the new cluster, it will be enabled since the configuration file is true.

@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 31, 2021
@bb7133 bb7133 force-pushed the bb7133/default_autotls branch from 2f4b4f3 to 2a46786 Compare November 4, 2021 07:47
@bb7133 bb7133 requested a review from a team as a code owner November 4, 2021 07:47
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2021
@bb7133 bb7133 added the needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 label Nov 4, 2021
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

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Nov 4, 2021
@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 Nov 4, 2021
@morgo morgo self-requested a review November 4, 2021 14:44
@morgo
Copy link
Contributor

morgo commented Nov 4, 2021

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: ef8ce37

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Nov 4, 2021
@ti-chi-bot ti-chi-bot merged commit 0e817e1 into pingcap:master Nov 4, 2021
ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 4, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.2 in PR #29471

ti-srebot pushed a commit to ti-srebot/tidb that referenced this pull request Nov 4, 2021
@ti-srebot
Copy link
Contributor

cherry pick to release-5.3 in PR #29472

@bb7133 bb7133 deleted the bb7133/default_autotls 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
component/config needs-cherry-pick-release-5.2 needs-cherry-pick-release-5.3 Type: Need cherry pick to release-5.3 release-note-none Denotes a PR that doesn't merit a release note. sig/sql-infra SIG: SQL Infra size/XS Denotes a PR that changes 0-9 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.

8 participants