Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

improve: raft state machine should report error#2871

Open
zyxxoo wants to merge 1 commit into
master from
feat_sailuo
Open

improve: raft state machine should report error #2871
zyxxoo wants to merge 1 commit into
master from
feat_sailuo

Conversation

@zyxxoo

@zyxxoo zyxxoo commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Purpose of the PR

  • close #xxx

Main Changes

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)
  • Already covered by existing tests, such as (please modify tests here).
  • Need tests and can be verified as follows:
    • xxx

Does this PR potentially affect the following parts?

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. pd PD module raft store Store module labels Sep 16, 2025

codecov Bot commented Sep 16, 2025
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 40.92%. Comparing base (0946d5d) to head (f007f1e).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
...ache/hugegraph/store/raft/HgStoreStateMachine.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@
## master #2871 +/- ##
============================================
+ Coverage 40.91% 40.92% +0.01% 
 Complexity 333 333 
============================================
 Files 747 747 
 Lines 60168 60169 +1 
 Branches 7683 7683 
============================================
+ Hits 24615 24623 +8 
+ Misses 32975 32968 -7 
 Partials 2578 2578 

☔ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 improves error handling in Raft state machines by ensuring that errors are properly reported to the iterator when exceptions occur during state machine operations.

  • Adds error reporting via setErrorAndRollback() when exceptions are caught during state machine operations
  • Implements consistent error handling across both store and PD components

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
HgStoreStateMachine.java Adds error reporting call when exceptions occur during state machine operations
RaftStateMachine.java Adds error reporting call when exceptions occur during state machine operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if (done != null) {
done.run(new Status(RaftError.EINTERNAL, t.getMessage()));
}
iter.setErrorAndRollback(1, new Status(RaftError.ESTATEMACHINE, t.getMessage()));

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

[nitpick] The hardcoded rollback count '1' should be extracted as a named constant to improve code readability and maintainability. Consider defining a constant like 'ROLLBACK_COUNT = 1' to make the intent clearer.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown

Due to the lack of activity, the current pr is marked as stale and will be closed after 180 days, any update will remove the stale label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

inactive pd PD module raft size:XS This PR changes 0-9 lines, ignoring generated files. store Store module

Projects

Status: In progress

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /