Skip to content
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

Add SETIFGREATER ETag command #968

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

hamdaankhalid
Copy link
Contributor

Adds the SETIFGREATER ETag command along with documentation and testing

@TalZaccai TalZaccai requested a review from badrishc January 28, 2025 19:12

/// <summary>
/// SETIFGREATER key val etag [EX|PX] [expiry]
/// Sets a key value pair with the given ETag only if the already existing etag is less than the etag given in request.
Copy link
Contributor

@badrishc badrishc Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reword as:

Sets a key value pair with the given etag only if (1) the etag given in the request is greater than the already existing etag ; or (2) there was no existing value; or (3) the existing value was not associated with any etag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetIfGreater on non-existing value returns nil, same as SETIFMATCH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so 1 and 3 are correct but not 2^

Copy link
Contributor

@badrishc badrishc Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be true, right? otherwise client has to special case the first insert which is wasteful. (we think of the default etag and non-existent etag as zero implicitly)

@hamdaankhalid hamdaankhalid force-pushed the hkhalid/add-setifgreater branch from 630ec0d to c38526e Compare January 29, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants