You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "bxfjb (via GitHub)" <gi...@apache.org> on 2025/03/11 02:32:17 UTC
[I] [Bug] Querying message in tiered storage may fail due to small time scope [rocketmq]
bxfjb opened a new issue, #9233:
URL: https://github.com/apache/rocketmq/issues/9233
### Before Creating the Bug Report
- [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq/discussions).
- [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq/issues) and [GitHub Discussions](https://github.com/apache/rocketmq/discussions) of this repository and believe that this is not a duplicate.
- [x] 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`:
```
@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_
--
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: commits-unsubscribe@rocketmq.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Querying message in tiered storage may fail due to small time scope [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #9233: [Bug] Querying message in tiered storage may fail due to small time scope
URL: https://github.com/apache/rocketmq/issues/9233
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] Querying message in tiered storage may fail due to small time scope [rocketmq]
Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #9233:
URL: https://github.com/apache/rocketmq/issues/9233#issuecomment-2712444624
Good catch
--
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: commits-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org