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

storage: fix decommissioning of absent node #23082

Merged
merged 1 commit into from
Feb 26, 2018

Conversation

tbg
Copy link
Member

@tbg tbg commented Feb 26, 2018

When a node is decommissioned in absentia, the gateway node may not be
aware of its most recent liveness entry. Before this bug fix, the
gateway would fail the decommissioning process. Instead, it now falls
back to reading the liveness record from the KV store.

Fixes #17995.

Release note (bug fix): Decommissioning a node that has already been
terminated now works in all cases. Success previously depended on
whether the gateway node "remembered" the absent decommissionee.

@tbg tbg requested a review from a team February 26, 2018 15:27
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@nvanbenschoten
Copy link
Member

Review status: 0 of 2 files reviewed at latest revision, all discussions resolved, some commit checks failed.


pkg/storage/node_liveness.go, line 276 at r1 (raw file):

		// results in unintentional no-ops (due to the Gossip lag); this could be
		// observed by users in principle, too.
		dummyLiveness := &Liveness{NodeID: nodeID} // always catches condition failed

Why don't we create a new method to retrieve the liveness instead of this obscure approach of sending a cput and hoping for the condition failed error? I don't think we need the retry logic in updateLiveness if we're only performing a read.


Comments from Reviewable

@bdarnell
Copy link
Contributor

:lgtm:


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


Comments from Reviewable

@tbg tbg force-pushed the decommission-absent branch from e5cd0c3 to 4381f4e Compare February 26, 2018 17:58
@tbg
Copy link
Member Author

tbg commented Feb 26, 2018

TFTRs!


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion.


pkg/storage/node_liveness.go, line 276 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Why don't we create a new method to retrieve the liveness instead of this obscure approach of sending a cput and hoping for the condition failed error? I don't think we need the retry logic in updateLiveness if we're only performing a read.

Good point, done.


Comments from Reviewable

@nvanbenschoten
Copy link
Member

:lgtm:


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


pkg/storage/node_liveness.go, line 276 at r2 (raw file):

		// results in unintentional no-ops (due to the Gossip lag); this could be
		// observed by users in principle, too.
		oldLiveness := &Liveness{}

Nit: put oldLiveness on the stack instead of dereferencing everywhere below.


Comments from Reviewable

@tbg tbg force-pushed the decommission-absent branch from 4381f4e to 5f19285 Compare February 26, 2018 18:48
When a node is decommissioned in absentia, the gateway node may not be
aware of its most recent liveness entry. Before this bug fix, the
gateway would fail the decommissioning process. Instead, we now read the
liveness record from the KV store in this path.

Fixes cockroachdb#17995.

Release note (bug fix): Decommissioning a node that has already been
terminated now works in all cases. Success previously depended on
whether the gateway node "remembered" the absent decommissionee.
@tbg tbg force-pushed the decommission-absent branch from 5f19285 to be1924e Compare February 26, 2018 19:01
@tbg
Copy link
Member Author

tbg commented Feb 26, 2018

Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/storage/node_liveness.go, line 276 at r2 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Nit: put oldLiveness on the stack instead of dereferencing everywhere below.

Done.


Comments from Reviewable

@tbg tbg merged commit a54fd47 into cockroachdb:master Feb 26, 2018
@tbg tbg deleted the decommission-absent branch February 26, 2018 19:57
@tbg tbg restored the decommission-absent branch April 16, 2018 15:23
@tbg tbg deleted the decommission-absent branch May 8, 2018 15:06
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.

TestDecommission is flaky
4 participants