oss-taishan-ai commented on issue #10421:
URL: https://github.com/apache/rocketmq/issues/10421#issuecomment-4620091796

   **Issue Evaluation**
   
   Category: `type/bug` | Status: **Confirmed**
   
   The reported issue has been verified against the current codebase.
   
   **Root Cause:** `MessageRocksDBStorage.java:87` — 
`DELETE_KEY_CACHE_FOR_TIMER` is declared as `Cache<byte[], byte[]>` (Guava). 
`byte[].equals()` uses identity comparison, so `getIfPresent(keyBytes)` at line 
359 always returns `null` even when the key was just `put()` at line 357. 
`TimerRocksDBRecord.getKeyBytes()` allocates a new array on every call, so 
identity never matches.
   
   **Impact:** When a timer/delay message is consumed (DELETE) and concurrently 
rolled (UPDATE), the guard fails to detect the prior deletion. UPDATE 
re-inserts the deleted key as a ghost record in RocksDB.
   
   **Severity:** medium
   
   **Fix:** Use a content-equality key type (e.g. `ByteBuffer.wrap(keyBytes)` 
or `String`) instead of raw `byte[]` for both `put` and `getIfPresent`.
   
   ---
   *Automated evaluation by github-manager-bot*
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to