From 2b01126366935087f11e2535ca5c914463242006 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Wed, 15 May 2024 17:47:27 +0800 Subject: [PATCH] add leader peer id log Signed-off-by: crazycs520 --- internal/locate/region_request.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index ffa38a7f9b..3b49a7342c 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -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 { @@ -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.