Skip to content

Commit 8d13fe2

Browse files
committed
Cleanup
1 parent bf588be commit 8d13fe2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

internal/flypg/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,14 @@ func (n *Node) PostInit(ctx context.Context) error {
343343
}
344344

345345
// Collect sample data from registered standbys
346-
sample, err := ZombieDNASample(ctx, n, standbys)
346+
sample, err := TakeDNASample(ctx, n, standbys)
347347
if err != nil {
348348
return fmt.Errorf("failed to resolve cluster metrics: %s", err)
349349
}
350350

351351
printDNASample(sample)
352352

353+
// Evaluate whether we are a zombie or not.
353354
primary, err := ZombieDiagnosis(sample)
354355
if errors.Is(err, ErrZombieDiagnosisUndecided) {
355356
fmt.Println("Unable to confirm that we are the true primary!")

internal/flypg/zombie.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type DNASample struct {
6161
conflictMap map[string]int
6262
}
6363

64-
func ZombieDNASample(ctx context.Context, node *Node, standbys []Member) (*DNASample, error) {
64+
func TakeDNASample(ctx context.Context, node *Node, standbys []Member) (*DNASample, error) {
6565
sample := &DNASample{
6666
hostname: node.PrivateIP,
6767
totalMembers: len(standbys) + 1,

0 commit comments

Comments
 (0)