cmd/tools/segment-verify: log less retry segments

When Check == 0 (check all pieces), there is nearly always a piece left
in the retry count, so most segments get logged in segments-retry.csv.
This change makes it so we require retry>5 before adding to
segments-retry.csv (only in the check==0 case).

Change-Id: Iaea523c27eb777e3c248c27c7ef5effe77ae54cf
This commit is contained in:
paul cannon 2022-12-22 18:07:11 -06:00 committed by Storj Robot
parent 6492a777eb
commit b2422caaef

View File

@ -457,9 +457,7 @@ func (service *Service) ProcessSegments(ctx context.Context, segments []*Segment
for _, segment := range segments { for _, segment := range segments {
if segment.Status.NotFound > 0 { if segment.Status.NotFound > 0 {
notFound = append(notFound, segment) notFound = append(notFound, segment)
} else if segment.Status.Retry > 0 { } else if (service.config.Check > 0 && segment.Status.Retry > 0) || segment.Status.Retry > 5 {
// TODO: should we do a smarter check here?
// e.g. if at least half did find, then consider it ok?
retry = append(retry, segment) retry = append(retry, segment)
} }
} }