-
Notifications
You must be signed in to change notification settings - Fork 222
[ISSUE #4363]Remove unused table_size_for method #4364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes mxsm#4363 This commit removes the unused table_size_for method from the TopicQueueLock implementation in rocketmq-store/src/base/topic_queue_lock.rs.
|
🔊@kl2400033266 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughRemoved the private Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR attempts to remove the table_size_for method from the TopicQueueLock implementation, claiming it is unused dead code. However, this change introduces critical compilation failures as the function is actively used by multiple test cases within the same file.
Key Issues
- Critical Bug: The removed function is called by 7 test functions (lines 78-110)
- The PR description incorrectly states "All tests continue to pass after removal"
- The
MAXIMUM_CAPACITYconstant will also become unused after the proper cleanup
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| n + 1 | ||
| } | ||
| } | ||
|
|
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the table_size_for function will cause compilation failures. Multiple tests in the same file (lines 78-110) call this function:
calculates_table_size_for_zero_capacity()(line 79)calculates_table_size_for_one_capacity()(line 84)calculates_table_size_for_exact_power_of_two()(line 89)calculates_table_size_for_just_above_power_of_two()(line 94)calculates_table_size_for_maximum_capacity()(line 99)calculates_table_size_for_above_maximum_capacity()(line 104)calculates_table_size_for_large_number()(line 109)
These tests need to be removed along with the function, or the function should not be removed if the functionality is still being tested.
|
🔊@kl2400033266 🚀Thanks for your contribution🎉! 💡CodeRabbit(AI) will review your code first🔥! Note 🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥. |
mxsm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kl2400033266 Thanks for your contribution. LGTM
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4364 +/- ##
==========================================
- Coverage 28.43% 28.40% -0.03%
==========================================
Files 630 630
Lines 90165 90133 -32
==========================================
- Hits 25636 25604 -32
Misses 64529 64529 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rocketmq-rust-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - All CI checks passed ✅
Which Issue(s) This PR Fixes
Fixes #4363
Brief Description
This PR removes the unused
table_size_formethod from theTopicQueueLockimplementation inrocketmq-store/src/base/topic_queue_lock.rs. The method was identified as dead code and removing it helps clean up the codebase.Changes Made
table_size_formethod (lines 71-85) fromtopic_queue_lock.rsTesting
The existing test suite confirms this method is not required for any functionality. All tests continue to pass after removal.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.