Redis 3.2 add CAS API for string type's storage#3772
Conversation
Author
|
maybe my content is hard to understand , cause my english is not that good... |
Member
|
Two notes:
;) |
Author
|
Thanks for your advise,handsome haber. But I wanna know what the shotcoming of my implemention? |
Member
|
/me blush I have not reviewed your implementation, but in order to use it it will have to be merged into the core. This may not or may happen. With Lua/Modules, you don't have to wait. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Hello Antirez, I add the lockless programming CAS API for string type's storage.
The reason why I add CAS API is: I know Redis can implement CAS operations by using WATCH and MULTI; But many business always package Redis server, for example, using a proxy to access Redis, in this scenario, WATCH and MULTI is hard to use. So I added the CAS API for string type storage.
How I implemented CAS API for string type:
I introduced three APIs:
For string type:
when encoding = INT or EMBSTR, rasing INT to RAW, then appending cas version to sds->buf;
when encoding = RAW, appending cas version to sds->buf;
By this easy way, my CAS API supported RDB\AOF\master-slave model\cluster model easily.
I have test my API successfully.
So can you share your idea or give me some advise?