apache / apache/rocketmq

Compaction OffsetMap fails when hash index is Integer.MIN_VALUE

Open Beginner friendly
#10,831 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

CompactionLog.OffsetMap uses Math.abs(index) before applying the table capacity. Math.abs(Integer.MIN_VALUE) remains negative, which can produce a negative ByteBuffer position and break compaction lookup. Expected behavior: map every hash value, including Integer.MIN_VALUE, to a valid non-negative entry.

Contributor guide

Open the contributing guide

Research direction

Search for CompactionLog.OffsetMap and inspect how its hash index is converted before the table capacity is applied. Add coverage for Integer.MIN_VALUE and verify that compaction lookup maps it to a valid non-negative entry without producing an invalid ByteBuffer position.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.