Re-introduce downgrading retries in driver 4

Description

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.

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
November 25, 2020, 7:01 PM

It should be doable with default methods on the existing interface:

And then we retrofit the internals to only call the "withCl" methods.

Alexandre Dutra
November 27, 2020, 5:22 PM

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).

Olivier Michallat
December 1, 2020, 11:46 PM

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.

Fixed

Assignee

Alexandre Dutra

Reporter

Alexandre Dutra

Labels

PM Priority

None

Affects versions

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Epic Link

Priority

Major
Configure