Skip to content
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

Vault 6773/raft rejoin nonvoter #16324

Merged
merged 4 commits into from Jul 18, 2022
Merged

Vault 6773/raft rejoin nonvoter #16324

merged 4 commits into from Jul 18, 2022

Conversation

mpalmi
Copy link
Contributor

@mpalmi mpalmi commented Jul 18, 2022

raft: Ensure init before setting suffrage

@mladlow mladlow added this to the 1.9.8 milestone Jul 18, 2022
As reported in https://hashicorp.atlassian.net/browse/VAULT-6773:

	The /sys/storage/raft/join endpoint is intended to be unauthenticated. We rely
	on the seal to manage trust.

	It’s possible to use multiple join requests to switch nodes from voter to
	non-voter. The screenshot shows a 3 node cluster where vault_2 is the leader,
	and vault_3 and vault_4 are followers with non-voters set to false.  sent two
	requests to the raft join endpoint to have vault_3 and vault_4 join the cluster
	with non_voters:true.

This commit fixes the issue by delaying the call to SetDesiredSuffrage until after
the initialization check, preventing unauthenticated mangling of voter status.

Tested locally using
https://github.com/hashicorp/vault-tools/blob/main/users/ncabatoff/cluster/raft.sh
and the reproducer outlined in VAULT-6773.
This is necessary to correctly distinguish errors returned from the Join
workflow. Previously, errors were being masked as timeouts.
Change some defaults so we don't have to pass in parameters or set them
in the originating tests. These storage types are only used in two
places:

1) Raft HA testing
2) Seal migration testing

Both consumers have been tested and pass with this change.
@mpalmi mpalmi force-pushed the VAULT-6773/raft-rejoin-nonvoter branch from 434a813 to 1f1b484 Compare July 18, 2022 15:39
@mpalmi mpalmi force-pushed the VAULT-6773/raft-rejoin-nonvoter branch from 1f1b484 to 1a54726 Compare July 18, 2022 15:43
@mpalmi mpalmi added backport/1.9.x bug Used to indicate a potential bug labels Jul 18, 2022
Copy link
Contributor

@hghaf099 hghaf099 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants