report empty volume or ec shards
This commit is contained in:
@@ -191,6 +191,7 @@ func (s *Store) CollectHeartbeat() *master_pb.Heartbeat {
|
||||
DataCenter: s.dataCenter,
|
||||
Rack: s.rack,
|
||||
Volumes: volumeMessages,
|
||||
HasNoVolumes: len(volumeMessages) == 0,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ func (s *Store) CollectErasureCodingHeartbeat() *master_pb.Heartbeat {
|
||||
}
|
||||
|
||||
return &master_pb.Heartbeat{
|
||||
EcShards: ecShardMessages,
|
||||
EcShards: ecShardMessages,
|
||||
HasNoEcShards: len(ecShardMessages) == 0,
|
||||
}
|
||||
|
||||
}
|
||||
@@ -221,11 +222,11 @@ func (s *Store) cachedLookupEcShardLocations(ctx context.Context, ecVolume *eras
|
||||
|
||||
shardCount := len(ecVolume.ShardLocations)
|
||||
if shardCount < erasure_coding.DataShardsCount &&
|
||||
ecVolume.ShardLocationsRefreshTime.Add(11*time.Second).After(time.Now()) ||
|
||||
ecVolume.ShardLocationsRefreshTime.Add(11 * time.Second).After(time.Now()) ||
|
||||
shardCount == erasure_coding.TotalShardsCount &&
|
||||
ecVolume.ShardLocationsRefreshTime.Add(37*time.Minute).After(time.Now()) ||
|
||||
ecVolume.ShardLocationsRefreshTime.Add(37 * time.Minute).After(time.Now()) ||
|
||||
shardCount >= erasure_coding.DataShardsCount &&
|
||||
ecVolume.ShardLocationsRefreshTime.Add(7*time.Minute).After(time.Now()) {
|
||||
ecVolume.ShardLocationsRefreshTime.Add(7 * time.Minute).After(time.Now()) {
|
||||
// still fresh
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user