[Bug] Replacing topic metadata preserves a stale update timestamp
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- java
- Domain
- distributed-systems
Research direction
Start with DefaultMetadataStore.updateTopic and the deterministic reproduction in DefaultMetadataStoreTest. Trace which TopicMetadata instance receives the timestamp before the map entry is replaced. Done means reading back the replacement object shows a fresh positive updateTimestamp, with the regression test passing.
Written by the indexing model from the issue text.
Description
Before Creating the Bug Report
- I found a bug, not just a question.
- I searched open GitHub Issues and pull requests and found no duplicate.
- I confirmed that this bug belongs to Apache RocketMQ.
Runtime platform environment
macOS (Darwin), reproduced with an isolated local unit test.
RocketMQ version
Branch: develop
Git commit: fd0c95920e0deac96ce2ae27442747cc5e65e930
JDK Version
Zulu OpenJDK 8 (8.94.0.17)
Describe the Bug
DefaultMetadataStore.updateTopic refreshes the update timestamp on the currently stored metadata object, then replaces the map entry with the caller-provided TopicMetadata. When the caller supplies a distinct replacement object, the stored object keeps its stale timestamp.
Steps to Reproduce
- Add topic metadata to DefaultMetadataStore.
- Create a distinct TopicMetadata replacement for the same topic with updateTimestamp set to 0.
- Call updateTopic with the replacement.
- Read the metadata back from the store.
What Did You Expect to See?
The replacement object stored in the table should have a fresh positive update timestamp.
What Did You See Instead?
The replacement is stored with updateTimestamp still equal to 0; only the discarded old object was refreshed.
Additional Context
The behavior is deterministic in DefaultMetadataStoreTest.
- Dominant language
- Java
- Stars
- 22.6k
- Forks
- 12k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/rocketmq
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
[Bug] TopicValidator rejects V2 retry topic names containing `+` separator introduced by KeyBuilder Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100