Skip to content

Commit

Permalink
add leader peer id log
Browse files Browse the repository at this point in the history
Signed-off-by: crazycs520 <crazycs520@gmail.com>
  • Loading branch information
crazycs520 committed May 15, 2024
1 parent a98b954 commit 2b01126
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/locate/region_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,10 @@ func (s *replicaSelector) String() string {
}
var replicaStatus []string
cacheRegionIsValid := "unknown"
leaderPeerID := uint64(0)
if s != nil {
if s.region != nil {
leaderPeerID = s.region.GetLeaderPeerID()
if s.region.isValid() {
cacheRegionIsValid = "true"
} else {
Expand All @@ -531,7 +533,8 @@ func (s *replicaSelector) String() string {
))
}
}
return fmt.Sprintf("{state: %v, cacheRegionIsValid: %v, replicaStatus: %v}", selectorStateStr, cacheRegionIsValid, replicaStatus)
return fmt.Sprintf("{state: %v, cacheRegionIsValid: %v, leaderPeerID: %v, replicaStatus: %v}",
selectorStateStr, cacheRegionIsValid, leaderPeerID, replicaStatus)
}

// selectorState is the interface of states of the replicaSelector.
Expand Down

0 comments on commit 2b01126

Please sign in to comment.