-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kvserver: storepool not updated after change replicas that removes leaseholder #89395
Description
Describe the problem
When removing the leaseholder using changeReplicas in the replicate queue, via a joint config, the storepool is not updated locally to reflect the change.
This is currently only updated on explicit lease transfers:
cockroach/pkg/kv/kvserver/replicate_queue.go
Lines 1865 to 1866 in 9ac6fea
| rq.store.cfg.StorePool.UpdateLocalStoresAfterLeaseTransfer( | |
| source, target, rangeQPS) |
Whereas on a change replicas call:
cockroach/pkg/kv/kvserver/replicate_queue.go
Lines 1911 to 1913 in 9ac6fea
| rq.store.cfg.StorePool.UpdateLocalStoreAfterRebalance( | |
| chg.Target.StoreID, rangeUsageInfo, chg.ChangeType) | |
| } |
Only the replica counts are updated, not the lease count or QPS if the leaseholder is removed.
| func (sp *StorePool) UpdateLocalStoreAfterRebalance( |
Expected behavior
ChangeReplicas called from the replicate queue, which removes the leaseholder and adds a new leaseholder updates the local storepool accounting to reflect the change on success.
Jira issue: CRDB-20243