summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-09-19 13:45:20 +0200
committerantirez <antirez@gmail.com>2016-09-19 13:45:20 +0200
commite565632e599bd1801abca2359453feac51312b28 (patch)
tree8948ea61ef1f5af7b7bb12e62990f166ffcc8625 /src/server.h
parente1eccf9a6be88c93b71e28f24ad7e14bef434142 (diff)
downloadredis-e565632e599bd1801abca2359453feac51312b28.tar.gz
Child -> Parent pipe for COW info transferring.
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server.h b/src/server.h
index 0af439cc5..8aad8f983 100644
--- a/src/server.h
+++ b/src/server.h
@@ -806,6 +806,10 @@ struct clusterState;
#undef hz
#endif
+#define CHILD_INFO_MAGIC 0xC17DDA7A12345678LL
+#define CHILD_INFO_TYPE_RDB 0
+#define CHILD_INFO_TYPE_AOF 1
+
struct redisServer {
/* General */
pid_t pid; /* Main process pid. */
@@ -884,6 +888,8 @@ struct redisServer {
size_t resident_set_size; /* RSS sampled in serverCron(). */
long long stat_net_input_bytes; /* Bytes read from network. */
long long stat_net_output_bytes; /* Bytes written to network. */
+ size_t stat_rdb_cow_bytes; /* Copy on write bytes during RDB saving. */
+ size_t stat_aof_cow_bytes; /* Copy on write bytes during AOF rewrite. */
/* The following two are used to track instantaneous metrics, like
* number of operations per second, network traffic. */
struct {
@@ -958,6 +964,13 @@ struct redisServer {
int stop_writes_on_bgsave_err; /* Don't allow writes if can't BGSAVE */
int rdb_pipe_write_result_to_parent; /* RDB pipes used to return the state */
int rdb_pipe_read_result_from_child; /* of each slave in diskless SYNC. */
+ /* Pipe and data structures for child -> parent info sharing. */
+ int child_info_pipe[2]; /* Pipe used to write the child_info_data. */
+ struct {
+ int process_type; /* AOF or RDB child? */
+ size_t cow_size; /* Copy on write size. */
+ unsigned long long magic; /* Magic value to make sure data is valid. */
+ } child_info_data;
/* Propagation of commands in AOF / replication */
redisOpArray also_propagate; /* Additional command to propagate. */
/* Logging */
@@ -1411,6 +1424,12 @@ void aofRewriteBufferReset(void);
unsigned long aofRewriteBufferSize(void);
ssize_t aofReadDiffFromParent(void);
+/* Child info */
+void openChildInfoPipe(void);
+void closeChildInfoPipe(void);
+void sendChildInfo(int process_type);
+void receiveChildInfo(void);
+
/* Sorted sets data type */
/* Input flags. */