Skip to content

kvserver: don't send replica state explicitly in snapshot #72222

@tbg

Description

@tbg

Describe the problem

We just had a mixed-version issue whose root cause was that a snapshot contains a serialized copy of replica.mu.state which can go out-of-sync with the on-disk information when proto fields are phased out.

To Reproduce

#72029 (comment)

Expected behavior

When applying a snapshot, we should not use the protobuf copy of the state. To look everything up from disk, all we need is the start key of the range, which should be the only metadata added to the snapshot. The stateloader should be adapted so that its Load method takes an RKey only.

We need to keep sending the entire state in the snapshot due to cross-version concerns, but one release down the line, we can remove that copy as well.

Additional data / screenshots

Environment:
22.1 master

Additional context

Metadata

Metadata

Assignees

Labels

A-kv-replicationRelating to Raft, consensus, and coordination.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions