oss-sentinel-ai commented on issue #10453:
URL: https://github.com/apache/rocketmq/issues/10453#issuecomment-4656296174

   ## Assessment by github-manager-bot
   
   **Classification:** 🐛 Bug
   
   ### Summary
   The issue reports an LMQ counter underflow bug in 
`RocksDBConsumeQueueOffsetTable`:
   - When a `get*` operation is called for a non-existent LMQ topic, a sentinel 
value `-1L` is placed into `topicQueueMaxCqOffset` **without incrementing 
`lmqCounter`**
   - When this topic is later deleted, `removeHelperTopic` decrements 
`lmqCounter`, causing an unexpected underflow
   
   ### Analysis
   This is a valid bug report from a known contributor. The issue describes a 
specific code path where:
   1. **Creation path**: Non-existent topic lookup → sentinel value inserted → 
counter NOT incremented
   2. **Deletion path**: Topic deleted → counter decremented → **underflow**
   
   This is a classic counter mismatch bug that can lead to incorrect LMQ topic 
counts.
   
   ### Recommendation
   ✅ **Valid bug.** The root cause is clear: the sentinel value insertion path 
doesn't maintain the counter invariant. A fix should either:
   - Increment `lmqCounter` when inserting the sentinel value, OR
   - Track sentinel entries separately and skip counter decrement for them 
during deletion
   
   This requires maintainer review to confirm the fix approach.
   
   ---
   *Automated assessment 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