Skip to content

[FIXED] Freeze n.Applied for cluster when shutting down#6087

Merged
derekcollison merged 1 commit intomainfrom
maurice/freeze-cluster-applied-shutdown
Nov 7, 2024
Merged

[FIXED] Freeze n.Applied for cluster when shutting down#6087
derekcollison merged 1 commit intomainfrom
maurice/freeze-cluster-applied-shutdown

Conversation

@MauriceVanVeen
Copy link
Copy Markdown
Member

During shutdown calls to js.processConsumerAssignment can short-circuit with:

	if s == nil || noMeta || shuttingDown {
		return
	}

Ensure that we don't up n.Applied and snapshot after while we're shutting down, as we can't be sure we've actually applied those entries.

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner November 7, 2024 15:48
Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/freeze-cluster-applied-shutdown branch from 37ad640 to 1720f62 Compare November 7, 2024 18:28
@derekcollison derekcollison self-requested a review November 7, 2024 19:05
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

@derekcollison derekcollison merged commit ffaae38 into main Nov 7, 2024
@derekcollison derekcollison deleted the maurice/freeze-cluster-applied-shutdown branch November 7, 2024 19:06
neilalexander added a commit that referenced this pull request Nov 12, 2024
Includes the following:

* Some tweaks to the NRG test helpers
* #6055
* #6061
* #6065 
* #6041 (but with `math/rand`
instead of `math/rand/v2` due to an older Go version in CI for 2.10.x)
* #6066
* #6067
* #6069
* #6075
* #6082
* #6087
* #6086
* #6088
* #6089
* #6092
* #6096
* #6098
* #6097
* #6105
* #6104
* #6106
* #6109
* #6111
* #6112

Signed-off-by: Neil Twigg <neil@nats.io>
derekcollison added a commit that referenced this pull request Nov 14, 2024
Similar to #6087, but for
consumers. During shutdown we can't guarantee we'll still flush all that
is needed. So don't touch `n.Applied` and rely on replay so those
changes can be properly persisted.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
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