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

kvserver: also load uninitialized replicas, verify replicaID #93317

Merged
merged 3 commits into from
Dec 19, 2022

Conversation

tbg
Copy link
Member

@tbg tbg commented Dec 9, 2022

To support a separate raft log1 we need to perform certain
reconciliation operations at start-up to recover from a lack
of atomicity between the state and log engines.

This commit gets us closer to being able to do so by listing
all replicas before starting the store, which means we now
have a handle on which uninitialized replicas exist in the
system.

As a first application of this knowledge, we now ensure that every
replica has a persisted FullReplicaID. Since this would not necessarily
be true for stores that have seen older releases, we backfill the
ReplicaID in 23.1 and can then require it to be present in a future
release that forces a migration through 23.1.

Epic: CRDB-220
Release note: None

Footnotes

  1. https://github.com/cockroachdb/cockroach/issues/16624

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg force-pushed the store-repl-init-uninited branch from c71e944 to 9ea7b7f Compare December 9, 2022 13:06
@tbg tbg changed the title kvserver: also load uninitialized replicaskvserver: update tests that failed to persist ReplicaIDkvserver: simplify an assertionkvserver: introduce loadAndReconcileReplicaskvserver: validate descriptor locationkvserver: improve an assertionkvserver: remove dead code kvserver: also load uninitialized replicas, verify replicaID Dec 9, 2022
@tbg tbg force-pushed the store-repl-init-uninited branch 2 times, most recently from ca8ba39 to 863932d Compare December 16, 2022 11:27
@tbg tbg requested a review from pav-kv December 19, 2022 07:18
@tbg tbg marked this pull request as ready for review December 19, 2022 07:19
@tbg tbg requested a review from a team as a code owner December 19, 2022 07:19
@tbg
Copy link
Member Author

tbg commented Dec 19, 2022

TODO when I update this following review feedback: also add the TODO on loadAndReconcileReplicas.

tbg added 3 commits December 19, 2022 16:16
To support a separate raft log[^1] we need to perform certain
reconciliation operations at start-up to recover from a lack
of atomicity between the state and log engines.

This commit gets us closer to being able to do so by listing
all replicas before starting the store, which means we now
have a handle on which uninitialized replicas exist in the
system.

As a first application of this knowledge, we now ensure that every
replica has a persisted FullReplicaID. Since this would not necessarily
be true for stores that have seen older releases, we backfill the
ReplicaID in 23.1 and can then require it to be present in a future
release that forces a migration through 23.1.

[^1]: cockroachdb#16624

Epic: CRDB-220
Release note: None
Epic: none
Release note: None
@tbg tbg force-pushed the store-repl-init-uninited branch from 863932d to 48f0a0a Compare December 19, 2022 15:16
@tbg
Copy link
Member Author

tbg commented Dec 19, 2022

TFTR!

bors r=pavelkalinnikov

@craig
Copy link
Contributor

craig bot commented Dec 19, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Dec 19, 2022

Build succeeded:

@craig craig bot merged commit 369c405 into cockroachdb:master Dec 19, 2022
@tbg tbg deleted the store-repl-init-uninited branch December 20, 2022 10:02
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