Skip to content

kvserver: timestamp and invalidate storepool estimates #93532

@kvoli

Description

@kvoli

Is your feature request related to a problem? Please describe.
The storepool for each store locally tracks every store's capacity (qps, lease count etc). This capacity is gathered from gossip and used in allocation. When an allocation change occurs, which originates locally, the local store will update the storepool with an estimate of the impact. This is done to allow the local store to continue to make allocation decisions that take into account the recent change.

These local estimates are overridden by gossip, each time a new descriptor is received.

This leads to an issue where an action could take place at t2, while the capacity of a store involved in that action could be sent at t1 and received by another store that originated this action at t3. Here, the local update is overridden by the gossip update at t1.

The solution is to include time in both local estimate application and when gossip updates are received.

More specifically,

  1. when an estimated impact is applied locally to a store capacity, we include the current timestamp.
  2. when creating a store capacity to be gossiped, we timestamp it with the current time.
  3. when receiving a store capacity from gossip, we invalidate any estimated impacts which have a timestamp less than the timestamp associated with the gossiped capacity.

Jira issue: CRDB-22382

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kvAnything in KV that doesn't belong in a more specific category.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-kvKV Team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions