-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[ISSUE #1838]🚀AckMessageProcessor supports RequestCode AckMessage(200051) #1842
Conversation
WalkthroughThe pull request introduces an enhanced Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
🔊@mxsm 🚀Thanks for your contribution 🎉. CodeRabbit(AI) will review your code first 🔥 |
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.
Actionable comments posted: 0
🧹 Nitpick comments (6)
rocketmq-broker/src/processor/ack_message_processor.rs (4)
33-36
: Use clearer documentation for fields in the AckMessageProcessor struct.Consider adding doc comments for the fields (topic_config_manager and message_store) to better convey their purpose and how they're intended to be used within the processor. This can aid future maintainability.
53-72
: Wrap unsupported request codes in logs.Right now, the processor returns a response code for unsupported request codes. Consider adding an explicit warning or info log that an unsupported request was received, to simplify debugging.
144-152
: Implement process_batch_ack or remove temporarily.This method is marked unimplemented, but it is publicly available. If it’s tied to an upcoming feature, consider adding a TODO comment with a timeline or referencing an issue so that future maintainers know how and when it will be completed.
154-161
: Clarify error handling in append_ack.Since this is also unimplemented, consider clarifying how errors during ack appending should be handled. For instance, consider whether partial successes could happen or if every failure is a hard stop.
rocketmq-broker/src/processor.rs (1)
179-186
: Delegate new request codes to the AckMessageProcessor in a uniform manner.These lines branch out to AckMessage or BatchAckMessage. Ensure that future new codes are processed uniformly, possibly utilizing a more extensible approach (e.g. a registry of request handlers).
rocketmq-broker/src/broker_runtime.rs (1)
69-69
: Avoid overusing imports if not strictly required.AckMessageProcessor is imported here. If it’s exclusively used inside init_processor, you may consider localizing its import to that function to reduce global scope. This is optional and mostly a style preference.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
rocketmq-broker/src/broker_runtime.rs
(2 hunks)rocketmq-broker/src/processor.rs
(2 hunks)rocketmq-broker/src/processor/ack_message_processor.rs
(1 hunks)
🔇 Additional comments (5)
rocketmq-broker/src/processor/ack_message_processor.rs (2)
42-50
: Ensure resource initialization is validated in new().
While the constructor accepts the topic config manager and message store, it doesn't perform checks that these parameters are valid or non-empty. Consider validating them to fail fast if they're uninitialized or erroneous.
79-142
: Address potential offset mismatch corner cases in process_ack.
- The offset range checks return “NoMessage” even if the offset is just slightly beyond max_offset. In some cases, the user might expect a different error code or a more specific message.
- Also, consider concurrency aspects when the offset changes between the moment of reading min/max offset and attempting to append ack.
rocketmq-broker/src/processor.rs (1)
69-69
: Ensure consistent generics usage throughout the codebase.
Changing to ArcMut<AckMessageProcessor> requires that any code referencing ack_message_processor carry the same generic parameter. Verify there are no references to AckMessageProcessor without the correct in the rest of the code.
rocketmq-broker/src/broker_runtime.rs (2)
557-557
: Confirm BatchAckMessage synergy with the newly added fields.
The ack_message_processor is placed alongside change_invisible_time_processor. If there are interactions between batch ack and invisible time changes, ensure they align (e.g., partial ack might conflict with invisible time extension).
548-551
: 🛠️ Refactor suggestion
Handle potential initialization failures for AckMessageProcessor.
The new AckMessageProcessor is constructed here. If either topic_config_manager or message_store were not fully initialized or had errors during broker startup, consider short-circuiting initialization or letting the user know of partial failures.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1842 +/- ##
==========================================
- Coverage 28.38% 28.33% -0.05%
==========================================
Files 475 475
Lines 66071 66180 +109
==========================================
Hits 18752 18752
- Misses 47319 47428 +109 ☔ View full report in Codecov by Sentry. |
Which Issue(s) This PR Fixes(Closes)
Fixes #1838
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
AckMessage
andBatchAckMessage
.AckMessageProcessor
for improved request handling and validation.Bug Fixes
Documentation