-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(make_idempotent): support making incr
request idempotent in pegasus_write_service::impl
#2185
base: master
Are you sure you want to change the base?
feat(make_idempotent): support making incr
request idempotent in pegasus_write_service::impl
#2185
Conversation
incr
request in pegasus_write_service::impl
incr
request in pegasus_write_service::impl
incr
request idempotent in pegasus_write_service::impl
return static_cast<int32_t>(get_ctx.expire_ts); | ||
} | ||
|
||
if (req.expire_ts_seconds < 0) { |
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.
When will expire_ts_seconds
to be less than 0?
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.
Yes, -1
means clearing TTL as is described by Java client if ttlSeconds == -1, then update to no ttl if increment succeed.
(see https://github.com/apache/incubator-pegasus/blob/master/java-client/src/main/java/org/apache/pegasus/client/PegasusClientInterface.java#L561); and Java client would throw exception once it is less than -1 (see https://github.com/apache/incubator-pegasus/blob/master/java-client/src/main/java/org/apache/pegasus/client/PegasusTable.java#L733).
On server-side, currently non-idempotent incr
would also clear TTL once it is less than 0 (see https://github.com/apache/incubator-pegasus/blob/master/src/server/pegasus_write_service_impl.h#L235).
Implement two APIs making
incr
request idempotent inpegasus_write_service::impl
:incr
request (non-idempotent) into a single-put request (idempotent),and process the possible errors during the translation, e.g. failed to read base value for
increment from the RocksDB instance;
incr
.