Skip to content

Commit 839783e

Browse files
craig[bot]kvoli
craig[bot]
andcommitted
Merge #110195
110195: kvserver: fix delegated snap gen change error r=andrewbaptist a=kvoli When the range descriptor of the delegate is lower than the descriptor generation of the delegating replica (leaseholder), the store returns an error, which is also logged (v=2). The error message mixed up the delegating and delegated replica's generation. Swap them around. Epic: none Release note: None Co-authored-by: Austen McClernon <[email protected]>
2 parents d020717 + a9d7728 commit 839783e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

pkg/kv/kvserver/replica_command.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,14 +2935,12 @@ func (r *Replica) validateSnapshotDelegationRequest(
29352935
// snapshot will still be valid since the leaseholder is also on this
29362936
// generation by now.
29372937
if desc.Generation < req.DescriptorGeneration {
2938-
log.VEventf(ctx, 2,
2938+
err := errors.Errorf(
29392939
"%s: generation has changed since snapshot was generated %s < %s",
2940-
r, req.DescriptorGeneration, desc.Generation,
2941-
)
2942-
return errors.Errorf(
2943-
"%s: generation has changed since snapshot was generated %s < %s",
2944-
r, req.DescriptorGeneration, desc.Generation,
2940+
r, desc.Generation, req.DescriptorGeneration,
29452941
)
2942+
log.VEventf(ctx, 2, "%v", err)
2943+
return err
29462944
}
29472945

29482946
// Check that the snapshot we generated has a descriptor that includes the

0 commit comments

Comments
 (0)