Skip to content

Conversation

@zyxxoo
Copy link
Contributor

@zyxxoo zyxxoo commented Sep 16, 2025

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
Copy link

codecov bot commented Sep 16, 2025

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.

@zyxxoo zyxxoo requested a review from Copilot September 22, 2025 13:25
Copy link
Contributor

Copilot AI left a 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 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()));
Copy link

Copilot AI Sep 22, 2025

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.
@github-actions
Copy link

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

Labels

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

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

1 participant