-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kv: use evictionToken to coalesce RangeLookups on RangeNotFoundErrors #28967
Description
I recently noticed that ever since 098b59e we haven't taken full of the RangeDescriptorCache's evictionToken API to coalesce range lookups on range descriptor changes. Specifically, the following line does not provide its evictionToken:
cockroach/pkg/kv/dist_sender.go
Line 1054 in 88379ae
| desc, evictToken, err = ds.getDescriptor(ctx, descKey, nil, isReverse) |
We hit this whenever a request returns a *roachpb.SendError or a *roachpb.RangeNotFoundError. This isn't a particularly common case, but it does occasionally happen. For instance, if all replicas in a range have been moved then we will hit this case.
This evictionToken could also use an update, especially in light of ce93650, which adds a generation counter to RangeDescriptors. This will make it easier to make decisions on whether multiple range lookups are a result of the same old desciptor.