Before Creating the Bug Report
Runtime platform environment
any
RocketMQ version
develop
JDK Version
jdk8
Describe the Bug
I found following code in org.apache.rocketmq.tieredstore.index.IndexStoreService:
@Override
public CompletableFuture<List<IndexItem>> queryAsync(
String topic, String key, int maxCount, long beginTime, long endTime) {
CompletableFuture<List<IndexItem>> future = new CompletableFuture<>();
try {
readWriteLock.readLock().lock();
ConcurrentNavigableMap<Long, IndexFile> pendingMap =
this.timeStoreTable.subMap(beginTime, true, endTime, true);
List<CompletableFuture<Void>> futureList = new ArrayList<>(pendingMap.size());
...
The pendingMap is the actual queried index file map, key is create timestamp of the file. But it seemed that ConcurrentSkipListMap.subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) is used wrongly here: the sub map may miss the first index file contains the correct message.
Steps to Reproduce
Enable index build, produce some message, stop production before creating the 2nd index file, query message with time range [a,b] (a > 0), the pendingMap should be empty.
What Did You Expect to See?
The query should return correct result.
What Did You See Instead?
Can not find message in tiere storage.
Additional Context
No response
Before Creating the Bug Report
I found a bug, not just asking a question, which should be created in GitHub Discussions.
I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment
any
RocketMQ version
develop
JDK Version
jdk8
Describe the Bug
I found following code in
org.apache.rocketmq.tieredstore.index.IndexStoreService:The
pendingMapis the actual queried index file map, key is create timestamp of the file. But it seemed thatConcurrentSkipListMap.subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)is used wrongly here: the sub map may miss the first index file contains the correct message.Steps to Reproduce
Enable index build, produce some message, stop production before creating the 2nd index file, query message with time range [a,b] (a > 0), the
pendingMapshould be empty.What Did You Expect to See?
The query should return correct result.
What Did You See Instead?
Can not find message in tiere storage.
Additional Context
No response