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

[bug] Not effective version of mysql56 #203

Open
hustjieke opened this issue Aug 26, 2021 · 3 comments
Open

[bug] Not effective version of mysql56 #203

hustjieke opened this issue Aug 26, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@hustjieke
Copy link
Contributor

Describe the problem

The mysql version will never be mysql56:

166 // buildXenonConf build a config file for xenon.
167 func (cfg *Config) buildXenonConf() []byte {
               ....
               ....
171 
172         version := "mysql80"
173         if cfg.MySQLVersion.Major == 5 {
174                 if cfg.MySQLVersion.Minor == 6 {
175                         version = "mysql56"
176                 } else {
177                         version = "mysql57"
178                 }
179         }

In GetMySQLVersion, no matter what mysql version is, it always be 5.7 here.

113 // GetMySQLVersion returns the MySQL server version.
114 func (c *Cluster) GetMySQLVersion() string {
115         version := c.Spec.MysqlVersion
116         // lookup for an alias, usually this will solve 5.7 to 5.7.x
117         if v, ok := utils.MySQLTagsToSemVer[version]; ok { 
118                 version = v
119         }       
120                 
121         if _, ok := utils.MysqlImageVersions[version]; !ok {
122                 version = utils.MySQLDefaultVersion
123         }       
124         
125         return version
126 }

To Reproduce

Expected behavior

Environment:

  • RadonDB MySQL version:
@hustjieke hustjieke added the bug Something isn't working label Aug 26, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Sep 1, 2021
[summary]
rm uneffective version of mysql56, currently we do not support mysql 5.6
or lower version

[test case]
N/A

[patch codecov]
N/A
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Sep 1, 2021
@hustjieke
Copy link
Contributor Author

In utils/constants.go,

 23         // MySQLTagsToSemVer maps simple version to semver versions                                                                                         
 24         MySQLTagsToSemVer = map[string]string{                                                                                                              
 25                 "5.7": "5.7.33",                                                                                                                            
 26         }

If Spec.MysqlVersion is 5.5,5.6 or 8.0, it always be 5.7 after GetMySQLVersion() in line 126 next:

117 // GetMySQLVersion returns the MySQL server version.                                                                                                        
118 func (c *Cluster) GetMySQLVersion() string {                                                                                                                
119         version := c.Spec.MysqlVersion                                                                                                                      
120         // lookup for an alias, usually this will solve 5.7 to 5.7.x                                                                                        
121         if v, ok := utils.MySQLTagsToSemVer[version]; ok {                                                                                                  
122                 version = v                                                                                                                                 
123         }                                                                                                                                                   
124                                                                                                                                                             
125         if _, ok := utils.MysqlImageVersions[version]; !ok {                                                                                                
126                 version = utils.MySQLDefaultVersion                                                                                                         
127         }                                                                                                                                                   
128                                                                                                                                                             
129         return version                                                                                                                                      
130 }    

@zhyass
Copy link
Contributor

zhyass commented Sep 3, 2021

The mysql5.6 is unsupported now. GetMySQLVersion will return default version if the mysql version unsupported. Maybe it would be better to return an error. https://github.com/radondb/radondb-mysql-kubernetes/blob/main/cluster/cluster.go#L122

@hustjieke
Copy link
Contributor Author

Also in sidecar/config.go we should panic but not log error here to prevent continue init work.
e.g.: If user want 8.0.22, but our code has not the correct semver mysql version, this is our mistake and users want 8.0 not 5.7 or other versions.

82 // NewConfig returns a pointer to Config.                                                                                                                   
 83 func NewConfig() *Config {
 84         mysqlVersion, err := semver.Parse(getEnvValue("MYSQL_VERSION"))                                                                                     
 85         if err != nil {
 86                 log.Error("MYSQL_VERSION is not a semver version")
 87                 mysqlVersion, _ = semver.Parse(utils.MySQLDefaultVersion)
 88         }
...
...

hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Sep 9, 2021
[summary]
rm uneffective version of mysql56, currently we do not support mysql 5.6
or lower version

[test case]
N/A

[patch codecov]
N/A
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Sep 9, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Sep 9, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Nov 3, 2021
[summary]
rm uneffective version of mysql56, currently we do not support mysql 5.6
or lower version

[test case]
N/A

[patch codecov]
N/A
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Nov 3, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Nov 3, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Nov 3, 2021
hustjieke added a commit to hustjieke/radondb-mysql-kubernetes that referenced this issue Nov 3, 2021
andyli029 added a commit that referenced this issue Nov 11, 2021
…ve_version_of_mysql56_#203

Feature fix bug of not effective version of mysql56 #203
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
[summary]
rm uneffective version of mysql56, currently we do not support mysql 5.6
or lower version

[test case]
N/A

[patch codecov]
N/A
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
zhl003 pushed a commit to zhl003/radondb-mysql-kubernetes that referenced this issue Aug 17, 2022
…effective_version_of_mysql56_#203

Feature fix bug of not effective version of mysql56 radondb#203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants