cockroachdb / cockroachdb/cockroach

kvserver: timestamp and invalidate storepool estimates

Abierto
#93,532 0 comentarios 0 reacciones 0 asignados Ver en GitHub
A-kv C-enhancement T-kv
Lenguaje dominante
Go
Estrellas
32.5k
Forks
4.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

**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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.