Add initial support for memcached metaget (mg)#476
Open
mszabo-wikia wants to merge 4 commits intofacebook:mainfrom
Open
Add initial support for memcached metaget (mg)#476mszabo-wikia wants to merge 4 commits intofacebook:mainfrom
mszabo-wikia wants to merge 4 commits intofacebook:mainfrom
Conversation
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.
Upstream OSS memcached has had support for meta commands for a few years now, with a pending feature request to have mcrouter support them (#335). Since they greatly simplify implementing common caching strategies and also synergize well with some mcrouter features (e.g. WarmupRoute could benefit from
mg), it makes sense to implement these.This PR adds basic support needed for the metaget (
mg) command to the ASCII parser and serializer and the shared Thrift IDL, without updating individual route logic yet (beyond what's needed to get BigValueRoute to compile). So an mcrouter built from this branch should be able to relaymgcommands but the behavior might not yet make sense for all routes.The ASCII parsing notably deviates from the upstream spec in that flags aren't returned in the same order as given in the request. It's unclear to me based on the wording there whether this is meant to be strict or not; if clients don't rely on this behavior it's probably best to leave it as-is instead of convoluted logic to pass the flag order onto AsciiSerializer somehow.
Note: I realize Memcache.thrift and assorted files are generated but since the Carbon codegen is private, I opted to add the needed code by hand to this PR so that it compiles for OSS users. I can make another PR without those changes, if needed.