sashapolo commented on code in PR #7610:
URL: https://github.com/apache/ignite-3/pull/7610#discussion_r2847017289
##########
modules/raft/src/main/java/org/apache/ignite/internal/raft/storage/segstore/SegmentFileManager.java:
##########
@@ -96,6 +96,12 @@ class SegmentFileManager implements ManuallyCloseable {
private static final int ROLLOVER_WAIT_TIMEOUT_MS = 30_000;
+ /**
+ * Maximum number of times we try to read data from a segment file
returned based the index before giving up and throwing an
+ * exception. See {@link #readFromOtherSegmentFiles} for more information.
+ */
+ private static final int MAX_NUM_INDEX_FILE_READ_RETRIES = 5;
Review Comment:
Imagine the following situation:
1. A thread calls `readFromOtherSegmentFiles` ->
`indexFileManager.getSegmentFilePointer` and obtains a pointer to a segment
file;
2. GC happens and the segment file is compacted, the pointer is invalid,
because the generation has changed;
3. The thread wakes up and fails to find the file.
We can indeed do this indefinitely, I've added limited retries just in case.
Do you think this is an overkill?
--
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]