-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: MySQL 8.4 support * Add go-version for doing version comparisons * docker-gh-ost-replica-tests: Support MySQL 8.4+ * localtests: Support MySQL 8.4 * Remove mysql-8.4.3 from replica-tests GHA since dbdeployer / ci env does not have 8.4.3 * MySQL 8.4: Actually use caching_sha2_password pw strategy * Commit up vendor/github.com/hashicorp/go-version * Add GHA job for docker-gh-ost-replica-tests * localtests/test.sh: Fix conditional bug and replica_terminology typo
- Loading branch information
1 parent
ad5d3ea
commit be413cf
Showing
19 changed files
with
1,437 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package mysql | ||
|
||
import ( | ||
version "github.com/hashicorp/go-version" | ||
) | ||
|
||
const ( | ||
MysqlVersionCutoff = "8.4" | ||
) | ||
|
||
var MysqlReplicaTermMap = map[string]string{ | ||
"Seconds_Behind_Master": "Seconds_Behind_Source", | ||
"Master_Log_File": "Source_Log_File", | ||
"Master_Host": "Source_Host", | ||
"Master_Port": "Source_Port", | ||
"Exec_Master_Log_Pos": "Exec_Source_Log_Pos", | ||
"Read_Master_Log_Pos": "Read_Source_Log_Pos", | ||
"Relay_Master_Log_File": "Relay_Source_Log_File", | ||
"Slave_IO_Running": "Replica_IO_Running", | ||
"Slave_SQL_Running": "Replica_SQL_Running", | ||
"master status": "binary log status", | ||
"slave hosts": "replicas", | ||
"slave status": "replica status", | ||
"slave": "replica", | ||
} | ||
|
||
func ReplicaTermFor(mysqlVersion string, term string) string { | ||
vs, err := version.NewVersion(mysqlVersion) | ||
if err != nil { | ||
// default to returning the same term if we cannot determine the version | ||
return term | ||
} | ||
|
||
mysqlVersionCutoff, _ := version.NewVersion(MysqlVersionCutoff) | ||
if vs.GreaterThanOrEqual(mysqlVersionCutoff) { | ||
return MysqlReplicaTermMap[term] | ||
} | ||
return term | ||
} |
This file contains 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
Oops, something went wrong.