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

Fix typos #201

Merged
merged 2 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/flypg/readonly.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func DisableReadonly(ctx context.Context, n *Node) error {
}

if err := changeReadOnlyState(ctx, n, false); err != nil {
return fmt.Errorf("failed to disabe read-only mode: %s", err)
return fmt.Errorf("failed to disable read-only mode: %s", err)
}

if err := removeReadOnlyLock(); err != nil {
Expand Down Expand Up @@ -88,7 +88,7 @@ func BroadcastReadonlyChange(ctx context.Context, n *Node, enabled bool) error {
endpoint := fmt.Sprintf("http://[%s]:5500/%s", member.Hostname, RestartHaproxyEndpoint)
resp, err := http.Get(endpoint)
if err != nil {
log.Printf("[WARN] Failed restart haproxy on member %s: %s", member.Hostname, err)
log.Printf("[WARN] Failed to restart haproxy on member %s: %s", member.Hostname, err)
continue
}
defer func() { _ = resp.Body.Close() }()
Expand Down Expand Up @@ -150,7 +150,7 @@ func changeReadOnlyState(ctx context.Context, n *Node, enable bool) error {
if member.Role == PrimaryRoleName {
databases, err := admin.ListDatabases(ctx, conn)
if err != nil {
return fmt.Errorf("failed to list database: %s", err)
return fmt.Errorf("failed to list databases: %s", err)
}

for _, db := range databases {
Expand Down
2 changes: 1 addition & 1 deletion internal/flypg/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func writeSSHKey() error {
}

if err := os.Chmod(publicKeyFile, 0600); err != nil {
return fmt.Errorf("failed to chmod private key file: %s", err)
return fmt.Errorf("failed to chmod public key file: %s", err)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions internal/flypg/zombie.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func handleZombieLock(ctx context.Context, n *Node) error {
return fmt.Errorf("failed to stop postgres: %s", err)
}
} else {
// TODO - Provide link to documention on how to address this
// TODO - Provide link to documentation on how to address this
log.Println("[WARN] Zombie lock file does not contain a hostname.")
log.Println("[WARN] This likely means that we were unable to determine who the real primary is.")
}
Expand All @@ -269,7 +269,7 @@ func EvaluateClusterState(ctx context.Context, conn *pgx.Conn, node *Node) error

// Clear zombie lock if it exists
if ZombieLockExists() {
log.Println("Quorom has been reached. Disabling read-only mode.")
log.Println("Quorum has been reached. Disabling read-only mode.")
if err := RemoveZombieLock(); err != nil {
return fmt.Errorf("failed to remove zombie lock file: %s", err)
}
Expand Down
3 changes: 2 additions & 1 deletion internal/supervisor/ensure_kill.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//go:build !linux
// +build !linux

package supervisor

import "os/exec"

func ensureKill(cmd *exec.Cmd) {
// cmd.SysProcAttr.Pdeathsig in supported on on Linux, we can't do anything here
// cmd.SysProcAttr.Pdeathsig is supported on Linux, we can't do anything here
}