Skip to content

Commit

Permalink
async mode: add tests, fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
suetin committed Mar 27, 2024
1 parent 2bfb126 commit e88784d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
command:
- 'GODOG_FEATURE=active_nodes.feature make test'
- 'GODOG_FEATURE=async.feature make test'
- 'GODOG_FEATURE=async_setting.feature.feature make test'
- 'GODOG_FEATURE=async_setting.feature make test'
- 'GODOG_FEATURE=cascade_replicas.feature make test'
- 'GODOG_FEATURE=CLI.feature make test'
- 'GODOG_FEATURE=crash_recovery.feature make test'
Expand Down
6 changes: 3 additions & 3 deletions internal/app/app_dcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ func (app *App) GetMasterHostFromDcs() (string, error) {
}

func (app *App) SetMdbReplMonTS(ts string) error {
err := app.dcs.Create(pathMasterReplMonTs, ts)
err := app.dcs.Create(pathMasterReplMonTS, ts)
if err != nil && err != dcs.ErrExists {
return err
}
err = app.dcs.Set(pathMasterReplMonTs, ts)
err = app.dcs.Set(pathMasterReplMonTS, ts)
if err != nil {
return err
}
Expand All @@ -243,7 +243,7 @@ func (app *App) SetMdbReplMonTS(ts string) error {

func (app *App) GetMdbReplMonTS() (string, error) {
var ts string
err := app.dcs.Get(pathMasterReplMonTs, &ts)
err := app.dcs.Get(pathMasterReplMonTS, &ts)
if errors.Is(err, dcs.ErrNotFound) {
return "", nil
}
Expand Down
2 changes: 1 addition & 1 deletion internal/app/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
pathLastShutdownNodeTime = "last_shutdown_node_time"

// last known timestamp from mysql.mdb_repl_mon
pathMasterReplMonTs = "master_repl_mon_ts"
pathMasterReplMonTS = "master_repl_mon_ts"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion internal/mysql/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ func (n *Node) SetDefaultReplicationSettings(masterNode *Node) error {

func (n *Node) GetMdbReplMonTS() (string, error) {
result := new(MdbReplMonTS)
err := n.queryRow(queryGetMdbReplMonTs, nil, result)
err := n.queryRow(queryGetMdbReplMonTS, nil, result)
return result.Timestamp, err
}

Expand Down
4 changes: 2 additions & 2 deletions internal/mysql/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const (
querySetInnodbFlushLogAtTrxCommit = "set_innodb_flush_log_at_trx_commit"
querySetSyncBinlog = "set_sync_binlog"
queryGetReplicationSettings = "get_replication_settings"
queryGetMdbReplMonTs = "get_mdb_repl_mon_ts"
queryGetMdbReplMonTS = "get_mdb_repl_mon_ts"
queryCalcMdbReplMonTSDelay = "calc_mdb_repl_mon_ts_delay"
)

Expand Down Expand Up @@ -125,6 +125,6 @@ var DefaultQueries = map[string]string{
querySetInnodbFlushLogAtTrxCommit: `SET GLOBAL innodb_flush_log_at_trx_commit = :level`,
queryGetReplicationSettings: `SELECT @@innodb_flush_log_at_trx_commit as InnodbFlushLogAtTrxCommit, @@sync_binlog as SyncBinlog`,
querySetSyncBinlog: `SET GLOBAL sync_binlog = :sync_binlog`,
queryGetMdbReplMonTs: `SELECT UNIX_TIMESTAMP(ts) AS ts FROM mysql.mdb_repl_mon`,
queryGetMdbReplMonTS: `SELECT UNIX_TIMESTAMP(ts) AS ts FROM mysql.mdb_repl_mon`,
queryCalcMdbReplMonTSDelay: `SELECT FLOOR(CAST(:ts AS DECIMAL(20,3)) - UNIX_TIMESTAMP(ts)) AS delay FROM mysql.mdb_repl_mon`,
}

0 comments on commit e88784d

Please sign in to comment.