feat(make_idempotent): support making incr
request idempotent in pegasus_server_write
and replication_app_base
#2196
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.
#2197
To support idempotence, a new interface
make_idempotent()
is introduced andan existing interface
on_batched_write_requests()
is changed for both the classespegasus_server_write
andreplication_app_base
. This is different from what wehave done for
pegasus_write_service
andpegasus_write_service::impl
, both ofwhich provide
make_idempotent()
andput()
by the following PRs:incr
request idempotent inpegasus_write_service::impl
#2185incr
request idempotent inpegasus_write_service
#2192make_idempotent()
forreplication_app_base
is provided as a virtual functioncalled by primary replicas, implemented internally by
pegasus_server_impl
andpegasus_server_write
.on_batched_write_requests
forreplication_app_base
is the same. It is changed with a new parameter
original_request
added. It is justthe original request received from the client. It must be an atomic request (i.e.
incr
,check_and_set
andcheck_and_mutate
) if it is non-null, and used to decide if awrite request is atomic and generate the response corresponding to the atomic write
request.