summaryrefslogtreecommitdiff
path: root/logger.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-06-27 12:17:59 -0700
committerdormando <dormando@rydia.net>2019-09-17 02:37:15 -0700
commitb5ea90160579ba060b8e1d269595b3ec5d77d740 (patch)
tree96d5dc43912f32b4d48d6a19cf161052e9aaa137 /logger.h
parent554b56687a19300a75ec24184746b5512580c819 (diff)
downloadmemcached-b5ea90160579ba060b8e1d269595b3ec5d77d740.tar.gz
restartable cache
"-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.
Diffstat (limited to 'logger.h')
-rw-r--r--logger.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/logger.h b/logger.h
index 8f4cccf..3cc4594 100644
--- a/logger.h
+++ b/logger.h
@@ -100,6 +100,9 @@ struct logentry_item_store {
/* end intermediary structures */
+/* WARNING: cuddled items aren't compatible with warm restart. more code
+ * necessary to ensure log streams are all flushed/processed before stopping
+ */
typedef struct _logentry {
enum log_entry_subtype event;
uint8_t pad;
@@ -108,7 +111,6 @@ typedef struct _logentry {
struct timeval tv; /* not monotonic! */
int size;
union {
- void *entry; /* probably an item */
char end;
} data[];
} logentry;
@@ -165,6 +167,7 @@ extern pthread_key_t logger_key;
/* public functions */
void logger_init(void);
+void logger_stop(void);
logger *logger_create(void);
#define LOGGER_LOG(l, flag, type, ...) \
@@ -186,4 +189,8 @@ enum logger_add_watcher_ret {
enum logger_add_watcher_ret logger_add_watcher(void *c, const int sfd, uint16_t f);
+/* functions used by restart system */
+uint64_t logger_get_gid(void);
+void logger_set_gid(uint64_t gid);
+
#endif