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: reject range transfers when draining #13601

Merged
merged 2 commits into from
Feb 21, 2017
Merged

storage: reject range transfers when draining #13601

merged 2 commits into from
Feb 21, 2017

Conversation

asubiotto
Copy link
Contributor

@asubiotto asubiotto commented Feb 15, 2017

Draining stores now reject preemptive snapshots to avoid a possible loss
of quorum after the node shuts down.

DrainLeases and IsDrainingLeases have been renamed to SetDraining
and IsDraining to follow the general draining naming convention and because a
draining store does more than just drain leases now.


This change is Reviewable

@bdarnell
Copy link
Contributor

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


pkg/storage/store.go, line 963 at r1 (raw file):

// there may be active leases held by some of the Store's Replicas.
// When called with 'false', returns to the normal mode of operation.
func (s *Store) SetDraining(drain bool) error {

As we discussed at lunch, there are multiple kinds of draining (leases, replicas, clients, etc), Probably better to keep this DrainLeases unless we're going to adopt a new naming scheme in which "draining" unambiguously refers to leases. (it's also best to do renames like this in a separate commit from any functional change)


Comments from Reviewable

This change renames the method used to put a Store into draining mode as
well as all related methods/member variables. Previously all that was done
was to gracefully wait for all leases to expire, but future changes will
add more steps to this process that are unrelated to leases.
Draining stores now reject preemptive snapshots to avoid a possible loss
of quorum after the node shuts down.
@asubiotto
Copy link
Contributor Author

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


pkg/storage/store.go, line 963 at r1 (raw file):

Previously, bdarnell (Ben Darnell) wrote…

As we discussed at lunch, there are multiple kinds of draining (leases, replicas, clients, etc), Probably better to keep this DrainLeases unless we're going to adopt a new naming scheme in which "draining" unambiguously refers to leases. (it's also best to do renames like this in a separate commit from any functional change)

There are multiple kinds of draining, but in the context of a Store I'm not sure it makes sense to separate the draining of leases and replicas. This is because the more important distinction is draining for a restart or draining for a removal. You would want to stop accepting replicas in both cases to avoid a possible loss of quorum. I think I'll keep the rename (put it in its own commit) and later on add a boolean forRemoval that will transfer away replicas from a store.


Comments from Reviewable

@tamird
Copy link
Contributor

tamird commented Feb 16, 2017

:lgtm:


Reviewed 2 of 7 files at r1, 5 of 5 files at r2, 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


Comments from Reviewable

@bdarnell
Copy link
Contributor

:lgtm:


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


Comments from Reviewable

@asubiotto asubiotto merged commit 0c4da46 into cockroachdb:master Feb 21, 2017
@asubiotto asubiotto deleted the drain-reject-ranges branch February 21, 2017 15:09
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.

3 participants