Skip to content

Add initial support for memcached metaget (mg)#476

Open
mszabo-wikia wants to merge 4 commits intofacebook:mainfrom
mszabo-wikia:mg-initial-support
Open

Add initial support for memcached metaget (mg)#476
mszabo-wikia wants to merge 4 commits intofacebook:mainfrom
mszabo-wikia:mg-initial-support

Conversation

@mszabo-wikia
Copy link
Copy Markdown
Contributor

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 relay mg commands 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.

@meta-cla meta-cla Bot added the CLA Signed label Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant