Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <ihusharp@gmail.com>
  • Loading branch information
HuSharp committed Aug 3, 2023
1 parent 4ce9584 commit 93d4341
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2481,10 +2481,14 @@ func (c *RaftCluster) GetMinResolvedTS() uint64 {
func (c *RaftCluster) GetStoreMinResolvedTS(storeID uint64) uint64 {
c.RLock()
defer c.RUnlock()
if !c.isInitialized() || !core.IsAvailableForMinResolvedTS(c.GetStore(storeID)) {
if c.GetStore(storeID) == nil {
return math.MaxUint64
}
return c.GetStore(storeID).GetMinResolvedTS()
store := c.GetStore(storeID)
if !c.isInitialized() || !core.IsAvailableForMinResolvedTS(store) {
return math.MaxUint64
}
return store.GetMinResolvedTS()
}

// GetExternalTS returns the external timestamp.
Expand Down
1 change: 0 additions & 1 deletion server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1894,7 +1894,6 @@ func (s *Server) GetMinResolvedTS() uint64 {

// GetMinResolvedTSByStoreIDs returns the min resolved ts of the stores.
func (s *Server) GetMinResolvedTSByStoreIDs(ids []uint64) (uint64, []*pdpb.StoreMinResolvedTS) {
println("GetMinResolvedTSByStoreIDs", ids)
minResolvedTS := uint64(math.MaxUint64)
stores := make([]*pdpb.StoreMinResolvedTS, len(ids))
for i, storeID := range ids {
Expand Down

0 comments on commit 93d4341

Please sign in to comment.