apache / apache/rocketmq

[Bug] Incorrect end timestamp recovery in tiered index files

Open Beginner friendly
#10,656 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
22.6k
Forks
12k
Avg merge
3d 1h
Merged PRs (30d)
27

Description

### 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

All

### RocketMQ version

develop

### JDK Version

All

### Describe the Bug

`IndexStoreFile` reads `endTimestamp` from `INDEX_BEGIN_TIME_STAMP` instead of `INDEX_END_TIME_STAMP` during recovery.

### Steps to Reproduce

Write an index whose timestamp is later than the file’s begin timestamp, then close and reopen the file.

### What Did You Expect to See?

The reopened file should retain the persisted end timestamp.

### What Did You See Instead?

The end timestamp becomes the begin timestamp, which can cause valid query results to be skipped.

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Research direction

Locate IndexStoreFile and inspect its recovery logic, especially how INDEX_BEGIN_TIME_STAMP and INDEX_END_TIME_STAMP are read. Reproduce the reported case by writing an index with a later end timestamp, closing and reopening it, and confirm that recovery preserves the persisted end timestamp and query results are not skipped.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.