Skip to content

kv: use evictionToken to coalesce RangeLookups on RangeNotFoundErrors #28967

@nvb

Description

@nvb

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:

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.

Metadata

Metadata

Labels

A-kv-clientRelating to the KV client and the KV interface.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions