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

proxy: router refactor and cmap fallback #1148

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

dormando
Copy link
Member

@dormando dormando commented Jun 19, 2024

Allows specifying a commandmap on a router as well as a map and default route. Lookup order is:

  • Check map, if entry in map, check that
  • If none matched, check fallback command map
  • If nothing matched, return default route handler if exists

Also removes the router struct from the funcgen object, saving 32 bytes and letting me extend the size of the router struct without bloating every allocated fgen. This will later allow inlining the lookup map into the router struct for a lookup speedup.

@dormando dormando added the proxy worklogs and issues related to proxy label Jun 19, 2024
@dormando
Copy link
Member Author

dormando commented Jun 19, 2024

Fixes some missing API functionality from mcrouter, fixes an annoyance with memory allocation, and prepares for a later CPU optimization.

Also simplifies routelib a bit.

Allows specifying a commandmap on a router as well as a map and default
route. Lookup order is:
- Check map, if entry is map, check that
- If none matched, check fallback command map
- If nothing matched, return default route handler if exists

Also removes the router struct from the funcgen object, saving 32 bytes
and letting me extend the size of the router struct without bloating
every allocated fgen. This will later allow inlining the lookup map into
the router struct for a lookup speedup.

Finally, this adds support for "cmap only routers", which is mostly
useful when working with abstractions like routelib.
@dormando dormando merged commit 5f69c6d into memcached:staging Jun 19, 2024
1 check passed
@dormando dormando added the staging complete but needs more testing before final merge label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proxy worklogs and issues related to proxy staging complete but needs more testing before final merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant