-
Notifications
You must be signed in to change notification settings - Fork 318
feat: add fields - raftAppliedIndex , errorsList, dbSizeInUse and isLearner in StatusResponse #1502
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
feat: add fields - raftAppliedIndex , errorsList, dbSizeInUse and isLearner in StatusResponse #1502
Conversation
|
Hi @lburgazzoli , @fanminshi , @vorburger , Please review the pull request |
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 adds support for retrieving additional metadata fields in the etcd StatusResponse including raft applied index, error list, database size in use, and learner status. These fields enable better monitoring and decision-making for etcd cluster operations.
Key changes:
- Added four new fields to the StatusResponse protobuf definition
- Exposed these fields through getter methods in the Java StatusResponse class
- Added comprehensive test coverage to verify the new fields are populated correctly
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| jetcd-grpc/src/main/proto/rpc.proto | Added four new fields to StatusResponse message definition |
| jetcd-core/src/main/proto/rpc.proto | Duplicate addition of the same four fields to StatusResponse |
| jetcd-core/src/main/java/io/etcd/jetcd/maintenance/StatusResponse.java | Added getter methods for the new fields with proper documentation |
| jetcd-core/src/test/java/io/etcd/jetcd/impl/MaintenanceTest.java | Enhanced test to verify new fields are present and have expected values |
Comments suppressed due to low confidence (2)
jetcd-core/src/main/java/io/etcd/jetcd/maintenance/StatusResponse.java:111
- The method name 'getIsLearner()' is not conventional for a boolean getter. It should be 'isLearner()' to follow standard Java naming conventions for boolean getters.
public boolean getIsLearner() {
jetcd-core/src/test/java/io/etcd/jetcd/impl/MaintenanceTest.java:83
- The test only verifies that the error list is empty, but doesn't test the case where errors might be present. Consider adding a test case that verifies the behavior when errors are actually returned.
assertThat(statusResponse.getErrorList().size()).isEqualTo(0);
jetcd-core/src/main/java/io/etcd/jetcd/maintenance/StatusResponse.java
Outdated
Show resolved
Hide resolved
…earner in StatusResponse Signed-off-by: mchimang <mahanteshwar.cm@oracle.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lburgazzoli, mahanteshwar-git The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @vorburger, Would it be possible to take another look at the Pr and approve if the changes look reasonable ? |
What this PR does
This PR adds support for retrieving additional fields in StatusResponse
Why this is useful
AppliedRaftIndex in comparison with RaftIndex can be used to determine if the PromoteMember operation could be retried
isLearner call in StatusResponse removes the need for another call to MemberList to determine if the member is a learner
Implementation Details
testMemberStatusto verify that the new fields are indeed present and populatedRelated Issues / Discussions
This change was based on discussion in #1499
Checklist