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
We want to keep regarding pick() as a cheap, happy path function,
which does not allocate. In LWT optimisation, however, only the primary
replica can be computed without allocations (due to specifics of Network
Topology Strategy, replicas are not assigned greedily, but their
distribution across racks is being balanced). If a policy (in our case,
the default policy) recognizes that a picked replica is down, it would
try to pick another, and this computation would be expensive for
ReplicasOrdered. Instead, having recognized during LWT optimised case
that a picked replica is down, the policy returns None from pick()
to hint that further computation will be expensive.
The plan logic is hence altered to call fallback() even if pick()
returns None.
In the non-LWT case, as subsequent calls to pick() are still cheap,
pick() will still try to find next replicas if one is recognized
to be down.
A test is added. It asserts that `fallback()` is called if `pick()`
returned None.
For the test to be possible to be written, a convenience constructor is
added for `Node` under `cfg(test)`.
0 commit comments