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: Send snapshot messages with the correct term #13515

Merged
merged 1 commit into from Feb 9, 2017

Conversation

bdarnell
Copy link
Member

@bdarnell bdarnell commented Feb 9, 2017

This fixes a regression in #12686, which meant that a replica that
fell too far behind would be unable to ever catch up because it would
think that it was receiving out-of-date snapshots.

Fixes #13506


This change is Reviewable

@tamird
Copy link
Contributor

tamird commented Feb 9, 2017

:lgtm:


Reviewed 4 of 4 files at r1.
Review status: all files reviewed at latest revision, 4 unresolved discussions, all commit checks successful.


pkg/storage/client_raft_test.go, line 641 at r1 (raw file):

	for _, changeTerm := range []bool{false, true} {
		name := "same term"

FYI spaces don't render nicely in subtest names, so you may want to use CamelCase.


pkg/storage/client_raft_test.go, line 698 at r1 (raw file):

				for i := range mtc.stores {
					if i != stoppedStore {
						// Stop and restart all the stores, which guarantees that

not all the stores. "live stores" is the term you use below.


pkg/storage/client_raft_test.go, line 750 at r1 (raw file):

					}
				}
			} else { // !changeTerm

+1 on this comment


pkg/storage/helpers_test.go, line 156 at r1 (raw file):

}

// SetRaftSnapshotQueueActive enables or disables the raft snapshotqueue.

raft snapshot queue


Comments from Reviewable

@bdarnell
Copy link
Member Author

bdarnell commented Feb 9, 2017

Review status: 2 of 4 files reviewed at latest revision, 3 unresolved discussions.


pkg/storage/client_raft_test.go, line 641 at r1 (raw file):

Previously, tamird (Tamir Duberstein) wrote…

FYI spaces don't render nicely in subtest names, so you may want to use CamelCase.

In what context? It looks to me like they get replaced with underscores. Changed anyway.


pkg/storage/client_raft_test.go, line 698 at r1 (raw file):

Previously, tamird (Tamir Duberstein) wrote…

not all the stores. "live stores" is the term you use below.

Done.


pkg/storage/helpers_test.go, line 156 at r1 (raw file):

Previously, tamird (Tamir Duberstein) wrote…

raft snapshot queue

Done.


Comments from Reviewable

@petermattis
Copy link
Collaborator

Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks pending.


pkg/storage/replica_command.go, line 3345 at r2 (raw file):

	status := r.RaftStatus()
	if status == nil {
		return errors.New("raft status not initialized")

I'm pretty sure this scenario can't happen.


Comments from Reviewable

@petermattis
Copy link
Collaborator

:lgtm:


Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks pending.


Comments from Reviewable

@bdarnell
Copy link
Member Author

bdarnell commented Feb 9, 2017

Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


pkg/storage/replica_command.go, line 3345 at r2 (raw file):

Previously, petermattis (Peter Mattis) wrote…

I'm pretty sure this scenario can't happen.

Yeah, me too. But I'd rather have this check than a bare panic if it turns out I'm wrong.


Comments from Reviewable

This fixes a regression in cockroachdb#12686, which meant that a replica that
fell too far behind would be unable to ever catch up because it would
think that it was receiving out-of-date snapshots.

Fixes cockroachdb#13506
@bdarnell bdarnell merged commit c3465d5 into cockroachdb:master Feb 9, 2017
@bdarnell bdarnell deleted the snapshot-term branch February 9, 2017 23:47
@tamird
Copy link
Contributor

tamird commented Feb 10, 2017

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


Comments from Reviewable

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.

stability: qps dropping to zero during chaos testing
3 participants