summaryrefslogtreecommitdiff
path: root/src/anet.h
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2015-03-02 11:20:19 +0200
committerantirez <antirez@gmail.com>2017-12-11 11:09:33 +0100
commit9e5224bfd5ec13c14f89fe5eb15441a1d74d8dc5 (patch)
tree3a600448a3a433b5fe1e1d360efa2dcd3ca97a72 /src/anet.h
parent0f26125841b13c29d89a2b78957262f164b31770 (diff)
downloadredis-9e5224bfd5ec13c14f89fe5eb15441a1d74d8dc5.tar.gz
diskless replication on slave side (don't store rdb to file), plus some other related fixes
The implementation of the diskless replication was currently diskless only on the master side. The slave side still stores the received rdb file to the disk before loading it back in and parsing it. other changes: -------------- don't save rdb / aof file when we're a slave that is not synced (sync failed and dataset is empty), so that we don't override an existing one and end up loosing data on failover. loadAppendOnlyFile (loadDataFromDisk) would have exit() if the file doesn't exist, but that would never happen since the file was always already created in initServer before that check. instad: don't create an empty aof file on startup before reading it and only create it when we start writing to it. this allows us to distinguish between success to load an empty file and a failure to load a non-existing file, currently we don't use the above since the startup should succeed even if the file doesn't exist (first server startup). maybe we need to add another config called "preload-file" or "load-on-startup" or "abort-when-load-fails" distinguish between aof configuration and state so that we can re-enable aof only when sync eventually succeeds (and not when exiting from readSyncBulkPayload after a failed attempt) also a CONFIG GET and INFO during rdb loading would have lied SLAVEOF NO ONE, will have an argument to succeed only if the slave is in sync (a specific offset can be provided) tests: add test for not saving on exit for unsynced slave replication tests for diskless slave and diskless master other replication tests improvements (not related to diskless slave)
Diffstat (limited to 'src/anet.h')
-rw-r--r--src/anet.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/anet.h b/src/anet.h
index 7142f78d2..dd735240d 100644
--- a/src/anet.h
+++ b/src/anet.h
@@ -70,6 +70,7 @@ int anetEnableTcpNoDelay(char *err, int fd);
int anetDisableTcpNoDelay(char *err, int fd);
int anetTcpKeepAlive(char *err, int fd);
int anetSendTimeout(char *err, int fd, long long ms);
+int anetRecvTimeout(char *err, int fd, long long ms);
int anetPeerToString(int fd, char *ip, size_t ip_len, int *port);
int anetKeepAlive(char *err, int fd, int interval);
int anetSockName(int fd, char *ip, size_t ip_len, int *port);