| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
`watch deletions`: would log all keys which are deleted using either `delete` or `md` command.
The log line would contain the command used, the key, the clsid and size of the deleted item.
Items which result in delete miss or are marked as stale wouldn't show up in the logs
|
|
|
|
|
|
|
|
|
| |
Sending 's' flag to metaset now returns the size of the item stored.
Useful if you want to know how large an append/prepended item now is.
If the 'N' flag is supplied while in append/prepend mode, allows
autovivifying (with exptime supplied from N) for append/prepend style
keys that don't need headers created first.
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
If for some reason a res object is not passed into mcp.log_req or
mcp.log_reqsample it would still strlen() the backend name/port's, which
could crash.
|
|
|
|
|
| |
allow users to differentiate thread functions externally to memcached.
Useful for setting priorities or pinning threads to CPU's.
|
|
|
|
|
|
|
|
|
|
| |
without this patch, tests failed with
# Failed test 'saw a real log line after a skip'
# at t/watcher.t line 54.
# 'ts=-2126224733.765946 gid=80003 type=item_get key=foo status=not_found clsid=0 cfd=23 size=0
# '
# doesn't match '(?^:ts=\d+\.\d+\ gid=\d+ type=item_get)'
|
|
|
|
|
|
|
|
|
| |
It dawns on me now that I should've been hinting or forcing the type at
all of the LOGGER_LOG endpoints to ensure they match the va_arg side on
logger.c. This patch initially swaps size_t's for int's so at least it's
using less complicated promotion rules.
Fixes a crash on centos 7 when logging sets via `watch mutations`
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We've noticed in some rare cases, that sending a sigterm to a memcached process
could lead to a race condition which leads to a deadlock of the process.
The worker threads are stuck on 'worker_hang_lock' because the shutdown
process hasn't completed yet.
The shudown process hasn't completed since the logger thread signals
'logger_stack_cond' without locking its corresponding 'logger_stack_lock'.
This could cause the signal to get lost, causing the logger thread to
wait indefinitely on 'logger_stack_cond' in logger_thread().
|
|
|
|
|
|
|
|
|
| |
delete the magic logging and require mcp.log_req* be used if you want
those types of entries to appear. keeps a separate data stream from
"proxyuser" just in case that's useful.
proxycmds wasn't able to get enough context to autogenerate useful log
lines, so I'd rather not have it in there at all.
|
|
|
|
|
|
| |
Lua level API for logging full context of a request/response. Provides
log_req() for simple logging and log_reqsample() for conditional
logging.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
wasn't setting e->size of the log entry, so the data would corrupt.
think I need an assert on e->size not being set from the function?
|
| |
|
|
|
|
|
|
|
| |
adds watch commands for:
proxycmds - internal raw timing log (tbd?)
proxyevents - config updates, internal errors, etc
proxyuser - logs generated by mcp.log()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Adding a new type of log entry required updating code in a bunch of
places. Now we use callbacks in the entry structure instead, cutting
down the code and some awkwardness. Should also make it easier for
plugins/extra systems to add log entries.
Moving the writer/parsers to their own section makes the actual logging
code easier to follow, as an added bonus.
|
|
|
|
|
|
|
|
|
| |
Inspired by #768 - logger thread would wake up once per second looking
for watchers or log entries, but without any watchers. Now sleeps on a
condition.
Note that if I ever actually get logger to syslog/stdout/stderr/etc
working properly this will still always poll.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
of course the previous commit didn't actually fix the bug: during
poll() call we weren't filtering for the right watcher when we were
polling a specific one. This could lead to reading a POLLHUP on the
wrong socket and other issues.
hopefully that solves some mysteries with the watcher system.
|
|
|
|
| |
If too many watchers exist, fails to release logger stack lock.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"-e /path/to/tmpfsmnt/file"
SIGUSR1 for graceful stop
restart requires the same memory limit, slab sizes, and some other
infrequently changed details. Most other options and features can
change between restarts. Binary can be upgraded between restarts.
Restart does some fixup work on start for every item in cache. Can take
over a minute with more than a few hundred million items in cache.
Keep in mind when a cache is down it may be missing invalidations,
updates, and so on.
|
|
|
|
| |
you can now monitor fetch and mutations of a given client
|
| |
|
|
|
|
|
| |
Modified Logger and Crawler to use the correct buffer length when
they are printing URI encoded keys. Fixes #471
|
|
|
|
| |
I have no idea why this worked without the include? fixes #478
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the work done by Tharanga. Some commits squashed in by
dormando. Also reviewed by dormando.
Tested, working, but experimental implementation of TLS for memcached.
Enable with ./configure --enable-tls
Requires OpenSSL 1.1.0 or better.
See `memcached -h` output for usage.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
ARMv8 (and in general aarch64) has flipped some strictness requirements.
However, at some point in history the NEED_ALIGN configure check code was
optimized away by GCC.
This fixes detection of alignment, as well as fixes an unaligned access that
snuck in via the logging code.
Also fixes a 64bit GCC atomics test that possibly never worked before.
|
|
|
|
|
|
| |
"watch evictions" will show a stream of evictions + writes to extstore.
useful for analyzing the remaining ttl or key pattern of stuff being
flushed.
|
|
|
|
|
|
| |
if < 2 free pages left, "evict" objects which haven't been hit at all.
should be better than evicting everything if we can continue compacting.
|
|
|
|
|
| |
been squashing reorganizing, and pulling code off to go upstream ahead
of merging the whole branch.
|
|
|
|
|
|
|
| |
This wasn't a bug, but add -1 here makes it more clear. The function will
early exit in any cases where it would've overflowed here.
thanks to shqking on github for the report
|
|
|
|
| |
converts the python script to C, more or less.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when trying to manually run a crawl, the internal autocrawler is now blocked
from restarting for 60 seconds.
the internal autocrawl now independently schedules LRU's, and can re-schedule
sub-LRU's while others are still running. should allow much better memory
control when some sub-lru's (such as TEMP or WARM) are small, or slab classes
are differently sized.
this also makes the crawler drop its lock frequently.. this fixes an issue
where a long crawl happening at the same time as a hash table expansion could
hang the server until the crawl finished.
to improve still:
- elapsed time can be wrong in the logger entry
- need to cap number of entries scanned. enough set pressure and a crawl may
never finish.
|
|
|
|
|
|
|
|
|
|
|
| |
The logger and lru maintainer threads both adjust how long they sleep
based on how busy they are. This adjustment should be exponential, to
more quickly adjust to workloads.
The logger thread in particular would only adjust 50 microseconds at a
time, and was capped at 100 milliseconds of sleep, causing many
unnecessary wakeups on an otherwise idle dev machine. Adjust this cap to
1 second.
|
|
|
|
| |
you can now cross-reference slab classes of evicted prefixes with misses
|
|
|
|
|
| |
the TTL is relative so you won't see the exact TTL on entry. Also fixes two
off-by-one's for the status values.
|
|
|
|
|
| |
should be looking for 1% of potential reclaims, not 1% of all the items it
saw. Otherwise could be wedged into doing nothing.
|
|
|
|
| |
for the internal checker, primarily.
|
|
|
|
| |
also fixes logger L_DEBUG prints.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
We only explicitly tested for short atomics. Then I added 8byte atomic usage
in the logger: now separately test for those.. since some systems can have one
but not the other, I'd rather use atomics where available then fall back to
a mutex when necessary.
Reproduced this on a raspberry pi 2.
|
|
|
|
|
|
| |
now a main function + helpers, with a separate write function.
drives me a lot less crazy now.
|
|
|
|
|
|
| |
Was in a working state for release, now doing some work to clean up the
routine. Is much shorter and clearer now. Function needs to be split into
several functions from here.
|