Skip to content

Implement replica tombstones.#2798

Merged
bdarnell merged 2 commits intocockroachdb:masterfrom
bdarnell:replica-tombstone
Oct 11, 2015
Merged

Implement replica tombstones.#2798
bdarnell merged 2 commits intocockroachdb:masterfrom
bdarnell:replica-tombstone

Conversation

@bdarnell
Copy link
Copy Markdown
Contributor

@bdarnell bdarnell commented Oct 7, 2015

When a replica is removed, leave a tombstone behind, and prevent the
recreation of the same range without a higher replica ID.

Added a new test which demonstrates a split-brain scenario caused by
the reuse of old replica IDs. Also fixes some other tests, but
not all of the ones that it has been blamed for.

Fixes #768.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume you care about the 0 value. How about creating a const invalidReplicaID = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done, but the constant needs to be exported for use from Store.GroupStorage, and changed the value from 0 to -1.

@tbg
Copy link
Copy Markdown
Member

tbg commented Oct 8, 2015

LGTM mod vivek's comments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a bit misleading since the thing that follows the colon is the error not the incoming message.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added parens around the new phrase to clarify.

@mrtracy
Copy link
Copy Markdown
Contributor

mrtracy commented Oct 8, 2015

LGTM

When a replica is removed, leave a tombstone behind, and prevent the
recreation of the same range without a higher replica ID.

Added a new test which demonstrates a split-brain scenario caused by
the reuse of old replica IDs. Also fixes some other tests, but
not all of the ones that it has been blamed for.

Fixes cockroachdb#768.
bdarnell added a commit that referenced this pull request Oct 11, 2015
@bdarnell bdarnell merged commit 595e236 into cockroachdb:master Oct 11, 2015
@bdarnell bdarnell deleted the replica-tombstone branch October 11, 2015 12:12
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.

Range replica removal

5 participants