Skip to content

epoch cache#4123

Merged
mxsm merged 1 commit intomxsm:mainfrom
watchgou:broker-epoch
Oct 6, 2025
Merged

epoch cache#4123
mxsm merged 1 commit intomxsm:mainfrom
watchgou:broker-epoch

Conversation

@watchgou
Copy link
Contributor

@watchgou watchgou commented Sep 26, 2025

Which Issue(s) This PR Fixes(Closes)

Fixes #4132

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • Refactor
    • Streamlined epoch cache initialization by inlining values and removing intermediary variables, reducing indirection.
    • Potential minor improvements in startup/runtime efficiency and resource usage.
    • No user-facing behavior changes; existing workflows, configuration, and monitoring remain unaffected.
    • No API or protocol changes; full compatibility maintained with current deployments and clients.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Walkthrough

Refactors EpochEntryCache initialization in broker_epoch_cache_handler.rs by removing intermediary local variables and directly passing fields/method calls: cluster name, broker name, broker id, epoch entries, and max physical offset. No public API changes or behavior alterations indicated.

Changes

Cohort / File(s) Summary of Changes
Broker epoch cache init refactor
rocketmq-broker/src/processor/admin_broker_processor/broker_epoch_cache_handler.rs
Inlined constructor arguments for EpochEntryCache: used &broker_identity.broker_cluster_name, broker_config.broker_name(), broker_identity.broker_id, replicas_manage.get_epoch_entries(), and message_store.get_max_phy_offset() as u64, removing temporary locals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudged the vars, hop-hop, away,
Inlined the paths to clear the way.
Epochs align, offsets in view,
Broker beats steady, crisp and true.
Tiny paws tidy, cache feels light—
Commit, carrot, and call it a night. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “epoch cache” is too generic and does not clearly summarize the main change of simplifying the EpochEntryCache initialization in the broker processor; it lacks a verb and context necessary to convey the purpose or scope of the update. Please revise the title to a concise sentence that highlights the core change, for example “Simplify EpochEntryCache initialization in broker processor.”
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rocketmq-rust-bot rocketmq-rust-bot added the AI review first Ai review pr first label Sep 26, 2025
@rocketmq-rust-bot
Copy link
Collaborator

🔊@watchgou 🚀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💥.

@codecov
Copy link

codecov bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.57%. Comparing base (8c33d42) to head (9f381fc).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
...min_broker_processor/broker_epoch_cache_handler.rs 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4123   +/-   ##
=======================================
  Coverage   26.57%   26.57%           
=======================================
  Files         576      576           
  Lines       81403    81398    -5     
=======================================
  Hits        21635    21635           
+ Misses      59768    59763    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rocketmq-rust-robot rocketmq-rust-robot added the refactor♻️ refactor code label Oct 6, 2025
@mxsm mxsm merged commit 810742f into mxsm:main Oct 6, 2025
16 of 25 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Oct 6, 2025
@watchgou watchgou deleted the broker-epoch branch October 9, 2025 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI review first Ai review pr first approved PR has approved auto merge refactor♻️ refactor code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️]Streamlined epoch cache initialization by inlining values and removing intermediary variables, reducing indirection

4 participants