Skip to content

Commit ce2f772

Browse files
committed
potential fix
1 parent 502641a commit ce2f772

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

internal/flypg/zombie.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ type DNASample struct {
8484

8585
func TakeDNASample(ctx context.Context, node *Node, standbys []Member) (*DNASample, error) {
8686
sample := &DNASample{
87-
hostname: node.PrivateIP,
87+
hostname: node.Hostname(),
8888
totalMembers: len(standbys) + 1,
8989
totalActive: 1,
9090
totalInactive: 0,
@@ -116,9 +116,8 @@ func TakeDNASample(ctx context.Context, node *Node, standbys []Member) (*DNASamp
116116

117117
sample.totalActive++
118118

119-
// Record conflict when primary doesn't match.
120-
// TODO - Figure out why we are checking both conditions here.
121-
if primary.Hostname != node.Hostname() && primary.Hostname != node.PrivateIP {
119+
// Record conflict when primary name does not match our machine ID
120+
if primary.Hostname != node.Hostname() {
122121
sample.totalConflicts++
123122
sample.conflictMap[primary.Hostname]++
124123
}

0 commit comments

Comments
 (0)