Skip to content

NRG: Reset election timer when leaving observer mode#5516

Merged
derekcollison merged 1 commit intomainfrom
neil/jscmrecovery
Jun 11, 2024
Merged

NRG: Reset election timer when leaving observer mode#5516
derekcollison merged 1 commit intomainfrom
neil/jscmrecovery

Conversation

@neilalexander
Copy link
Copy Markdown
Member

Previously if runAsFollower or PauseApply had ran while in observer state, i.e. due to jetstream_cluster_migrate being set when leafnode connections dropped, then the election timer would have been reset to a very high value. Then leaving observer state wouldn't have noticed the lack of a leader for some time. This fix allows a leadership election to take place very quickly after leaving observer mode.

Signed-off-by: Neil Twigg neil@nats.io

@neilalexander neilalexander requested a review from a team as a code owner June 11, 2024 10:07
@neilalexander neilalexander force-pushed the neil/jscmrecovery branch 2 times, most recently from 173523e to 2dcd72e Compare June 11, 2024 12:36
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM - One minor nit.

Previously if `runAsFollower` or `PauseApply` had ran while in observer
state, i.e. due to `jetstream_cluster_migrate` being set when leafnode
connections dropped, then the election timer would have been reset to a
very high value. Then leaving observer state wouldn't have noticed the
lack of a leader for some time. This fix allows a leadership election to
take place very quickly after leaving observer mode.

Signed-off-by: Neil Twigg <neil@nats.io>
@derekcollison derekcollison merged commit 64192f6 into main Jun 11, 2024
@derekcollison derekcollison deleted the neil/jscmrecovery branch June 11, 2024 14:24
wallyqs added a commit that referenced this pull request Jun 11, 2024
Includes the following:

* #5515
* #5516 
* #5517
* #5519
* #5514 
* #5521 
* #5522 

Signed-off-by: Neil Twigg <neil@nats.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants