Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this depend on the error returned? For some it should be fine to retry non-idempotent queries. Examples:
Those examples were taken from an open PR by @muzarski to Rust Driver: https://github.com/scylladb/scylla-rust-driver/pull/1083/files#diff-190ddd8a3bf1cb700a17e2fa417c86f5bcec57edaacc62e8369e96383c9958c4
This PR is not final - we will be discussing how to handle each type of error, any one is of course invited to participate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe, I am not sure, based on @pdbossman issue I thought that retires should not work for idempotent queries in general
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the query is not idempotent, then it is not safe to execute it multiple times. If we don't know if the query was executed, then we can't execute it again - because if it was executed the first time, then we have second execution which is not correct.
However, if we know that the query was not executed, then it is fine to execute it again (= it is fine to retry). Some errors (for example the ones I mentioned above) imply that the query was not executed, so they should not prevent retry, even for non-idempotent queries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, reason to this change is this:
Now, way to do that properly:
List of these errors (not complete):
Also it is better to make it so that final error returned has distinctive type, so that user could distinct cases when to check if data is there.