You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
144106: kvserver: add mixed version race condition test for policy refresher r=arulajmani a=wenyihu6
**kvserver: add PolicyRefresher.TestingKnobs**
This commit adds PolicyRefresher.TestingKnobs, which enables testing race
scenarios where the sender hasn't observed a cluster version upgrade when
creating the policy map, but the PolicyRefresher later does.
Epic: none
Release note: none
---
**kvserver: add mixed version race condition test for policy refresher**
This commit adds TestReplicaClosedTSPolicyWithPolicyRefresherInMixedVersionCluster.
TestReplicaClosedTSPolicyWithPolicyRefresherInMixedVersionCluster verifies
that the closed timestamp policy refresher behaves correctly in a
mixed-version cluster.
Particularly, a race condition like below might occur:
1. Side transport prepares a policy map before cluster upgrade is complete.
2. Cluster upgrade completes.
3. Policy refresher sees the upgrade and quickly updates replica policies to
use latency-based policies.
4. Replica tries to use a latency-based policy but the policy map from step 1
doesn't include it yet.
The logic in replica.getTargetByPolicy handles this race condition by falling
back to no-latency based policies if no-latency based policies were included
from the map provided by the side transport sender.
This test simulates a race condition by using a testing knob to allow the
policy refresher to use latency based policies on replicas while the rest of
the system is still on an older version. It verifies that even if the policy
refresher sees an upgrade to V25_2 and replicas starts holding latency based
policies, replicas will correctly fall back to non-latency-based policies if
the sender hasn’t yet sent the updated latency-based policies.
Part of: #143888
Release note: none
Co-authored-by: wenyihu6 <[email protected]>
0 commit comments