Skip to content

kvserver: storepool not updated after change replicas that removes leaseholder #89395

@kvoli

Description

@kvoli

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:

rq.store.cfg.StorePool.UpdateLocalStoresAfterLeaseTransfer(
source, target, rangeQPS)

Whereas on a change replicas call:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kv-distributionRelating to rebalancing and leasing.C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-kvKV Team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions