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
session: prepare: introduce fallback to all shards
Before this commit, we could unnecessarily return an error from prepare:
Let's say we have a 1-node cluster, and we have a broken connection, and
we don't retry on another - we would retry error to the user despite
possibly being able to prepare.
This commit introduces fallback logic to `Session::prepare()`:
if preparation on a single (random) connection to every node fails,
the whole preparation is retried, this time on a single connection to
every shard.
I'm a bit unhappy that this requires us to clone `statement` on the
happy path (i.e., if the on-all-nodes preparation attempt succeeds),
but I'm quite convinced it's negligible overhead.
0 commit comments