Skip to content

Conversation

@mahanteshwar-git
Copy link

@mahanteshwar-git mahanteshwar-git commented Jul 28, 2025

What this PR does

This PR adds support for promote member invocation for the new members which are added a learner nodes.

Why this is useful

The existing add members support adding member as a learner. However there is no support for promoting the
member as regular raft voting member. This feature attempts to address this.

Implementation Details

  • Added a new method: promoteMember in the ClusterClient
  • Updated ClusterMembersTest to include unit tests for invoking promoteMember

Related Issues / Discussions

This change was based on discussion in #1499


Checklist

  • Code compiles successfully
  • Tests added / updated
  • Documentation updated (if needed)
  • Ready for review

@mahanteshwar-git mahanteshwar-git force-pushed the feature/add-promote-member-support branch 2 times, most recently from 304e69b to 97bb7fb Compare July 28, 2025 15:58
@mahanteshwar-git
Copy link
Author

/approve

@k8s-ci-robot
Copy link

@mahanteshwar-git: you cannot LGTM your own PR.

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mahanteshwar-git
Copy link
Author

Hi @lburgazzoli , @fanminshi , @vorburger ,

Please review the pull request

@mahanteshwar-git mahanteshwar-git force-pushed the feature/add-promote-member-support branch 2 times, most recently from 334d483 to 719d434 Compare July 28, 2025 21:53
@mahanteshwar-git
Copy link
Author

fixed spotless errors.

@vorburger vorburger requested a review from Copilot August 3, 2025 19:31
Copy link

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 adds support for promoting etcd cluster members from learner (non-voting) status to full voting members through a new promoteMember API method.

  • Implements the MemberPromote gRPC service endpoint with request/response message types
  • Adds promoteMember method to the Cluster interface and ClusterImpl implementation
  • Creates MemberPromoteResponse class to handle the promote operation response

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
jetcd-grpc/src/main/proto/rpc.proto Adds MemberPromote gRPC service method and message definitions
jetcd-core/src/main/proto/rpc.proto Duplicates the gRPC service method and message definitions
jetcd-core/src/main/java/io/etcd/jetcd/Cluster.java Adds promoteMember method signature to Cluster interface
jetcd-core/src/main/java/io/etcd/jetcd/impl/ClusterImpl.java Implements promoteMember method in ClusterImpl
jetcd-core/src/main/java/io/etcd/jetcd/cluster/MemberPromoteResponse.java Creates response wrapper class for member promote operations
jetcd-core/src/test/java/io/etcd/jetcd/impl/ClusterMembersTest.java Adds integration test for the new promoteMember functionality
Comments suppressed due to low confidence (1)

jetcd-core/src/test/java/io/etcd/jetcd/impl/ClusterMembersTest.java:131

  • The test only verifies the failure case when promoting a learner that is not in sync with the leader. Consider adding a positive test case that successfully promotes a member when conditions are met, or at least verify the specific error message more precisely to ensure the correct API endpoint is being called.
        // Now attempt to promote a member. Although it fails, it confirms that API was executed.

@mahanteshwar-git mahanteshwar-git force-pushed the feature/add-promote-member-support branch from 0fce633 to 79c7156 Compare August 4, 2025 01:04
@mahanteshwar-git mahanteshwar-git force-pushed the feature/add-promote-member-support branch from 79c7156 to db96465 Compare August 4, 2025 01:22
@k8s-ci-robot
Copy link

[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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mahanteshwar-git
Copy link
Author

Hi @vorburger,

Would it be possible to take another look at the Pr and approve if the changes look reasonable ?

@lburgazzoli lburgazzoli merged commit 2e9f41d into etcd-io:main Nov 1, 2025
9 checks passed
@mahanteshwar-git mahanteshwar-git deleted the feature/add-promote-member-support branch November 1, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants