-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
embedded memcached proxy #716
Commits on Sep 28, 2021
-
proxy: proof of concept and infrastructure
All this will do as of this commit are simple metagets, ie: mg /foo/a t v ...and only for small responses. This turns memcached into what will be a full featured proxy. Full writeup of what that entails will live in the PR on github. Does not include vendored files. requires: vendor/lua (lua 5.4.0 from public tarball) vendor/mcmc (from https://github.com/dormando/mcmc (or https://github.com/memcached/mcmc in the future) also requires a startfile.lua. An empty configuration looks like: function mcp_config_selectors(oldss) end function mcp_config_routes(main_zones) end
Configuration menu - View commit details
-
Copy full SHA for 8c26d7e - Browse repository at this point
Copy the full SHA 8c26d7eView commit details -
proxy: furhter updates for flow IO API
keeping this separate so I can review/re-apply in case I need to do this rebase again.
Configuration menu - View commit details
-
Copy full SHA for 2246ea4 - Browse repository at this point
Copy the full SHA 2246ea4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 091a3c4 - Browse repository at this point
Copy the full SHA 091a3c4View commit details -
proxy: mcp.await() parallel-subrequests
Adds a primitive asynchronous wait call, where request "r" is dispatched against N pools in parallel. An optional number specifies how many responses to wait for before returning. Has bugs around edge cases and limited testing as of writing, but does pass basic tests.
Configuration menu - View commit details
-
Copy full SHA for 3b2926d - Browse repository at this point
Copy the full SHA 3b2926dView commit details -
proxy: fix memory bugs in await()
classic C bugs :P doesn't seem to leak now in some limited testing with mctester.
Configuration menu - View commit details
-
Copy full SHA for 3da30e6 - Browse repository at this point
Copy the full SHA 3da30e6View commit details -
proxy: simplified bad backend handling
Taking a simplified first attempt at having fast-failures for backends that throw errors or time out; IO's will immediately be returned for these backends until they become alive. A background retry is scheduled until the backend works again. There are a lot of ways to improve this, some noted in comments, and I will likely need to move the connect() code anyway, so doing that as a later change.
Configuration menu - View commit details
-
Copy full SHA for ce4a3c4 - Browse repository at this point
Copy the full SHA ce4a3c4View commit details -
proxy: fix config reload crash for user stats
if replacing existing user stats, would crash. think broke during a refactor; need more integration tests :)
Configuration menu - View commit details
-
Copy full SHA for bc39742 - Browse repository at this point
Copy the full SHA bc39742View commit details -
proxy: start logger integration
timing is a little tough; not a lot of places to stick the time start vs time end for the log. gives a raw timing of microseconds. also need to follow up with having a response inherit some details about the request (type?) and translate the response type/code to something useful... but starting with this.
Configuration menu - View commit details
-
Copy full SHA for 6443e0c - Browse repository at this point
Copy the full SHA 6443e0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d229854 - Browse repository at this point
Copy the full SHA d229854View commit details -
proxy: start of io_uring integration
This commit changes: - add --enable-proxy-uring option, which looks for a compiled liburing in vendor/liburing - change backend drive_machine() to remove syscalls so it can be a common code path between libevent and uring - add basic liburing support for the backend read path. writes to backends still use normal syscalls and will be optimized later The structure will need to change to meter out *sqe's more carefully, but it should be impossible to trip the exhaustion condition so this is fine for now. The mcmc code did not make this easy, drive_machine() has turned into a bit of a mess. I need to flatten that out to allow avoiding memmove's and make the code clearer. Will come back to it after taking a break from it... Uring path is missing some critical code still: - backend disconnects - bad backend handling/retry - timeouts don't exist at all So it should work for testing in good conditions and I'll add the error handling during the stabilization phase.
Configuration menu - View commit details
-
Copy full SHA for e5e8973 - Browse repository at this point
Copy the full SHA e5e8973View commit details -
Configuration menu - View commit details
-
Copy full SHA for 70d592f - Browse repository at this point
Copy the full SHA 70d592fView commit details -
proxy: update/remove some TODO's + uring patch
Some uring changes before I forget I wanted to do them, and update/remove some TODO notes.
Configuration menu - View commit details
-
Copy full SHA for d127e51 - Browse repository at this point
Copy the full SHA d127e51View commit details -
proxy: start N backend servers for tests
some cleanups/changes to the test startfile as well.
Configuration menu - View commit details
-
Copy full SHA for 561a40f - Browse repository at this point
Copy the full SHA 561a40fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d95b6e - Browse repository at this point
Copy the full SHA 0d95b6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for eabca94 - Browse repository at this point
Copy the full SHA eabca94View commit details -
mostly in the parser + adding tests. no userlib parts yet.
Configuration menu - View commit details
-
Copy full SHA for d791186 - Browse repository at this point
Copy the full SHA d791186View commit details -
proxy: beginning of meta parser code
avoid second malloc for lua request objects by requesting some extra space. generate a bitfield of flags generically to allow later flags without breaking code. when looking for arguments to flags from the API, we will have to re-scan the string, which usually very short anyway.
Configuration menu - View commit details
-
Copy full SHA for 5e54783 - Browse repository at this point
Copy the full SHA 5e54783View commit details -
proxy: rename hash_selectors to pools.
hasn't made sense for a long time now. distribution and hash functions are abstract from the pool.
Configuration menu - View commit details
-
Copy full SHA for ce98eed - Browse repository at this point
Copy the full SHA ce98eedView commit details -
in preparation of adding a few more common options. hash_selectors are now pools. I've now separated the concepts: ketama/jump/etc are considered "key distributors", and can now be separate from key hashing. collapse arguments into a single options table. this table gets passed-through to the distribution function for extra options. t/startfile.lua has been updated.
Configuration menu - View commit details
-
Copy full SHA for b7bccc8 - Browse repository at this point
Copy the full SHA b7bccc8View commit details -
proxy: use tokenizer for request parser.
rewriting the parser yet again... fixes a bug where parser wasn't handling spaces around arguments. Simplifies and removes redundancy for a bunch of the parser code. Finally, sets up for a simplified API wrapper that simply handles tokens directly.
Configuration menu - View commit details
-
Copy full SHA for c961252 - Browse repository at this point
Copy the full SHA c961252View commit details -
proxy: add lua API for request token handling
*trimkey is a fast routine for clipping part of the key before shipping the command. r:token(n) can fetch a token in the nth position. r:token(n, str) replaces the token at the nth position. modifications to the tokens are ignored. the next commit should re-stringify in case of modification.
Configuration menu - View commit details
-
Copy full SHA for 6336563 - Browse repository at this point
Copy the full SHA 6336563View commit details -
proxy: r:token(n, newtoken) will modify a request
replace specific tokens in a request with r:token(n, str) command. the request will be re-serialized when it's being sent to a backend.
Configuration menu - View commit details
-
Copy full SHA for 02a36f5 - Browse repository at this point
Copy the full SHA 02a36f5View commit details -
proxy: re-enable metaflag parsing
also removes errant fprintf. need to actually parse the flags so we can handle binary-encoded keys.
Configuration menu - View commit details
-
Copy full SHA for f53419c - Browse repository at this point
Copy the full SHA f53419cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6315b5f - Browse repository at this point
Copy the full SHA 6315b5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a63dccb - Browse repository at this point
Copy the full SHA a63dccbView commit details -
proxy: functions for setting/updating timeouts
mcp.backend_connect_timeout() mcp.backend_retry_timeout() mcp.backend_read_timeout() only takes integers. could take a fractional with more work.
Configuration menu - View commit details
-
Copy full SHA for cda1f08 - Browse repository at this point
Copy the full SHA cda1f08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 99cb030 - Browse repository at this point
Copy the full SHA 99cb030View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35aa24a - Browse repository at this point
Copy the full SHA 35aa24aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f4df6ca - Browse repository at this point
Copy the full SHA f4df6caView commit details -
Configuration menu - View commit details
-
Copy full SHA for d94f31f - Browse repository at this point
Copy the full SHA d94f31fView commit details -
proxy: fix bug in default timeouts
I'd forget how to breathe if it weren't automatic.
Configuration menu - View commit details
-
Copy full SHA for 5fe40f9 - Browse repository at this point
Copy the full SHA 5fe40f9View commit details -
proxy: change mcmc's vendoring
clears up an automake error. need a for-real makefile or to turn mcmc into a header. Think I like the idea of it being a header actually?
Configuration menu - View commit details
-
Copy full SHA for 9cd3ece - Browse repository at this point
Copy the full SHA 9cd3eceView commit details -
proxy: make
watch rawcmds
a bit more usefulwill print the original request command name. we can't toss the key/anything useful as requests are not pinned to responses. I can think of better approaches but they require more clever code so I'm not doing it now.
Configuration menu - View commit details
-
Copy full SHA for ae2c239 - Browse repository at this point
Copy the full SHA ae2c239View commit details
Commits on Sep 29, 2021
-
proxy: start of a "simple" lua library
can handle flat routing (pools and such) and multi-zones flat routing is probably fine, zones needs more work for production.
Configuration menu - View commit details
-
Copy full SHA for c764f5d - Browse repository at this point
Copy the full SHA c764f5dView commit details
Commits on Sep 30, 2021
-
proxylib: allow specifying a host label
thinking I'll end up moving this script to the proxylibs repo... but vendor it on releases.
Configuration menu - View commit details
-
Copy full SHA for 14e04ba - Browse repository at this point
Copy the full SHA 14e04baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 24f1374 - Browse repository at this point
Copy the full SHA 24f1374View commit details -
when not configured, again. also cleans up a bit from a TODO note.
Configuration menu - View commit details
-
Copy full SHA for 11d20c9 - Browse repository at this point
Copy the full SHA 11d20c9View commit details
Commits on Oct 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 2e7e8f3 - Browse repository at this point
Copy the full SHA 2e7e8f3View commit details -
proxy: make simple an actual library
--proxy_config=./datafile.lua is now the calling convention. the datafile loads the library which defines globals for the proxy to run.
Configuration menu - View commit details
-
Copy full SHA for 2ef0074 - Browse repository at this point
Copy the full SHA 2ef0074View commit details -
Configuration menu - View commit details
-
Copy full SHA for 994ab14 - Browse repository at this point
Copy the full SHA 994ab14View commit details -
Configuration menu - View commit details
-
Copy full SHA for de3bce4 - Browse repository at this point
Copy the full SHA de3bce4View commit details -
lua is external.. mcmc is inlined, at least for now.
Configuration menu - View commit details
-
Copy full SHA for ea22014 - Browse repository at this point
Copy the full SHA ea22014View commit details -
Configuration menu - View commit details
-
Copy full SHA for 03f3321 - Browse repository at this point
Copy the full SHA 03f3321View commit details
Commits on Oct 2, 2021
-
I need to spend some time learning this properly, but I need it to work in the meantime... So using a proxy makefile to build things. "make dist" does actually work now, but not unless you "make clean" first. it'll add junk because the make dist recursion happens after the EXTRA_DIST copies files in. I'll fix this another time. since it's mostly me building tarballs I'll just try to not screw it up until fixed.
Configuration menu - View commit details
-
Copy full SHA for cecc52a - Browse repository at this point
Copy the full SHA cecc52aView commit details -
Configuration menu - View commit details
-
Copy full SHA for b8f7790 - Browse repository at this point
Copy the full SHA b8f7790View commit details