You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yuluo-yx (via GitHub)" <gi...@apache.org> on 2026/08/08 06:33:01 UTC

[I] Compaction OffsetMap fails when hash index is Integer.MIN_VALUE [rocketmq]

yuluo-yx opened a new issue, #10831:
URL: https://github.com/apache/rocketmq/issues/10831

   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.


-- 
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] Compaction OffsetMap fails when hash index is Integer.MIN_VALUE [rocketmq]

Posted by "beautyarbutin (via GitHub)" <gi...@apache.org>.
beautyarbutin commented on issue #10831:
URL: https://github.com/apache/rocketmq/issues/10831#issuecomment-5791098102

   I would like to pick this up since #10841 was closed without being merged. I will use floor modulus for compaction offset-map buckets and add a deterministic digest-based regression test that produces Integer.MIN_VALUE for both put and get paths.


-- 
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] Compaction OffsetMap fails when hash index is Integer.MIN_VALUE [rocketmq]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #10831:
URL: https://github.com/apache/rocketmq/issues/10831#issuecomment-5225050165

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase (`develop` branch).
   
   **Root Cause:** Compaction `OffsetMap` uses `Math.abs(index) % capacity` to compute bucket positions. When `index == Integer.MIN_VALUE`, `Math.abs(Integer.MIN_VALUE)` returns `Integer.MIN_VALUE` (negative), producing a negative array index and causing `ArrayIndexOutOfBoundsException`.
   
   **Impact:** Compaction fails when any message key hashes to `Integer.MIN_VALUE`, potentially blocking the compaction process entirely.
   
   **Severity:** medium
   
   **Affected code:** `store/src/main/java/org/apache/rocketmq/store/.../CompactionLog.java`
   
   An automated fix proposal will be generated. Reply `/approve` to proceed with PR generation.
   
   ---
   *Automated evaluation by RockteMQ-AI*
   


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