Skip to content

Commit

Permalink
Log detailed info when a join failure member is detected
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <ghzpotato@gmail.com>
  • Loading branch information
JmPotato committed Jun 4, 2024
1 parent a929a54 commit 0539cd2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions server/join/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ func PrepareJoinCluster(cfg *config.Config) error {
existed := false
for _, m := range listResp.Members {
if len(m.Name) == 0 {
return errors.New("there is a member that has not joined successfully")
log.Error("there is an abnormal joined member in the current member list",
zap.Uint64("id", m.ID),
zap.Strings("peer-urls", m.PeerURLs),
zap.Strings("client-urls", m.ClientURLs))
return errors.Errorf("there is a member %d that has not joined successfully", m.ID)

Check warning on line 143 in server/join/join.go

View check run for this annotation

Codecov / codecov/patch

server/join/join.go#L139-L143

Added lines #L139 - L143 were not covered by tests
}
if m.Name == cfg.Name {
existed = true
Expand Down Expand Up @@ -184,7 +188,11 @@ func PrepareJoinCluster(cfg *config.Config) error {
listSucc = true
}
if len(n) == 0 {
return errors.New("there is a member that has not joined successfully")
log.Error("there is an abnormal joined member in the current member list",
zap.Uint64("id", memb.ID),
zap.Strings("peer-urls", memb.PeerURLs),
zap.Strings("client-urls", memb.ClientURLs))
return errors.Errorf("there is a member %d that has not joined successfully", memb.ID)

Check warning on line 195 in server/join/join.go

View check run for this annotation

Codecov / codecov/patch

server/join/join.go#L191-L195

Added lines #L191 - L195 were not covered by tests
}
for _, m := range memb.PeerURLs {
pds = append(pds, fmt.Sprintf("%s=%s", n, m))
Expand Down

0 comments on commit 0539cd2

Please sign in to comment.