Skip to content

Add autoStepDownWhenLeader to MemberInfo [CORE-216]#545

Merged
gareth-johnston merged 4 commits into
hazelcast:masterfrom
gareth-johnston:CORE-216/abdicating-leadership
Jan 16, 2026
Merged

Add autoStepDownWhenLeader to MemberInfo [CORE-216]#545
gareth-johnston merged 4 commits into
hazelcast:masterfrom
gareth-johnston:CORE-216/abdicating-leadership

Conversation

@gareth-johnston
Copy link
Copy Markdown
Contributor

Adds autoStepDownWhenLeader boolean added to MemberInfo

@gareth-johnston gareth-johnston requested a review from Copilot April 11, 2025 07:19

This comment was marked as spam.

Comment thread protocol-definitions/custom/Custom.yaml Outdated
type: Map_EndpointQualifier_Address
nullable: false
since: 2.0.1
- name: autoStepDownWhenLeader
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- name: autoStepDownWhenLeader
- name: cpAutoStepDownWhenLeader

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

agree that prefixing with cp makes it more understandable, especially for the future readers.

Comment thread protocol-definitions/custom/Custom.yaml
@gareth-johnston gareth-johnston force-pushed the CORE-216/abdicating-leadership branch from daccd74 to 83d5aaa Compare April 28, 2025 16:12
Copy link
Copy Markdown
Contributor

@JamesHazelcast JamesHazelcast left a comment

Choose a reason for hiding this comment

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

I agree with @ihsandemir that prefixing with cp makes sense, to provide extra clarity - approving in advance though 👍

@gareth-johnston
Copy link
Copy Markdown
Contributor Author

I agree with @ihsandemir that prefixing with cp makes sense, to provide extra clarity - approving in advance though 👍

Do you think that is still relevant now? That comment was relating to when we were changing memberInfo - absolutely in that case. But now we are only changing CPMember -- I believe it is clear enough in this case, do you feel strongly?

@JamesHazelcast
Copy link
Copy Markdown
Contributor

Do you think that is still relevant now? That comment was relating to when we were changing memberInfo - absolutely in that case. But now we are only changing CPMember -- I believe it is clear enough in this case, do you feel strongly?

Ah, apologies - no I don't think it's relevant in that case, all good to go from my POV

@devOpsHazelcast
Copy link
Copy Markdown
Contributor

PR closed by Hazelcast automation as no activity (>3 months). Please reopen with comments, if necessary. Thank you for using Hazelcast and your valuable contributions

@gareth-johnston gareth-johnston force-pushed the CORE-216/abdicating-leadership branch from 22571cd to 289e0a7 Compare January 14, 2026 13:54
devOpsHazelcast pushed a commit to hazelcast/hazelcast that referenced this pull request Jan 16, 2026
Adds new feature to prevent undesirable members leading a `Raft Group`
in the `CPSubsystem`. A node configured with `autoStepDownWhenLeader`
follows a new code path which :

1/ Refuses Replication OPs.
2/ Invokes an immediate leadership rebalancing procedure to transfer
leadership to higher priority node.

This change ensures that:

1/ Such a member can lead the `METADATA` group.
2/ Such a member will not have a Raft Group rebalanced to it.
3/ A Raft Group can not be created with exclusively members configured
with `autoStepDownWhenLeader` (always prioritizing leader capable
members from the pool).
4/ Initial election on term 0 is avoided by nodes configured with
`autoStepDownWhenLeader`
5/ Can be configured both by programatic and static Configurations.
6/ Testing has been added for various cases and Improvements in unit
testing for various classes.
7/ Requires majority leader-capable nodes on discovery, group creation and promotion.

Small follow up changes to come in later work.

ClientProtocol changes:
hazelcast/hazelcast-client-protocol#545

Checklist:
- [X] Labels (`Team:`, `Type:`, `Source:`, `Module:`) and Milestone set
- [X] Architecture Design Record (ADR) reviewed and signed-off if this
PR represents a significant architectural change
- [X] Request reviewers if possible
GitOrigin-RevId: 7700a31506071a0ea9f7ac5f3ac2e86872165169
@gareth-johnston gareth-johnston enabled auto-merge (squash) January 16, 2026 17:51
@gareth-johnston gareth-johnston dismissed ihsandemir’s stale review January 16, 2026 17:57

Outdated - hasn't responded

@gareth-johnston gareth-johnston merged commit ad96b01 into hazelcast:master Jan 16, 2026
8 checks passed
- name: autoStepDownWhenLeader
type: boolean
nullable: false
since: 2.9
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be 2.10 for 5.7. 2.9 was used for platform 5.6.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants