Skip to content

Commit 4077a1b

Browse files
committed
No longer need this
1 parent 4127f47 commit 4077a1b

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

cmd/monitor/monitor_cluster_state.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"time"
99

1010
"github.com/fly-apps/postgres-flex/internal/flypg"
11-
"github.com/jackc/pgx/v5"
1211
)
1312

1413
func monitorClusterState(ctx context.Context, node *flypg.Node) {
@@ -63,31 +62,3 @@ func clusterStateMonitorTick(ctx context.Context, node *flypg.Node) error {
6362

6463
return nil
6564
}
66-
67-
func evaluateClusterState(ctx context.Context, conn *pgx.Conn, node *flypg.Node) error {
68-
primary, err := node.EvaluateClusterState(ctx, conn)
69-
if errors.Is(err, flypg.ErrZombieDiagnosisUndecided) || errors.Is(err, flypg.ErrZombieDiscovered) {
70-
// Quarantine primary
71-
if err := flypg.Quarantine(ctx, conn, node, primary); err != nil {
72-
return fmt.Errorf("failed to quarantine failed primary: %s", err)
73-
}
74-
return fmt.Errorf("primary has been quarantined: %s", err)
75-
} else if err != nil {
76-
return fmt.Errorf("failed to run zombie diagnosis: %s", err)
77-
}
78-
79-
// Clear zombie lock if it exists
80-
if flypg.ZombieLockExists() {
81-
log.Println("Clearing zombie lock and enabling read/write")
82-
if err := flypg.RemoveZombieLock(); err != nil {
83-
return fmt.Errorf("failed to remove zombie lock: %s", err)
84-
}
85-
86-
log.Println("Broadcasting readonly state change")
87-
if err := flypg.BroadcastReadonlyChange(ctx, node, false); err != nil {
88-
log.Printf("errors while disabling readonly: %s", err)
89-
}
90-
}
91-
92-
return nil
93-
}

0 commit comments

Comments
 (0)