| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Refcount leak on sets
- Move the response elapsed timer back closer to when the response was
processed as to not clobber the wrong IO object data
- Restores error messages from set/ms
- Adds start of unit tests
Requests will look like they run a tiiiiny bit faster than they do, but
I need to get the elapsed time there for a later change.
|
|
|
|
| |
test FASTGOOD and some set scenarios
|
|
|
|
|
|
|
|
| |
One of the side effects of pre-warming all of the tests I did with
multiget, and not having done a second round on the unit tests, is that
we somehow never tried an ascii multiget against a damn miss.
Easy to test, easy to fix.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`mcp.pool(p, { dist = etc, iothread = true }`
By default the IO thread is not used; instead a backend connection is
created for each worker thread. This can be overridden by setting
`iothread = true` when creating a pool.
`mcp.pool(p, { dist = etc, beprefix = "etc" }`
If a `beprefix` is added to pool arguments, it will create unique
backend connections for this pool. This allows you to create multiple
sockets per backend by making multiple pools with unique prefixes.
There are legitimate use cases for sharing backend connections across
different pools, which is why that is the default behavior.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The event handling code was unoptimized and temporary; it was slated for
a rewrite for performance and non-critical bugs alone. However the old
code may be causing critical bugs so it's being rewritten now.
Fixes:
- backend disconnects are detected immediately instead of on the next
time they are used.
- backend reconnects happen _after_ the retry timeout, not before
- use a persistent read handler and a temporary write handler to avoid
constantly calling epoll_ctl syscalls for potential performance boost.
Updated some tests for proxyconfig.t as it was picking up the
disconnects immediately.
Unrelated to a timing issue I resolved to the benchmark.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the backend handler reads an incomplete response from the network, it
changes state to wait for more data. The want_read state was considering
the data completed if "data read" was bigger than "value length", but it
should have been "value + result line".
This means if the response buffer landed in a bullseye where it has read
more than the size of the value but less than the total size of the
request (typically a span of 200 bytes or less), it would consider the
request complete and look for the END\r\n marker.
This change has been... here forever.
|
|
|
|
|
|
| |
Errors like "trailing data" or "missingend" or etc are only useful if
you're in a debugger and can break and inspect. This adds detail in
uriencoding into the log message when applicable.
|
|
|
|
|
|
|
| |
Response object error conditions were not being checked before looking
at the response buffer. If a response was partially filled then the
backend timed out, a partial response could be sent intead of the
proper backend error.
|
|
|
|
|
|
|
|
|
|
| |
ie:
local b1 = mcp.backend({ label = "b1", host = "127.0.0.1", port = 11511,
connecttimeout = 1, retrytimeout = 0.5, readtimeout = 0.1,
failurelimit = 11 })
... to allow for overriding connect/retry/etc tunables on a per-backend
basis. If not passed in the global settings are used.
|
|
|
|
|
|
|
| |
Logs any backgrounded requests that resulted in an error.
Note that this may be a temporary interface, and could be deprecated in
the future.
|
|
|
|
|
|
|
|
| |
uses mocked backend servers so we can test:
- end to end client to backend proxying
- lua API functions
- configuration reload
- various error conditions
|
|
|
|
|
|
|
|
|
| |
We want to start using cache commands in contexts without a client
connection, but the client object has always been passed to all
functions.
In most cases we only need the worker thread (LIBEVENT_THREAD *t), so
this change adjusts the arguments passed in.
|
|
|
|
|
|
| |
mcp.await(request, pools, 0, mcp.AWAIT_BACKGROUND) will, instead of
waiting on any request to return, simply return an empty table as soon
as the background requests are dispatched.
|
|
|
|
|
|
|
|
| |
"mg" required at least one flag. now "mg key" returns a bare HD on hit
if you don't care about the value.
HD modes would reflect O and k flags in the response, but EN didn't.
This is now fixed for full coverage.
|
|
|
|
| |
for HD/NF/etc responses but not VA.
|
|
|
|
| |
was returning "HD \r\n" and "HD Oetc\r\n" - not to protocol spec.
|
|
|
|
|
| |
At least FreeBSD has perl in /usr/local/bin/perl and no symlink by
default.
|
|
|
|
|
|
|
|
| |
allows using tagged listeners (ex; `-l tag[test]:127.0.0.1:11212`) to
select a top level route for a function.
expects there to not be dozens of listeners, but for a handful will be
faster than a hash table lookup.
|
|
|
|
|
|
| |
returns (exists, previous_token)
optional second argument will replace the flag/token with supplied
flag/token, or nothing if "" is passed.
|
|
|
|
|
|
| |
function accepts a flag, returns (bool, token|nil).
bool indicates if the flag exists, and if the flag has a token it is
returned instead of nil as the second value.
|
|
|
|
|
|
|
|
|
| |
Adds resp:code(), which returns code you can compare with
mcp.MCMC_CODE_*
Adds resp:line(), which returns the raw response line after the command.
This can be used in lua while the flag/token API is missing for the
response object.
|
|
|
|
|
|
|
|
|
| |
Add mcp.request function for quick checking if a flag exists in a
request string.
Also updates internal code for checking the length of a token to use the
endcap properly, and uses that for the r:token(n) requets as well, which
fixes a subtle bug of the token length being too long.
|
|
|
|
|
|
|
|
|
|
| |
- errors if a string value is missing the "\r\n" terminator
- properly uses a value from a response object
- allows passing in a request object for the value as well
- also adds r:vlen() for recovering the value length of a response
think this still needs r:flags() or similar?
|
| |
|
|
|
|
|
|
| |
Lua level API for logging full context of a request/response. Provides
log_req() for simple logging and log_reqsample() for conditional
logging.
|
|
|
|
|
|
|
|
| |
previously mcp.await() only worked if it was called before any other
dispatches.
also fixes a bug if the supplied pool table was key=value instead of an
array-type table.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this is ketama-based, with options for minor compat changes with major
libraries.
does _not_ support weights. The weights bits in the original ketama
broke the algorithm, as changing the number of points would shift
unrelated servers when the list changes.
this also changes backends to take a "name" specifically, instead of an
"ip address". Though note if supplying a hostname instead of an IP there
might be inline DNS lookups on reconnects.
|
|
|
|
|
|
| |
allows tests to run faster, let users make it sleep longer/less time.
Also cuts the sleep time down when actively compacting and coming from
high idle.
|
|
|
|
|
| |
global only setting, not able to be changed for existing backends on
config reload. a few fixes would improve but not can do later.
|
|
|
|
|
|
|
| |
adds watch commands for:
proxycmds - internal raw timing log (tbd?)
proxyevents - config updates, internal errors, etc
proxyuser - logs generated by mcp.log()
|
|
|
|
| |
need better option for this.. seems to fix this one thing.
|
|
|
|
|
| |
lsitener thread may not have actually accepted everything by the time we
start closing them, so it might not show rejected connections.
|
|
|
|
|
| |
the uring bits make abstraction this to the obvious common function a
little harder, so I skipped for now.
|
|
|
|
|
|
|
| |
two builtin filter options (hash stop and tag), because why not :)
hash defaults caused some code reorganization. default hash dist is now
jump, because I can't think of why you'd use modulus over that.
|
|
|
|
|
|
|
| |
The configuration reloader copies data between the "config" global VM
and individual worker VM's. This fixes some crashes/limitations and
improves error handling. It still has a sharp edge as the actual table
copy is unhandled.
|
|
|
|
| |
didn't mean to leave that in there by default.
|
| |
|
|
|
|
|
| |
This allows `make test_tls` to reliably pass when running without
parallelism.
|
|
|
|
|
|
| |
Add two new stat keys, `store_too_large` and `store_no_memory`, to track
occurrences of storage request rejections due to writing too large of a
value and writing beyond available provisioned memory, respectively.
|
|
|
|
| |
seems to pass...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See BUILD for compilation details.
See t/startfile.lua for configuration examples.
(see also https://github.com/memcached/memcached-proxylibs for
extensions, config libraries, more examples)
NOTE: io_uring mode is _not stable_, will crash.
As of this commit it is not recommended to run the proxy in production.
If you are interested please let us know, as we are actively stabilizing
for production use.
|
|
|
|
|
| |
The stat key `log_watchers` indicates the number of active connected
`watch` clients.
|
|
|
|
|
|
|
| |
`-o ssl_min_version` can be used to configure the server to only accept
handshakes from clients with a minimum TLS protocol version. Currently
supported options are TLS v1.0, TLS v1.1, TLS v1.2, and TLS v1.3
(OpenSSL 1.1.1+ only).
|
|
|
|
|
|
|
|
|
|
| |
The previous commit (IO queue submit if queue is not NULL, instead of queue
count) exposed an apparent long standing bug in extstore: do an
ascii-multiget request with multiple keys, but one too-long or otherwise
garbage key. This will reset the queue count to 0 but leave a stack
pointer to now freed memory.
The next request could infinite loop, as this test was causing.
|
|
|
|
|
| |
FreeBSD version as there seems to be portability issues if you just use
sys/queue, plus some extra features I like in this one.
|
|
|
|
|
|
|
|
| |
Add support for `watch connevents` to report opened (`conn_new`)
and closed (`conn_close`) client connections. Event log lines indicate
the connection's remote IP, remote port, and transport type.
`conn_close` events additionally supply a reason for the closing the
connection.
|
|
|
|
|
|
| |
This adds a new field `size` to logger entry lines for item_get,
item_store, and eviction events indicating the size of the associated
item in bytes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had the response code as "HD" in the past, but standardized on OK
while merging a number of "OK-like" rescodes together. This was a
mistake; as many "generic" memcached response codes use "OK". Most of
these are management or specialized uncommon commands.
With this, a client response parser can know for sure if a response is
to a meta command, or some other command.
`-o meta_response_old` starttime option has been added, valid for the
next 3 months, which switches the response code back from HD to OK. In
case any existing users depended on this and need time to migrate.
|