yandrey321 commented on PR #11783:
URL: https://github.com/apache/ozone/pull/11783#issuecomment-6648472338
@jojochuang good catch!
I fixed it slightly differently from your branch, because checking
`blockStreams[index] == null` leaves a window open:
- Between the sequential retry's `closeStream(index)` and the positioned
read's check, the slot can be reopened. That
can be a stream on the spare, opened by the sequential read, or one opened
by another positioned read.
- The slot is then non-null again, so the failure would still be reported as
a bad location.
So `readPositioned` now records the stream it read for each index. After the
reads, under `streamLock`, a failed index
whose slot no longer holds that stream, whether empty or replaced, is
treated as closed by another reader.
`removeFailuresOfClosedStreams` drops those failures from the results:
- if other indexes failed on streams that are still open,
`BadDataLocationException` is thrown for those only, with
the dropped failure attached as suppressed;
- if only the dropped failures remain, the read throws that plain
`IOException`, so the proxy falls back to a
reconstruction read for this call without recording any failed location.
All tests are passing with a fix.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]