Skip to content

Commit

Permalink
Fix some minor typos
Browse files Browse the repository at this point in the history
  • Loading branch information
secwall committed Nov 26, 2024
1 parent a5ff088 commit d552eaf
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
6 changes: 3 additions & 3 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ func (app *App) approveFailover(clusterState, clusterStateDcs map[string]*NodeSt
app.logger.Infof("approve failover: filesystem is readonly, skip replication and delay checks")
} else {
if countRunningHASlaves(clusterState) == countHANodes(clusterState)-1 {
return fmt.Errorf("all replics are alive and running replication, seems zk problems")
return fmt.Errorf("all replicas are alive and running replication, seems zk problems")
}
if app.config.FailoverDelay > 0 {
failingTime := time.Since(app.nodeFailedAt[master])
Expand Down Expand Up @@ -880,7 +880,7 @@ func (app *App) calcActiveNodes(clusterState, clusterStateDcs map[string]*NodeSt
}
if !node.PingOk {
if node.PingDubious || clusterStateDcs[host].PingOk {
// we can't rely on ping and slave status if ping was dubios
// we can't rely on ping and slave status if ping was dubious
if util.ContainsString(oldActiveNodes, host) {
app.logger.Warnf("calc active nodes: %s is dubious or keep health lock in dcs, keeping active...", host)
activeNodes = append(activeNodes, host)
Expand Down Expand Up @@ -1408,7 +1408,7 @@ func (app *App) performSwitchover(clusterState map[string]*NodeState, activeNode
app.logger.Infof("switchover: old master %s does not need recovery", oldMaster)
err = app.externalReplication.Reset(oldMasterNode)
if err != nil {
return fmt.Errorf("got error: %s while reseting external replication on old master: %s", err, oldMaster)
return fmt.Errorf("got error: %s while resetting external replication on old master: %s", err, oldMaster)
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/app/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ type SemiSyncState struct {
const (
// CauseManual means switchover was issued via command line
CauseManual = "manual"
// CauseWorker means switchover was initated via MDB worker (set directly to dcs)
// CauseWorker means switchover was initiated via MDB worker (set directly to dcs)
CauseWorker = "worker"
// CauseAuto means failover was started automatically by failure detection process
CauseAuto = "auto"
Expand Down
2 changes: 1 addition & 1 deletion internal/mysql/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func Mogrify(query string, arg map[string]interface{}) string {
})
}

// not all queries may be parametrized with placeholders
// not all queries may be parameterized with placeholders
func (n *Node) execMogrifyWithTimeout(queryName string, arg map[string]interface{}, timeout time.Duration) error {
query := n.getQuery(queryName)
query = Mogrify(query, arg)
Expand Down
2 changes: 1 addition & 1 deletion internal/mysql/switch_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (sh *SwitchHelper) CheckFailoverQuorum(activeNodes []string, permissibleSla
if sh.SemiSync {
failoverQuorum := sh.GetFailoverQuorum(activeNodes)
if permissibleSlaves < failoverQuorum {
return fmt.Errorf("no quorum, have %d replics while %d is required", permissibleSlaves, failoverQuorum)
return fmt.Errorf("no quorum, have %d replicas while %d is required", permissibleSlaves, failoverQuorum)
}
} else {
if permissibleSlaves == 0 {
Expand Down
2 changes: 1 addition & 1 deletion internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func GetEnvVariable(name, def string) string {
}

// SelectNode returns host (from given list) starting specified match string
// If match starts with ^ it's discareded (backward compatibility)
// If match starts with ^ it's discarded (backward compatibility)
func SelectNodes(hosts []string, match string) []string {
match = strings.TrimPrefix(match, "^")
res := make([]string, 0)
Expand Down
6 changes: 3 additions & 3 deletions tests/features/failover.feature
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Feature: failover
And mysql on host "mysql2" is killed
Then mysql host "mysql1" should become unavailable within "10" seconds
And mysql host "mysql2" should become unavailable within "10" seconds
# give a change to perform (actualy not) failover
# give a change to perform (actually not) failover
When I wait for "30" seconds
Then mysql host "mysql3" should be replica of "{{.master}}"
And zookeeper node "/test/master" should match regexp
Expand All @@ -102,7 +102,7 @@ Feature: failover
.*failover was not approved:.*no quorum.*
"""

Scenario: failover works well with dymanic quorum
Scenario: failover works well with dynamic quorum
Given cluster environment is
"""
MYSYNC_FAILOVER=true
Expand Down Expand Up @@ -193,7 +193,7 @@ Feature: failover

When host "{{.new_master}}" is stopped
Then mysql host "{{.new_master}}" should become unavailable within "10" seconds
# give a change to perform (actualy not) failover
# give a change to perform (actually not) failover
When I wait for "30" seconds
Then mysql host "mysql1" should be replica of "{{.new_master}}"
And mysql host "{{.old_slave}}" should be replica of "{{.new_master}}"
Expand Down
4 changes: 2 additions & 2 deletions tests/features/host_management.feature
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ Feature: update host topology using CLI
Then zookeeper node "/test/ha_nodes/mysql2" should not exist
Then zookeeper node "/test/cascade_nodes/mysql2" should exist

# loops are forbiden:
# loops are forbidden:
When I run command on host "mysql1"
"""
mysync host add mysql2 --stream-from mysql2
"""
Then command return code should be "1"
# loops are forbiden:
# loops are forbidden:
When I run command on host "mysql1"
"""
mysync host add mysql1 --stream-from mysql2
Expand Down
2 changes: 1 addition & 1 deletion tests/features/readonly_filesystem.feature
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Feature: readonly filesystem
Scenario: check master failture when disk on muster become readonly
Scenario: check master failure when disk on muster become readonly
Given cluster environment is
"""
MYSYNC_FAILOVER=true
Expand Down
2 changes: 1 addition & 1 deletion tests/features/repair.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Feature: repair hosts in cluster
Given cluster is up and running
Then mysql host "mysql1" should be master
And mysql host "mysql1" should be writable
# jsut to have stable tests - turn on maintenance mode
# just to have stable tests - turn on maintenance mode
And I run command on host "mysql1"
"""
mysync maint on
Expand Down
2 changes: 1 addition & 1 deletion tests/features/switchover_from.feature
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Feature: manual switchover from old master
"initiated_by": "mysql1",
"result": {
"ok": false,
"error": "no quorum, have 0 replics while 2 is required"
"error": "no quorum, have 0 replicas while 2 is required"
}
}
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/images/jepsen_main/jepsen/src/jepsen/mysync.clj
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
(let [master (clojure.string/replace (String. (get (zk/data client "/test/master") :data))
#"\"" "")
node (rand-nth (filter (fn [x] (not (string/includes? (name x) "zookeeper"))) (:nodes test)))]
(info (str "runnning switchover from " master))
(info (str "running switchover from " master))
(control/on node
(control/exec :mysync :switch :--from master))))
(catch Throwable t#
Expand Down
6 changes: 3 additions & 3 deletions tests/mysync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ func (tctx *testContext) stepSetReadonlyStatus(host string, value string) error
cmd := fmt.Sprintf("rm /tmp/readonly && echo %s > /tmp/readonly", value)
code, output, err := tctx.composer.RunCommand(host, cmd, commandExecutionTimeout)
if code != 0 {
return fmt.Errorf("comand exit with code %d and output: %s", code, output)
return fmt.Errorf("command exit with code %d and output: %s", code, output)
}
return err
}
Expand Down Expand Up @@ -1286,7 +1286,7 @@ func (tctx *testContext) stepMysqlHostShouldBecomeWritableWithin(host string, ti
return err
}

func (tctx *testContext) stepISaveZookeperQueryResultAs(varname string) error {
func (tctx *testContext) stepISaveZookeeperQueryResultAs(varname string) error {
var j interface{}
if tctx.zkQueryResult != "" {
if err := json.Unmarshal([]byte(tctx.zkQueryResult), &j); err != nil {
Expand Down Expand Up @@ -1465,7 +1465,7 @@ func InitializeScenario(s *godog.ScenarioContext) {
s.Step(`^I have no SQL execution error at mysql host "([^"]*)" within "(\d+)" seconds$`, tctx.stepThereIsNoSQLErrorWithin)

// variables
s.Step(`^I save zookeeper query result as "([^"]*)"$`, tctx.stepISaveZookeperQueryResultAs)
s.Step(`^I save zookeeper query result as "([^"]*)"$`, tctx.stepISaveZookeeperQueryResultAs)
s.Step(`^I save command output as "([^"]*)"$`, tctx.stepISaveCommandOutputAs)
s.Step(`^I save SQL result as "([^"]*)"$`, tctx.stepISaveSQLResultAs)
s.Step(`^I save "([^"]*)" as "([^"]*)"$`, tctx.stepISaveValAs)
Expand Down
8 changes: 4 additions & 4 deletions tests/testutil/docker_composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ type Composer interface {
Stop(service string) error
// Starts container/VM
Start(service string) error
// Detachs container/VM from network
// Detaches container/VM from network
DetachFromNet(service string) error
// Attachs container/VM to network
// Attaches container/VM to network
AttachToNet(service string) error
// Executes command inside container/VM with given timeout.
// Returns command retcode and output (stdoud and stderr are mixed)
Expand Down Expand Up @@ -249,7 +249,7 @@ func (dc *DockerComposer) RunAsyncCommand(service string, cmd string) error {
return dc.api.ContainerExecStart(context.Background(), execResp.ID, container.ExecStartOptions{})
}

// GetFile returns content of the fail from continer by path
// GetFile returns content of the fail from container by path
func (dc *DockerComposer) GetFile(service, path string) (io.ReadCloser, error) {
cont, ok := dc.containers[service]
if !ok {
Expand Down Expand Up @@ -308,7 +308,7 @@ func (dc *DockerComposer) Stop(service string) error {
return err
}

// AttachToNet attachs container to network
// AttachToNet attaches container to network
func (dc *DockerComposer) AttachToNet(service string) error {
_, ok := dc.containers[service]
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion tests/testutil/matchers/matchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func JSONExactlyMatcher(actual string, expected string) error {
return nil
}

// GetMatcher returns registred matcher by name
// GetMatcher returns registered matcher by name
func GetMatcher(name string) (Matcher, error) {
if matcher, ok := registry[name]; ok {
return matcher, nil
Expand Down

0 comments on commit d552eaf

Please sign in to comment.