-
Notifications
You must be signed in to change notification settings - Fork 498
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
Support specifying an initialize sql file on TiDB' s first bootstrap #4862
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4862 +/- ##
==========================================
+ Coverage 59.43% 67.79% +8.36%
==========================================
Files 226 230 +4
Lines 25697 28793 +3096
==========================================
+ Hits 15273 19521 +4248
+ Misses 8969 7800 -1169
- Partials 1455 1472 +17
|
@@ -643,6 +644,21 @@ func validateUpdatePDConfig(oldPdSpec, pdSpec *v1alpha1.PDSpec, path *field.Path | |||
return allErrs | |||
} | |||
|
|||
func disallowMutateBootstrapSQLConfigMapName(old, new *v1alpha1.TiDBSpec, p *field.Path) field.ErrorList { |
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 seems there are no need to restrict this
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.
Because it only take effect at the first bootstrap, so updating the field makes no sense but make tidb restart.
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.
Rest LGTM
@@ -644,6 +644,8 @@ func validateUpdatePDConfig(oldPdSpec, pdSpec *v1alpha1.PDSpec, path *field.Path | |||
return allErrs | |||
} | |||
|
|||
// disallowMutateBootstrapSQLConfigMapName checks if user mutate the bootstrapSQLConfigMapName field. | |||
// Only allow to update bootstrapSQLConfigMapName from non-nil to nil. |
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.
why do we need to support updates from non-nil to nil?
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.
If the user deletes the bootstrap sql configmap and also wants to remove it from tidb pods.
This comment was marked as outdated.
This comment was marked as outdated.
/run-all-tests |
/test pull-e2e-kind-across-kubernetes |
1 similar comment
/test pull-e2e-kind-across-kubernetes |
/test pull-e2e-kind-serial |
Any ideas about the error in E2E?
tidb-operator/tests/e2e/tidbcluster/across-kubernetes.go Lines 991 to 993 in 0ff338f
Do we need to turn up the timeout?
|
/test pull-e2e-kind-across-kubernetes |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7702ee7
|
@fgksgf: Your PR was out of date, I have automatically updated it for you. 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 ti-community-infra/tichi repository. |
/run-all-tests |
/test pull-e2e-kind-serial |
4 similar comments
/test pull-e2e-kind-serial |
/test pull-e2e-kind-serial |
/test pull-e2e-kind-serial |
/test pull-e2e-kind-serial |
What problem does this PR solve?
Support specifying an initialize sql file on TiDB' s first bootstrap.
Related PR: pingcap/tidb#35625
What is changed and how does it work?
BootstrapSQLConfigMapName
field to tidb spec--initialize-sql-file
to tidb start scriptCode changes
Tests
BootstrapSQLConfigMapName
field and set tidb config to enable SEMtest_admin
and:show config where type='tidb' and name='security.enable-sem';
select * from INFORMATION_SCHEMA.USER_PRIVILEGES;
Side effects
Related changes
Release Notes
Please refer to Release Notes Language Style Guide before writing the release note.