diff options
author | Hemal Shah <hemal@stripe.com> | 2022-10-19 19:17:13 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-03-15 17:16:36 -0700 |
commit | 9b3c946f485309cdf50f7fb1622707b5373e33f3 (patch) | |
tree | 50442521e1d2912caddfe0266f5223b0f4b48fb3 /logger.h | |
parent | c04701654413719d4abd7645c6d7b3fba4255e85 (diff) | |
download | memcached-9b3c946f485309cdf50f7fb1622707b5373e33f3.tar.gz |
log: Add a new watcher to watch for deletions.
`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
Diffstat (limited to 'logger.h')
-rw-r--r-- | logger.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -22,6 +22,7 @@ enum log_entry_type { LOGGER_SLAB_MOVE, LOGGER_CONNECTION_NEW, LOGGER_CONNECTION_CLOSE, + LOGGER_DELETIONS, #ifdef EXTSTORE LOGGER_EXTSTORE_WRITE, LOGGER_COMPACT_START, @@ -108,6 +109,14 @@ struct logentry_item_store { char key[]; }; +struct logentry_deletion { + int nbytes; + int cmd; + uint8_t nkey; + uint8_t clsid; + char key[]; +}; + struct logentry_conn_event { int transport; int reason; @@ -164,6 +173,7 @@ struct _logentry { #define LOG_PROXYREQS (1<<10) /* command logs from proxy */ #define LOG_PROXYEVENTS (1<<11) /* error log stream from proxy */ #define LOG_PROXYUSER (1<<12) /* user generated logs from proxy */ +#define LOG_DELETIONS (1<<13) /* see whats deleted */ typedef struct _logger { struct _logger *prev; |