cockroachdb / cockroachdb/cockroach

kvserver: remove maybeMarkReplicaInitializedLockedReplLocked

Open
#94,912 4 comments 0 reactions 1 assignee Claimed by @pav-kv View on GitHub
C-cleanup T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Related to https://github.com/cockroachdb/cockroach/issues/94911.

We seem to have three paths that initialize a Replica. The first one is

https://github.com/cockroachdb/cockroach/blob/3d6fe9ebd5f1c32cc6a1e2f547b8a16e04a84d38/pkg/kv/kvserver/replica_init.go#L157-L238

and as explain in its comment, this is what transitions most uninitialized replicas to initialized.

However, then there's also

https://github.com/cockroachdb/cockroach/blob/e1c24edea342a83dbd250732e8d1de770cc47ae8/pkg/kv/kvserver/store_create_replica.go#L367-L430

which has as its sole caller the `applySnapshot` path.

We should unify them by replacing the latter use with the former.

Jira issue: CRDB-23225
Epic: CRDB-220

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.