The drivers team decided years ago to deprecate, then remove downgrading consistency retry policies.
The deprecation was done in driver 3.5.0, and the removal in 4.0.0.
However many users were relying on this retry policy in driver 3.x, and cannot upgrade to 4.0 if the equivalent policy does not exist.
We should re-introduce the equivalent of DowngradingConsistencyRetryPolicy in driver 4.
Unfortunately it's going to be difficult to do so without breaking changes as in driver 4.0+ the retry policy returns an enum RetryDecision that does not allow to specify that the consistency level should be downgraded.
One possible solution is to introduce a new EnhancedRetryPolicy interface.
It should be doable with default methods on the existing interface:
And then we retrofit the internals to only call the "withCl" methods.
Yes, I was on a similar path. The tentative API for now is as follows:
And then on RetryPolicy:
This seems to work well with most request handlers (I already modified them).
Note that to be able to change the CL we need to pay the price of not being able anymore to store the request as a final field on request handlers, it has to “move down” to node callbacks.
For this reason I figured that it’s not a big leap to allow the entire request to be modified, not only the CL – hence the new method RequestT getRetryRequest(RequestT previous).
it’s not a big leap to allow the entire request to be modified, not only the CL
(y), this also provides the most flexibility.