[BUG] StreamReader endless loop
Closed this issue · 1 comments
superhx commented
2024-05-31 10:07:20.553 +0800 ERROR [com.automq.stream.s3.S3Storage] [POTENTIAL_BUG] read from block cache timeout, stream=20948, [311613,325507), maxBytes: 1048576
2024-05-31 10:06:50.556 +0800 ERROR [com.automq.stream.s3.S3Storage] [POTENTIAL_BUG] read from block cache timeout, stream=20948, [311613,325507), maxBytes: 1048576
superhx commented
Problem Cause: Both Consumer consume the same offset using one StreamReader.
- Consumer1 acquires a StreamReader with readOffset=10 and tries to read [10, 40).
- Consumer2 acquires the same StreamReader as step 1 with readOffset=10 and tries to read [10, 30).
- Consumer1 finishes reading first and clears the blocks corresponding to [10, 40) from the StreamReader.
- Consumer2 #getBlocks0, floorKey can only obtain null, and #loadMoreBlocksWithoutData can only load blocks after 40, causing Consumer2's read requests to keep looping in #getBlocks0.