Restore support for mysqlctl_mycnf_template#5717
Merged
morgo merged 3 commits intovitessio:masterfrom Jan 21, 2020
Merged
Conversation
Regression of vitessio#5654 Signed-off-by: Morgan Tocker <tocker@gmail.com>
Signed-off-by: Morgan Tocker <tocker@gmail.com>
setassociative
approved these changes
Jan 15, 2020
setassociative
left a comment
There was a problem hiding this comment.
Looks good, thanks for this revision!
deepthi
reviewed
Jan 17, 2020
go/vt/mysqlctl/mysqld.go
Outdated
| if *mycnfTemplateFile != "" { | ||
| data, err := ioutil.ReadFile(*mycnfTemplateFile) | ||
| if err != nil { | ||
| log.Fatalf("mycnf template file could not be read: %v", *mycnfTemplateFile) |
Collaborator
There was a problem hiding this comment.
do we only want to log a FATAL or do we want to abort (exit) at this point?
Contributor
Author
There was a problem hiding this comment.
I am not quite sure I follow. A log.Fatalf triggers an exit(1) at the same time. Here is an example with a modified local example:
morgo@ryzen:~/vitess/examples/local$ ./101_initial_cluster.sh
add /vitess/global
add /vitess/zone1
add zone1 CellInfo
etcd start done...
Starting vtctld...
Access vtctld web UI at http://ryzen:15000
Send commands with: vtctlclient -server ryzen:15999 ...
Starting MySQL for tablet zone1-0000000100...
F0120 11:57:04.764601 29998 mysqld.go:800] template file specified by -mysqlctl_mycnf_template could not be read: /home/morgo/vitess/config/mycnf/testcustom.cnf
goroutine 1 [running]:
github.com/golang/glog.stacks(0xc0001a2b00, 0xc0003aa0c0, 0xa3, 0xb6)
/home/morgo/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:769 +0xb1
github.com/golang/glog.(*loggingT).output(0x16aaf20, 0xc000000003, 0xc0003c0310, 0x14d57b8, 0x9, 0x320, 0x0)
/home/morgo/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:720 +0x2f6
github.com/golang/glog.(*loggingT).printf(0x16aaf20, 0xc000000003, 0xda35b3, 0x49, 0xc000386cf0, 0x1, 0x1)
/home/morgo/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:655 +0x14e
github.com/golang/glog.Fatalf(0xda35b3, 0x49, 0xc000386cf0, 0x1, 0x1)
/home/morgo/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:1148 +0x67
vitess.io/vitess/go/vt/mysqlctl.(*Mysqld).getMycnfTemplate(0xc0003c01c0, 0x35, 0x0)
/home/morgo/vitess/go/vt/mysqlctl/mysqld.go:800 +0x15a
vitess.io/vitess/go/vt/mysqlctl.(*Mysqld).initConfig(0xc0003c01c0, 0xc00039c120, 0xc0003b4050, 0x41, 0x0, 0xd78e00)
/home/morgo/vitess/go/vt/mysqlctl/mysqld.go:783 +0x40c
vitess.io/vitess/go/vt/mysqlctl.(*Mysqld).InitConfig(0xc0003c01c0, 0xc00039c120, 0x0, 0x0)
/home/morgo/vitess/go/vt/mysqlctl/mysqld.go:628 +0x17f
vitess.io/vitess/go/vt/mysqlctl.(*Mysqld).Init(0xc0003c01c0, 0xeab9e0, 0xc0000b6ae0, 0xc00039c120, 0x0, 0x0, 0x0, 0x0)
/home/morgo/vitess/go/vt/mysqlctl/mysqld.go:640 +0x89
main.initCmd(0xc0000b6600, 0xc0000e6090, 0x0, 0x0, 0x0, 0x0)
/home/morgo/vitess/go/cmd/mysqlctl/mysqlctl.go:77 +0x324
main.main()
/home/morgo/vitess/go/cmd/mysqlctl/mysqlctl.go:258 +0x416
ERROR: This script fails to start mysqld, possibly due to apparmor or selinux protection.
Utilities to help investigate:
apparmor: "sudo aa-status"
selinux: "sudo sestatus"
Please disable if so indicated.
You may also need to empty your $VTDATAROOT to start clean.
I would actually prefer without the go stack trace, but that is something implemented by our logging library.
Mention config var which is causing the failure. Signed-off-by: Morgan Tocker <tocker@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Regression of #5654
I refactored getMycnfTemplates and accidentally removed mycnfTemplateFile, then the linter told me the option was not used anywhere. This was in error :-)
Signed-off-by: Morgan Tocker tocker@gmail.com