summaryrefslogtreecommitdiff
path: root/src/cluster.h
diff options
context:
space:
mode:
authorUri Shachar <uri@redislabs.com>2021-06-16 06:35:13 +0300
committerGitHub <noreply@github.com>2021-06-15 20:35:13 -0700
commitc7e502a07bdeec29c2be41da70b483b2156d36db (patch)
tree08625974ea3e8aadd44b5940ea7ed71f777151f3 /src/cluster.h
parente5d8a5eb85b50ee7da1bf652c7d67e8e5b757ec9 (diff)
downloadredis-c7e502a07bdeec29c2be41da70b483b2156d36db.tar.gz
Cleaning up the cluster interface by moving almost all related declar… (#9080)
* Cleaning up the cluster interface by moving almost all related declarations into cluster.h (no logic change -- just moving declarations/definitions around) This initial effort leaves two items out of scope - the configuration parsing into the server struct and the internals exposed by the clusterNode struct. * Remove unneeded declarations of dictSds* Ideally all the dictSds functionality would move from server.c into a dedicated module so we can avoid the duplication in redis-benchmark/cli * Move crc16 back into server.h, will be moved out once we create a seperate header file for hashing functions
Diffstat (limited to 'src/cluster.h')
-rw-r--r--src/cluster.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cluster.h b/src/cluster.h
index f476a50a0..890cd788a 100644
--- a/src/cluster.h
+++ b/src/cluster.h
@@ -15,8 +15,6 @@
* multiplicators of the node timeout value (when ending with MULT). */
#define CLUSTER_FAIL_REPORT_VALIDITY_MULT 2 /* Fail report validity. */
#define CLUSTER_FAIL_UNDO_TIME_MULT 2 /* Undo fail if master is back. */
-#define CLUSTER_FAIL_UNDO_TIME_ADD 10 /* Some additional time. */
-#define CLUSTER_FAILOVER_DELAY 5 /* Seconds */
#define CLUSTER_MF_TIMEOUT 5000 /* Milliseconds to do a manual failover. */
#define CLUSTER_MF_PAUSE_MULT 2 /* Master pause manual failover mult. */
#define CLUSTER_SLAVE_MIGRATION_DELAY 5000 /* Delay for slave migration. */
@@ -288,9 +286,18 @@ typedef struct {
master is up. */
/* ---------------------- API exported outside cluster.c -------------------- */
+void clusterInit(void);
+void clusterCron(void);
+void clusterBeforeSleep(void);
clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, int argc, int *hashslot, int *ask);
+clusterNode *clusterLookupNode(const char *name);
int clusterRedirectBlockedClientIfNeeded(client *c);
void clusterRedirectClient(client *c, clusterNode *n, int hashslot, int error_code);
+void migrateCloseTimedoutSockets(void);
+int verifyClusterConfigWithData(void);
unsigned long getClusterConnectionsCount(void);
+int clusterSendModuleMessageToTarget(const char *target, uint64_t module_id, uint8_t type, unsigned char *payload, uint32_t len);
+void clusterPropagatePublish(robj *channel, robj *message);
+unsigned int keyHashSlot(char *key, int keylen);
#endif /* __CLUSTER_H */