2012-11-08 18:25:23 +01:00
|
|
|
/* Redis Cluster implementation.
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009-2012, Salvatore Sanfilippo <antirez at gmail dot com>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* * Neither the name of Redis nor the names of its contributors may be used
|
|
|
|
* to endorse or promote products derived from this software without
|
|
|
|
* specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2015-07-26 15:14:57 +02:00
|
|
|
#include "server.h"
|
2013-10-09 15:37:20 +02:00
|
|
|
#include "cluster.h"
|
2023-11-14 13:36:43 +02:00
|
|
|
#include "cluster_legacy.h"
|
2012-04-02 13:10:39 +02:00
|
|
|
#include "endianconv.h"
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
#include "connection.h"
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2011-09-20 00:00:14 +01:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
2011-03-29 17:51:15 +02:00
|
|
|
#include <arpa/inet.h>
|
2011-03-30 14:58:19 +02:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
2014-01-15 10:31:12 +01:00
|
|
|
#include <sys/stat.h>
|
2015-01-30 11:23:27 +01:00
|
|
|
#include <math.h>
|
2023-11-09 11:04:47 +02:00
|
|
|
#include <sys/file.h>
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2014-01-29 11:22:22 +01:00
|
|
|
/* A global reference to myself is handy to make code more clear.
|
|
|
|
* Myself always points to server.cluster->myself, that is, the clusterNode
|
|
|
|
* that represents this node. */
|
|
|
|
clusterNode *myself = NULL;
|
|
|
|
|
2013-10-09 15:37:20 +02:00
|
|
|
clusterNode *createClusterNode(char *nodename, int flags);
|
2021-01-10 02:24:58 +08:00
|
|
|
void clusterAddNode(clusterNode *node);
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask);
|
2019-09-12 10:56:54 +03:00
|
|
|
void clusterReadHandler(connection *conn);
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterSendPing(clusterLink *link, int type);
|
|
|
|
void clusterSendFail(char *nodename);
|
2013-09-20 09:22:21 +02:00
|
|
|
void clusterSendFailoverAuthIfNeeded(clusterNode *node, clusterMsg *request);
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterUpdateState(void);
|
2023-11-01 12:37:00 +02:00
|
|
|
int clusterNodeCoversSlot(clusterNode *n, int slot);
|
2022-11-16 19:24:18 -08:00
|
|
|
list *clusterGetNodesInMyShard(clusterNode *node);
|
2011-04-07 17:46:28 +02:00
|
|
|
int clusterNodeAddSlave(clusterNode *master, clusterNode *slave);
|
2011-04-07 21:34:41 +02:00
|
|
|
int clusterAddSlot(clusterNode *n, int slot);
|
2013-02-21 11:44:58 +01:00
|
|
|
int clusterDelSlot(int slot);
|
2013-03-15 16:35:16 +01:00
|
|
|
int clusterDelNodeSlots(clusterNode *node);
|
2013-02-22 17:45:49 +01:00
|
|
|
int clusterNodeSetSlotBit(clusterNode *n, int slot);
|
2013-03-20 00:30:47 +01:00
|
|
|
void clusterSetMaster(clusterNode *n);
|
2013-09-26 16:54:43 +02:00
|
|
|
void clusterHandleSlaveFailover(void);
|
2014-01-30 18:05:11 +01:00
|
|
|
void clusterHandleSlaveMigration(int max_slaves);
|
2013-02-28 15:41:54 +01:00
|
|
|
int bitmapTestBit(unsigned char *bitmap, int pos);
|
2023-07-05 17:46:23 -07:00
|
|
|
void bitmapSetBit(unsigned char *bitmap, int pos);
|
|
|
|
void bitmapClearBit(unsigned char *bitmap, int pos);
|
2013-10-03 09:55:20 +02:00
|
|
|
void clusterDoBeforeSleep(int flags);
|
2013-11-08 16:26:50 +01:00
|
|
|
void clusterSendUpdate(clusterLink *link, clusterNode *node);
|
2014-02-05 13:01:24 +01:00
|
|
|
void resetManualFailover(void);
|
2014-03-11 11:16:18 +01:00
|
|
|
void clusterCloseAllSlots(void);
|
2014-05-15 11:43:06 +02:00
|
|
|
void clusterSetNodeAsMaster(clusterNode *n);
|
|
|
|
void clusterDelNode(clusterNode *delnode);
|
2015-07-27 15:08:58 +02:00
|
|
|
sds representClusterNodeFlags(sds ci, uint16_t flags);
|
2022-03-29 10:05:06 +03:00
|
|
|
sds representSlotInfo(sds ci, uint16_t *slot_info_pairs, int slot_info_pairs_count);
|
|
|
|
void clusterFreeNodesSlotsInfo(clusterNode *n);
|
2015-03-20 16:42:49 +01:00
|
|
|
uint64_t clusterGetMaxEpoch(void);
|
|
|
|
int clusterBumpConfigEpochWithoutConsensus(void);
|
2018-03-30 13:16:07 +02:00
|
|
|
void moduleCallClusterReceivers(const char *sender_id, uint64_t module_id, uint8_t type, const unsigned char *payload, uint32_t len);
|
2021-04-26 10:58:54 +08:00
|
|
|
const char *clusterGetMessageTypeString(int type);
|
2022-01-03 01:54:47 +01:00
|
|
|
void removeChannelsInSlot(unsigned int slot);
|
2021-08-31 08:25:36 +02:00
|
|
|
unsigned int countKeysInSlot(unsigned int hashslot);
|
2022-01-03 01:54:47 +01:00
|
|
|
unsigned int countChannelsInSlot(unsigned int hashslot);
|
2021-08-31 08:25:36 +02:00
|
|
|
unsigned int delKeysInSlot(unsigned int hashslot);
|
2022-11-16 19:24:18 -08:00
|
|
|
void clusterAddNodeToShard(const char *shard_id, clusterNode *node);
|
|
|
|
list *clusterLookupNodeListByShardId(const char *shard_id);
|
|
|
|
void clusterRemoveNodeFromShard(clusterNode *node);
|
|
|
|
int auxShardIdSetter(clusterNode *n, void *value, int length);
|
|
|
|
sds auxShardIdGetter(clusterNode *n, sds s);
|
2023-02-14 16:47:55 -05:00
|
|
|
int auxShardIdPresent(clusterNode *n);
|
2023-06-18 12:16:51 +08:00
|
|
|
int auxHumanNodenameSetter(clusterNode *n, void *value, int length);
|
|
|
|
sds auxHumanNodenameGetter(clusterNode *n, sds s);
|
|
|
|
int auxHumanNodenamePresent(clusterNode *n);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int auxTcpPortSetter(clusterNode *n, void *value, int length);
|
|
|
|
sds auxTcpPortGetter(clusterNode *n, sds s);
|
|
|
|
int auxTcpPortPresent(clusterNode *n);
|
|
|
|
int auxTlsPortSetter(clusterNode *n, void *value, int length);
|
|
|
|
sds auxTlsPortGetter(clusterNode *n, sds s);
|
|
|
|
int auxTlsPortPresent(clusterNode *n);
|
2022-11-01 22:26:44 -04:00
|
|
|
static void clusterBuildMessageHdr(clusterMsg *hdr, int type, size_t msglen);
|
2023-10-30 17:30:59 +02:00
|
|
|
void freeClusterLink(clusterLink *link);
|
2023-10-31 15:55:01 +02:00
|
|
|
int verifyClusterNodeId(const char *name, int length);
|
2021-08-31 08:25:36 +02:00
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int getNodeDefaultClientPort(clusterNode *n) {
|
|
|
|
return server.tls_cluster ? n->tls_port : n->tcp_port;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int getNodeDefaultReplicationPort(clusterNode *n) {
|
|
|
|
return server.tls_replication ? n->tls_port : n->tcp_port;
|
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
int clusterNodeClientPort(clusterNode *n, int use_tls) {
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
return use_tls ? n->tls_port : n->tcp_port;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int defaultClientPort(void) {
|
|
|
|
return server.tls_cluster ? server.tls_port : server.port;
|
|
|
|
}
|
|
|
|
|
2023-07-05 17:46:23 -07:00
|
|
|
#define isSlotUnclaimed(slot) \
|
|
|
|
(server.cluster->slots[slot] == NULL || \
|
|
|
|
bitmapTestBit(server.cluster->owner_not_claiming_slot, slot))
|
|
|
|
|
2020-10-27 16:36:00 +02:00
|
|
|
#define RCVBUF_INIT_LEN 1024
|
|
|
|
#define RCVBUF_MAX_PREALLOC (1<<20) /* 1MB */
|
|
|
|
|
2021-06-16 06:35:13 +03:00
|
|
|
/* Cluster nodes hash table, mapping nodes addresses 1.2.3.4:6379 to
|
|
|
|
* clusterNode structures. */
|
|
|
|
dictType clusterNodesDictType = {
|
|
|
|
dictSdsHash, /* hash function */
|
|
|
|
NULL, /* key dup */
|
|
|
|
NULL, /* val dup */
|
|
|
|
dictSdsKeyCompare, /* key compare */
|
|
|
|
dictSdsDestructor, /* key destructor */
|
|
|
|
NULL, /* val destructor */
|
|
|
|
NULL /* allow to expand */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Cluster re-addition blacklist. This maps node IDs to the time
|
2022-02-20 13:11:20 +08:00
|
|
|
* we can re-add this node. The goal is to avoid reading a removed
|
2021-06-16 06:35:13 +03:00
|
|
|
* node for some time. */
|
|
|
|
dictType clusterNodesBlackListDictType = {
|
|
|
|
dictSdsCaseHash, /* hash function */
|
|
|
|
NULL, /* key dup */
|
|
|
|
NULL, /* val dup */
|
|
|
|
dictSdsKeyCaseCompare, /* key compare */
|
|
|
|
dictSdsDestructor, /* key destructor */
|
|
|
|
NULL, /* val destructor */
|
|
|
|
NULL /* allow to expand */
|
|
|
|
};
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Cluster shards hash table, mapping shard id to list of nodes */
|
|
|
|
dictType clusterSdsToListType = {
|
|
|
|
dictSdsHash, /* hash function */
|
|
|
|
NULL, /* key dup */
|
|
|
|
NULL, /* val dup */
|
|
|
|
dictSdsKeyCompare, /* key compare */
|
|
|
|
dictSdsDestructor, /* key destructor */
|
|
|
|
dictListDestructor, /* val destructor */
|
|
|
|
NULL /* allow to expand */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Aux fields are introduced in Redis 7.2 to support the persistence
|
|
|
|
* of various important node properties, such as shard id, in nodes.conf.
|
|
|
|
* Aux fields take an explicit format of name=value pairs and have no
|
|
|
|
* intrinsic order among them. Aux fields are always grouped together
|
|
|
|
* at the end of the second column of each row after the node's IP
|
|
|
|
* address/port/cluster_port and the optional hostname. Aux fields
|
|
|
|
* are separated by ','. */
|
|
|
|
|
|
|
|
/* Aux field setter function prototype
|
|
|
|
* return C_OK when the update is successful; C_ERR otherwise */
|
|
|
|
typedef int (aux_value_setter) (clusterNode* n, void *value, int length);
|
|
|
|
/* Aux field getter function prototype
|
|
|
|
* return an sds that is a concatenation of the input sds string and
|
|
|
|
* the aux value */
|
|
|
|
typedef sds (aux_value_getter) (clusterNode* n, sds s);
|
|
|
|
|
2023-02-14 16:47:55 -05:00
|
|
|
typedef int (aux_value_present) (clusterNode* n);
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
typedef struct {
|
|
|
|
char *field;
|
|
|
|
aux_value_setter *setter;
|
|
|
|
aux_value_getter *getter;
|
2023-02-14 16:47:55 -05:00
|
|
|
aux_value_present *isPresent;
|
2022-11-16 19:24:18 -08:00
|
|
|
} auxFieldHandler;
|
|
|
|
|
|
|
|
/* Assign index to each aux field */
|
|
|
|
typedef enum {
|
2023-06-18 12:16:51 +08:00
|
|
|
af_shard_id,
|
|
|
|
af_human_nodename,
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
af_tcp_port,
|
|
|
|
af_tls_port,
|
2022-11-16 19:24:18 -08:00
|
|
|
af_count,
|
|
|
|
} auxFieldIndex;
|
|
|
|
|
|
|
|
/* Note that
|
|
|
|
* 1. the order of the elements below must match that of their
|
|
|
|
* indices as defined in auxFieldIndex
|
|
|
|
* 2. aux name can contain characters that pass the isValidAuxChar check only */
|
|
|
|
auxFieldHandler auxFieldHandlers[] = {
|
2023-02-14 16:47:55 -05:00
|
|
|
{"shard-id", auxShardIdSetter, auxShardIdGetter, auxShardIdPresent},
|
2023-06-18 12:16:51 +08:00
|
|
|
{"nodename", auxHumanNodenameSetter, auxHumanNodenameGetter, auxHumanNodenamePresent},
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
{"tcp-port", auxTcpPortSetter, auxTcpPortGetter, auxTcpPortPresent},
|
|
|
|
{"tls-port", auxTlsPortSetter, auxTlsPortGetter, auxTlsPortPresent},
|
2022-11-16 19:24:18 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
int auxShardIdSetter(clusterNode *n, void *value, int length) {
|
|
|
|
if (verifyClusterNodeId(value, length) == C_ERR) {
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
memcpy(n->shard_id, value, CLUSTER_NAMELEN);
|
|
|
|
/* if n already has replicas, make sure they all agree
|
|
|
|
* on the shard id */
|
|
|
|
for (int i = 0; i < n->numslaves; i++) {
|
|
|
|
if (memcmp(n->slaves[i]->shard_id, n->shard_id, CLUSTER_NAMELEN) != 0) {
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clusterAddNodeToShard(value, n);
|
|
|
|
return C_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sds auxShardIdGetter(clusterNode *n, sds s) {
|
|
|
|
return sdscatprintf(s, "%.40s", n->shard_id);
|
|
|
|
}
|
2022-07-27 10:46:31 +08:00
|
|
|
|
2023-02-14 16:47:55 -05:00
|
|
|
int auxShardIdPresent(clusterNode *n) {
|
|
|
|
return strlen(n->shard_id);
|
|
|
|
}
|
|
|
|
|
2023-06-18 12:16:51 +08:00
|
|
|
int auxHumanNodenameSetter(clusterNode *n, void *value, int length) {
|
|
|
|
if (n && !strncmp(value, n->human_nodename, length)) {
|
|
|
|
return C_OK;
|
|
|
|
} else if (!n && (length == 0)) {
|
|
|
|
return C_OK;
|
|
|
|
}
|
|
|
|
if (n) {
|
|
|
|
n->human_nodename = sdscpylen(n->human_nodename, value, length);
|
|
|
|
} else if (sdslen(n->human_nodename) != 0) {
|
|
|
|
sdsclear(n->human_nodename);
|
|
|
|
} else {
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
return C_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sds auxHumanNodenameGetter(clusterNode *n, sds s) {
|
2023-06-20 08:13:18 +08:00
|
|
|
return sdscatprintf(s, "%s", n->human_nodename);
|
2023-06-18 12:16:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int auxHumanNodenamePresent(clusterNode *n) {
|
2023-06-20 08:13:18 +08:00
|
|
|
return sdslen(n->human_nodename);
|
2023-06-18 12:16:51 +08:00
|
|
|
}
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int auxTcpPortSetter(clusterNode *n, void *value, int length) {
|
|
|
|
if (length > 5 || length < 1) {
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
char buf[length + 1];
|
|
|
|
memcpy(buf, (char*)value, length);
|
|
|
|
buf[length] = '\0';
|
|
|
|
n->tcp_port = atoi(buf);
|
|
|
|
return (n->tcp_port < 0 || n->tcp_port >= 65536) ? C_ERR : C_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sds auxTcpPortGetter(clusterNode *n, sds s) {
|
|
|
|
return sdscatprintf(s, "%d", n->tcp_port);
|
|
|
|
}
|
|
|
|
|
|
|
|
int auxTcpPortPresent(clusterNode *n) {
|
|
|
|
return n->tcp_port >= 0 && n->tcp_port < 65536;
|
|
|
|
}
|
|
|
|
|
|
|
|
int auxTlsPortSetter(clusterNode *n, void *value, int length) {
|
|
|
|
if (length > 5 || length < 1) {
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
char buf[length + 1];
|
|
|
|
memcpy(buf, (char*)value, length);
|
|
|
|
buf[length] = '\0';
|
|
|
|
n->tls_port = atoi(buf);
|
|
|
|
return (n->tls_port < 0 || n->tls_port >= 65536) ? C_ERR : C_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
sds auxTlsPortGetter(clusterNode *n, sds s) {
|
|
|
|
return sdscatprintf(s, "%d", n->tls_port);
|
|
|
|
}
|
|
|
|
|
|
|
|
int auxTlsPortPresent(clusterNode *n) {
|
|
|
|
return n->tls_port >= 0 && n->tls_port < 65536;
|
|
|
|
}
|
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
/* clusterLink send queue blocks */
|
|
|
|
typedef struct {
|
|
|
|
size_t totlen; /* Total length of this block including the message */
|
|
|
|
int refcount; /* Number of cluster link send msg queues containing the message */
|
|
|
|
clusterMsg msg;
|
|
|
|
} clusterMsgSendBlock;
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* Initialization
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2014-04-24 16:04:08 +02:00
|
|
|
/* Load the cluster config from 'filename'.
|
|
|
|
*
|
|
|
|
* If the file does not exist or is zero-length (this may happen because
|
|
|
|
* when we lock the nodes.conf file, we create a zero-length one for the
|
2015-07-26 23:17:55 +02:00
|
|
|
* sake of locking if it does not already exist), C_ERR is returned.
|
|
|
|
* If the configuration was loaded from the file, C_OK is returned. */
|
2011-03-29 17:51:15 +02:00
|
|
|
int clusterLoadConfig(char *filename) {
|
|
|
|
FILE *fp = fopen(filename,"r");
|
2014-04-24 16:04:08 +02:00
|
|
|
struct stat sb;
|
2011-04-07 12:55:02 +02:00
|
|
|
char *line;
|
2011-04-07 17:46:28 +02:00
|
|
|
int maxline, j;
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2014-04-24 16:23:03 +02:00
|
|
|
if (fp == NULL) {
|
|
|
|
if (errno == ENOENT) {
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2014-04-24 16:23:03 +02:00
|
|
|
} else {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2014-04-24 16:23:03 +02:00
|
|
|
"Loading the cluster node config from %s: %s",
|
|
|
|
filename, strerror(errno));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
2011-04-07 12:55:02 +02:00
|
|
|
|
2021-09-29 00:10:33 -04:00
|
|
|
if (redis_fstat(fileno(fp),&sb) == -1) {
|
|
|
|
serverLog(LL_WARNING,
|
|
|
|
"Unable to obtain the cluster node config file stat %s: %s",
|
|
|
|
filename, strerror(errno));
|
|
|
|
exit(1);
|
|
|
|
}
|
2015-07-26 23:17:55 +02:00
|
|
|
/* Check if the file is zero-length: if so return C_ERR to signal
|
2014-04-24 16:04:08 +02:00
|
|
|
* we have to write the config. */
|
2021-09-29 00:10:33 -04:00
|
|
|
if (sb.st_size == 0) {
|
2014-04-24 16:04:08 +02:00
|
|
|
fclose(fp);
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2014-04-24 16:04:08 +02:00
|
|
|
}
|
|
|
|
|
2014-07-31 14:51:05 -04:00
|
|
|
/* Parse the file. Note that single lines of the cluster config file can
|
2011-04-07 12:55:02 +02:00
|
|
|
* be really long as they include all the hash slots of the node.
|
2013-03-04 19:45:36 +01:00
|
|
|
* This means in the worst possible case, half of the Redis slots will be
|
|
|
|
* present in a single line, possibly in importing or migrating state, so
|
|
|
|
* together with the node ID of the sender/receiver.
|
|
|
|
*
|
2015-07-27 14:55:45 +02:00
|
|
|
* To simplify we allocate 1024+CLUSTER_SLOTS*128 bytes per line. */
|
|
|
|
maxline = 1024+CLUSTER_SLOTS*128;
|
2011-04-07 12:55:02 +02:00
|
|
|
line = zmalloc(maxline);
|
|
|
|
while(fgets(line,maxline,fp) != NULL) {
|
2022-11-16 19:24:18 -08:00
|
|
|
int argc, aux_argc;
|
|
|
|
sds *argv, *aux_argv;
|
2011-04-07 17:46:28 +02:00
|
|
|
clusterNode *n, *master;
|
|
|
|
char *p, *s;
|
|
|
|
|
2014-01-15 11:23:34 +01:00
|
|
|
/* Skip blank lines, they can be created either by users manually
|
|
|
|
* editing nodes.conf or by the config writing process if stopped
|
|
|
|
* before the truncate() call. */
|
2016-11-16 14:13:13 +01:00
|
|
|
if (line[0] == '\n' || line[0] == '\0') continue;
|
2014-01-15 11:23:34 +01:00
|
|
|
|
|
|
|
/* Split the line into arguments for processing. */
|
|
|
|
argv = sdssplitargs(line,&argc);
|
|
|
|
if (argv == NULL) goto fmterr;
|
|
|
|
|
2014-03-27 14:54:57 +01:00
|
|
|
/* Handle the special "vars" line. Don't pretend it is the last
|
|
|
|
* line even if it actually is when generated by Redis. */
|
|
|
|
if (strcasecmp(argv[0],"vars") == 0) {
|
2019-09-02 11:41:16 +02:00
|
|
|
if (!(argc % 2)) goto fmterr;
|
2014-03-27 14:54:57 +01:00
|
|
|
for (j = 1; j < argc; j += 2) {
|
|
|
|
if (strcasecmp(argv[j],"currentEpoch") == 0) {
|
|
|
|
server.cluster->currentEpoch =
|
|
|
|
strtoull(argv[j+1],NULL,10);
|
2014-03-27 15:01:24 +01:00
|
|
|
} else if (strcasecmp(argv[j],"lastVoteEpoch") == 0) {
|
|
|
|
server.cluster->lastVoteEpoch =
|
2014-03-27 14:54:57 +01:00
|
|
|
strtoull(argv[j+1],NULL,10);
|
|
|
|
} else {
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-03-27 14:54:57 +01:00
|
|
|
"Skipping unknown cluster config variable '%s'",
|
|
|
|
argv[j]);
|
|
|
|
}
|
|
|
|
}
|
2014-08-01 21:48:12 -04:00
|
|
|
sdsfreesplitres(argv,argc);
|
2014-03-27 14:54:57 +01:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-03-27 12:33:42 -04:00
|
|
|
/* Regular config lines have at least eight fields */
|
2020-01-07 10:28:36 +08:00
|
|
|
if (argc < 8) {
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2014-03-27 12:33:42 -04:00
|
|
|
|
2011-04-07 17:46:28 +02:00
|
|
|
/* Create this node if it does not exist */
|
2022-04-05 13:51:51 +08:00
|
|
|
if (verifyClusterNodeId(argv[0], sdslen(argv[0])) == C_ERR) {
|
|
|
|
sdsfreesplitres(argv, argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
n = clusterLookupNode(argv[0], sdslen(argv[0]));
|
2011-04-07 17:46:28 +02:00
|
|
|
if (!n) {
|
|
|
|
n = createClusterNode(argv[0],0);
|
|
|
|
clusterAddNode(n);
|
|
|
|
}
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Format for the node address and auxiliary argument information:
|
2023-06-18 12:16:51 +08:00
|
|
|
* ip:port[@cport][,hostname][,aux=val]*] */
|
2022-11-16 19:24:18 -08:00
|
|
|
|
|
|
|
aux_argv = sdssplitlen(argv[1], sdslen(argv[1]), ",", 1, &aux_argc);
|
|
|
|
if (aux_argv == NULL) {
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2022-01-02 19:48:29 -08:00
|
|
|
|
2022-03-16 14:07:24 -07:00
|
|
|
/* Hostname is an optional argument that defines the endpoint
|
|
|
|
* that can be reported to clients instead of IP. */
|
2022-11-16 19:24:18 -08:00
|
|
|
if (aux_argc > 1 && sdslen(aux_argv[1]) > 0) {
|
|
|
|
n->hostname = sdscpy(n->hostname, aux_argv[1]);
|
2022-03-16 14:07:24 -07:00
|
|
|
} else if (sdslen(n->hostname) != 0) {
|
|
|
|
sdsclear(n->hostname);
|
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* All fields after hostname are auxiliary and they take on
|
|
|
|
* the format of "aux=val" where both aux and val can contain
|
|
|
|
* characters that pass the isValidAuxChar check only. The order
|
|
|
|
* of the aux fields is insignificant. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int aux_tcp_port = 0;
|
|
|
|
int aux_tls_port = 0;
|
2022-11-16 19:24:18 -08:00
|
|
|
for (int i = 2; i < aux_argc; i++) {
|
|
|
|
int field_argc;
|
|
|
|
sds *field_argv;
|
|
|
|
field_argv = sdssplitlen(aux_argv[i], sdslen(aux_argv[i]), "=", 1, &field_argc);
|
|
|
|
if (field_argv == NULL || field_argc != 2) {
|
|
|
|
/* Invalid aux field format */
|
|
|
|
if (field_argv != NULL) sdsfreesplitres(field_argv, field_argc);
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Validate that both aux and value contain valid characters only */
|
|
|
|
for (unsigned j = 0; j < 2; j++) {
|
2023-06-18 12:16:51 +08:00
|
|
|
if (!isValidAuxString(field_argv[j],sdslen(field_argv[j]))){
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Invalid aux field format */
|
|
|
|
sdsfreesplitres(field_argv, field_argc);
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Note that we don't expect lots of aux fields in the foreseeable
|
|
|
|
* future so a linear search is completely fine. */
|
|
|
|
int field_found = 0;
|
|
|
|
for (unsigned j = 0; j < numElements(auxFieldHandlers); j++) {
|
|
|
|
if (sdslen(field_argv[0]) != strlen(auxFieldHandlers[j].field) ||
|
|
|
|
memcmp(field_argv[0], auxFieldHandlers[j].field, sdslen(field_argv[0])) != 0) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
field_found = 1;
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
aux_tcp_port |= j == af_tcp_port;
|
|
|
|
aux_tls_port |= j == af_tls_port;
|
2022-11-16 19:24:18 -08:00
|
|
|
if (auxFieldHandlers[j].setter(n, field_argv[1], sdslen(field_argv[1])) != C_OK) {
|
|
|
|
/* Invalid aux field format */
|
|
|
|
sdsfreesplitres(field_argv, field_argc);
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (field_found == 0) {
|
|
|
|
/* Invalid aux field format */
|
|
|
|
sdsfreesplitres(field_argv, field_argc);
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
|
|
|
|
sdsfreesplitres(field_argv, field_argc);
|
|
|
|
}
|
2011-04-07 17:46:28 +02:00
|
|
|
/* Address and port */
|
2022-11-16 19:24:18 -08:00
|
|
|
if ((p = strrchr(aux_argv[0],':')) == NULL) {
|
|
|
|
sdsfreesplitres(aux_argv, aux_argc);
|
2020-01-07 10:28:36 +08:00
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2011-04-07 17:46:28 +02:00
|
|
|
*p = '\0';
|
2022-11-16 19:24:18 -08:00
|
|
|
memcpy(n->ip,aux_argv[0],strlen(aux_argv[0])+1);
|
2016-02-02 08:20:04 +01:00
|
|
|
char *port = p+1;
|
|
|
|
char *busp = strchr(port,'@');
|
|
|
|
if (busp) {
|
|
|
|
*busp = '\0';
|
|
|
|
busp++;
|
|
|
|
}
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
/* If neither TCP or TLS port is found in aux field, it is considered
|
|
|
|
* an old version of nodes.conf file.*/
|
|
|
|
if (!aux_tcp_port && !aux_tls_port) {
|
|
|
|
if (server.tls_cluster) {
|
|
|
|
n->tls_port = atoi(port);
|
|
|
|
} else {
|
|
|
|
n->tcp_port = atoi(port);
|
|
|
|
}
|
|
|
|
} else if (!aux_tcp_port) {
|
|
|
|
n->tcp_port = atoi(port);
|
|
|
|
} else if (!aux_tls_port) {
|
|
|
|
n->tls_port = atoi(port);
|
|
|
|
}
|
2016-02-02 08:20:04 +01:00
|
|
|
/* In older versions of nodes.conf the "@busport" part is missing.
|
|
|
|
* In this case we set it to the default offset of 10000 from the
|
|
|
|
* base port. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
n->cport = busp ? atoi(busp) : (getNodeDefaultClientPort(n) + CLUSTER_PORT_INCR);
|
2011-04-07 17:46:28 +02:00
|
|
|
|
2021-03-30 22:11:32 +02:00
|
|
|
/* The plaintext port for client in a TLS cluster (n->pport) is not
|
|
|
|
* stored in nodes.conf. It is received later over the bus protocol. */
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
sdsfreesplitres(aux_argv, aux_argc);
|
|
|
|
|
2011-04-07 17:46:28 +02:00
|
|
|
/* Parse flags */
|
|
|
|
p = s = argv[2];
|
|
|
|
while(p) {
|
|
|
|
p = strchr(s,',');
|
|
|
|
if (p) *p = '\0';
|
|
|
|
if (!strcasecmp(s,"myself")) {
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(server.cluster->myself == NULL);
|
2014-01-29 11:22:22 +01:00
|
|
|
myself = server.cluster->myself = n;
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_MYSELF;
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"master")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_MASTER;
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"slave")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_SLAVE;
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"fail?")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_PFAIL;
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"fail")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_FAIL;
|
2013-10-09 16:18:33 +02:00
|
|
|
n->fail_time = mstime();
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"handshake")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_HANDSHAKE;
|
2011-04-07 17:46:28 +02:00
|
|
|
} else if (!strcasecmp(s,"noaddr")) {
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags |= CLUSTER_NODE_NOADDR;
|
2018-03-14 13:46:36 +01:00
|
|
|
} else if (!strcasecmp(s,"nofailover")) {
|
|
|
|
n->flags |= CLUSTER_NODE_NOFAILOVER;
|
2011-04-07 19:04:16 +02:00
|
|
|
} else if (!strcasecmp(s,"noflags")) {
|
|
|
|
/* nothing to do */
|
2011-04-07 17:46:28 +02:00
|
|
|
} else {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverPanic("Unknown flag in redis cluster config file");
|
2011-04-07 17:46:28 +02:00
|
|
|
}
|
|
|
|
if (p) s = p+1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get master if any. Set the master and populate master's
|
|
|
|
* slave list. */
|
|
|
|
if (argv[3][0] != '-') {
|
2022-04-05 13:51:51 +08:00
|
|
|
if (verifyClusterNodeId(argv[3], sdslen(argv[3])) == C_ERR) {
|
|
|
|
sdsfreesplitres(argv, argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
master = clusterLookupNode(argv[3], sdslen(argv[3]));
|
2011-04-07 17:46:28 +02:00
|
|
|
if (!master) {
|
|
|
|
master = createClusterNode(argv[3],0);
|
|
|
|
clusterAddNode(master);
|
|
|
|
}
|
2022-11-16 19:24:18 -08:00
|
|
|
/* shard_id can be absent if we are loading a nodes.conf generated
|
|
|
|
* by an older version of Redis; we should follow the primary's
|
|
|
|
* shard_id in this case */
|
2023-02-14 16:47:55 -05:00
|
|
|
if (auxFieldHandlers[af_shard_id].isPresent(n) == 0) {
|
2022-11-16 19:24:18 -08:00
|
|
|
memcpy(n->shard_id, master->shard_id, CLUSTER_NAMELEN);
|
|
|
|
clusterAddNodeToShard(master->shard_id, n);
|
|
|
|
} else if (clusterGetNodesInMyShard(master) != NULL &&
|
|
|
|
memcmp(master->shard_id, n->shard_id, CLUSTER_NAMELEN) != 0)
|
|
|
|
{
|
|
|
|
/* If the primary has been added to a shard, make sure this
|
|
|
|
* node has the same persisted shard id as the primary. */
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2011-04-07 17:46:28 +02:00
|
|
|
n->slaveof = master;
|
|
|
|
clusterNodeAddSlave(master,n);
|
2023-02-14 16:47:55 -05:00
|
|
|
} else if (auxFieldHandlers[af_shard_id].isPresent(n) == 0) {
|
2022-11-16 19:24:18 -08:00
|
|
|
/* n is a primary but it does not have a persisted shard_id.
|
|
|
|
* This happens if we are loading a nodes.conf generated by
|
|
|
|
* an older version of Redis. We should manually update the
|
|
|
|
* shard membership in this case */
|
|
|
|
clusterAddNodeToShard(n->shard_id, n);
|
2011-04-07 17:46:28 +02:00
|
|
|
}
|
|
|
|
|
2011-04-07 23:06:01 +02:00
|
|
|
/* Set ping sent / pong received timestamps */
|
2013-10-09 16:18:33 +02:00
|
|
|
if (atoi(argv[4])) n->ping_sent = mstime();
|
|
|
|
if (atoi(argv[5])) n->pong_received = mstime();
|
2011-04-07 23:06:01 +02:00
|
|
|
|
2022-06-21 07:40:48 +03:00
|
|
|
/* Set configEpoch for this node.
|
|
|
|
* If the node is a replica, set its config epoch to 0.
|
|
|
|
* If it's a primary, load the config epoch from the configuration file. */
|
|
|
|
n->configEpoch = (nodeIsSlave(n) && n->slaveof) ? 0 : strtoull(argv[6],NULL,10);
|
2013-09-25 11:47:13 +02:00
|
|
|
|
2011-04-07 17:46:28 +02:00
|
|
|
/* Populate hash slots served by this instance. */
|
2013-09-25 11:47:13 +02:00
|
|
|
for (j = 8; j < argc; j++) {
|
2011-04-07 17:46:28 +02:00
|
|
|
int start, stop;
|
|
|
|
|
2011-05-04 09:31:37 +02:00
|
|
|
if (argv[j][0] == '[') {
|
|
|
|
/* Here we handle migrating / importing slots */
|
|
|
|
int slot;
|
|
|
|
char direction;
|
|
|
|
clusterNode *cn;
|
|
|
|
|
|
|
|
p = strchr(argv[j],'-');
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(p != NULL);
|
2011-05-04 09:31:37 +02:00
|
|
|
*p = '\0';
|
|
|
|
direction = p[1]; /* Either '>' or '<' */
|
|
|
|
slot = atoi(argv[j]+1);
|
2020-01-07 10:28:36 +08:00
|
|
|
if (slot < 0 || slot >= CLUSTER_SLOTS) {
|
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2011-05-04 09:31:37 +02:00
|
|
|
p += 3;
|
2022-04-05 13:51:51 +08:00
|
|
|
|
|
|
|
char *pr = strchr(p, ']');
|
|
|
|
size_t node_len = pr - p;
|
|
|
|
if (pr == NULL || verifyClusterNodeId(p, node_len) == C_ERR) {
|
|
|
|
sdsfreesplitres(argv, argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
|
|
|
cn = clusterLookupNode(p, CLUSTER_NAMELEN);
|
2011-05-04 09:31:37 +02:00
|
|
|
if (!cn) {
|
|
|
|
cn = createClusterNode(p,0);
|
|
|
|
clusterAddNode(cn);
|
|
|
|
}
|
|
|
|
if (direction == '>') {
|
2013-02-14 13:20:56 +01:00
|
|
|
server.cluster->migrating_slots_to[slot] = cn;
|
2011-05-04 09:31:37 +02:00
|
|
|
} else {
|
2013-02-14 13:20:56 +01:00
|
|
|
server.cluster->importing_slots_from[slot] = cn;
|
2011-05-04 09:31:37 +02:00
|
|
|
}
|
|
|
|
continue;
|
|
|
|
} else if ((p = strchr(argv[j],'-')) != NULL) {
|
2011-04-07 17:46:28 +02:00
|
|
|
*p = '\0';
|
|
|
|
start = atoi(argv[j]);
|
|
|
|
stop = atoi(p+1);
|
|
|
|
} else {
|
|
|
|
start = stop = atoi(argv[j]);
|
|
|
|
}
|
2020-01-13 13:25:37 +01:00
|
|
|
if (start < 0 || start >= CLUSTER_SLOTS ||
|
|
|
|
stop < 0 || stop >= CLUSTER_SLOTS)
|
|
|
|
{
|
2020-01-07 10:28:36 +08:00
|
|
|
sdsfreesplitres(argv,argc);
|
|
|
|
goto fmterr;
|
|
|
|
}
|
2011-04-07 17:46:28 +02:00
|
|
|
while(start <= stop) clusterAddSlot(n, start++);
|
|
|
|
}
|
2011-04-07 12:55:02 +02:00
|
|
|
|
2013-03-06 12:36:07 +01:00
|
|
|
sdsfreesplitres(argv,argc);
|
2011-04-07 12:55:02 +02:00
|
|
|
}
|
2014-03-27 12:33:42 -04:00
|
|
|
/* Config sanity check */
|
|
|
|
if (server.cluster->myself == NULL) goto fmterr;
|
|
|
|
|
2011-04-07 12:55:02 +02:00
|
|
|
zfree(line);
|
2011-03-29 17:51:15 +02:00
|
|
|
fclose(fp);
|
|
|
|
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,"Node configuration loaded, I'm %.40s", myself->name);
|
2014-03-27 14:54:57 +01:00
|
|
|
|
|
|
|
/* Something that should never happen: currentEpoch smaller than
|
|
|
|
* the max epoch found in the nodes configuration. However we handle this
|
|
|
|
* as some form of protection against manual editing of critical files. */
|
|
|
|
if (clusterGetMaxEpoch() > server.cluster->currentEpoch) {
|
|
|
|
server.cluster->currentEpoch = clusterGetMaxEpoch();
|
|
|
|
}
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
fmterr:
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2022-11-16 19:24:18 -08:00
|
|
|
"Unrecoverable error: corrupted cluster config file \"%s\".", line);
|
2013-10-15 00:12:06 +09:00
|
|
|
zfree(line);
|
2014-03-27 12:33:42 -04:00
|
|
|
if (fp) fclose(fp);
|
2011-03-29 17:51:15 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2011-03-30 14:58:19 +02:00
|
|
|
/* Cluster node configuration is exactly the same as CLUSTER NODES output.
|
|
|
|
*
|
|
|
|
* This function writes the node config and returns 0, on error -1
|
2014-01-15 10:31:12 +01:00
|
|
|
* is returned.
|
|
|
|
*
|
|
|
|
* Note: we need to write the file in an atomic way from the point of view
|
|
|
|
* of the POSIX filesystem semantics, so that if the server is stopped
|
|
|
|
* or crashes during the write, we'll end with either the old file or the
|
|
|
|
* new one. Since we have the full payload to write available we can use
|
|
|
|
* a single write to write the whole file. If the pre-existing file was
|
|
|
|
* bigger we pad our payload with newlines that are anyway ignored and truncate
|
|
|
|
* the file afterward. */
|
2013-10-03 09:55:20 +02:00
|
|
|
int clusterSaveConfig(int do_fsync) {
|
2022-07-20 14:11:01 +08:00
|
|
|
sds ci,tmpfilename;
|
|
|
|
size_t content_size,offset = 0;
|
|
|
|
ssize_t written_bytes;
|
|
|
|
int fd = -1;
|
|
|
|
int retval = C_ERR;
|
2014-03-27 14:54:57 +01:00
|
|
|
|
2014-05-15 16:33:13 +02:00
|
|
|
server.cluster->todo_before_sleep &= ~CLUSTER_TODO_SAVE_CONFIG;
|
|
|
|
|
2014-03-27 14:54:57 +01:00
|
|
|
/* Get the nodes description and concatenate our "vars" directive to
|
2014-03-27 15:01:24 +01:00
|
|
|
* save currentEpoch and lastVoteEpoch. */
|
2023-05-23 08:32:37 -07:00
|
|
|
ci = clusterGenNodesDescription(NULL, CLUSTER_NODE_HANDSHAKE, 0);
|
2014-03-27 15:01:24 +01:00
|
|
|
ci = sdscatprintf(ci,"vars currentEpoch %llu lastVoteEpoch %llu\n",
|
2014-03-27 14:54:57 +01:00
|
|
|
(unsigned long long) server.cluster->currentEpoch,
|
2014-03-27 15:01:24 +01:00
|
|
|
(unsigned long long) server.cluster->lastVoteEpoch);
|
2014-03-27 14:54:57 +01:00
|
|
|
content_size = sdslen(ci);
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2022-07-20 14:11:01 +08:00
|
|
|
/* Create a temp file with the new content. */
|
|
|
|
tmpfilename = sdscatfmt(sdsempty(),"%s.tmp-%i-%I",
|
|
|
|
server.cluster_configfile,(int) getpid(),mstime());
|
|
|
|
if ((fd = open(tmpfilename,O_WRONLY|O_CREAT,0644)) == -1) {
|
|
|
|
serverLog(LL_WARNING,"Could not open temp cluster config file: %s",strerror(errno));
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2021-09-29 00:10:33 -04:00
|
|
|
|
2022-07-20 14:11:01 +08:00
|
|
|
while (offset < content_size) {
|
|
|
|
written_bytes = write(fd,ci + offset,content_size - offset);
|
|
|
|
if (written_bytes <= 0) {
|
|
|
|
if (errno == EINTR) continue;
|
|
|
|
serverLog(LL_WARNING,"Failed after writing (%zd) bytes to tmp cluster config file: %s",
|
|
|
|
offset,strerror(errno));
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
offset += written_bytes;
|
2014-01-15 10:31:12 +01:00
|
|
|
}
|
2022-07-20 14:11:01 +08:00
|
|
|
|
2014-05-15 16:33:13 +02:00
|
|
|
if (do_fsync) {
|
|
|
|
server.cluster->todo_before_sleep &= ~CLUSTER_TODO_FSYNC_CONFIG;
|
2022-07-20 14:11:01 +08:00
|
|
|
if (redis_fsync(fd) == -1) {
|
|
|
|
serverLog(LL_WARNING,"Could not sync tmp cluster config file: %s",strerror(errno));
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2014-05-15 16:33:13 +02:00
|
|
|
}
|
2014-01-15 10:31:12 +01:00
|
|
|
|
2022-07-20 14:11:01 +08:00
|
|
|
if (rename(tmpfilename, server.cluster_configfile) == -1) {
|
|
|
|
serverLog(LL_WARNING,"Could not rename tmp cluster config file: %s",strerror(errno));
|
|
|
|
goto cleanup;
|
2014-01-15 10:31:12 +01:00
|
|
|
}
|
2011-03-30 14:58:19 +02:00
|
|
|
|
2022-07-20 14:11:01 +08:00
|
|
|
if (do_fsync) {
|
|
|
|
if (fsyncFileDir(server.cluster_configfile) == -1) {
|
|
|
|
serverLog(LL_WARNING,"Could not sync cluster config file dir: %s",strerror(errno));
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
retval = C_OK; /* If we reached this point, everything is fine. */
|
|
|
|
|
|
|
|
cleanup:
|
2014-01-15 10:31:12 +01:00
|
|
|
if (fd != -1) close(fd);
|
2022-07-20 14:11:01 +08:00
|
|
|
if (retval) unlink(tmpfilename);
|
|
|
|
sdsfree(tmpfilename);
|
2011-03-30 14:58:19 +02:00
|
|
|
sdsfree(ci);
|
2022-07-20 14:11:01 +08:00
|
|
|
return retval;
|
2011-03-30 14:58:19 +02:00
|
|
|
}
|
|
|
|
|
2013-10-03 09:55:20 +02:00
|
|
|
void clusterSaveConfigOrDie(int do_fsync) {
|
|
|
|
if (clusterSaveConfig(do_fsync) == -1) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,"Fatal: can't update cluster config file.");
|
2011-03-30 17:41:13 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-03 23:38:19 -07:00
|
|
|
/* Lock the cluster config using flock(), and retain the file descriptor used to
|
|
|
|
* acquire the lock so that the file will be locked as long as the process is up.
|
2014-04-24 16:04:08 +02:00
|
|
|
*
|
|
|
|
* This works because we always update nodes.conf with a new version
|
|
|
|
* in-place, reopening the file, and writing to it in place (later adjusting
|
|
|
|
* the length with ftruncate()).
|
|
|
|
*
|
2015-07-26 23:17:55 +02:00
|
|
|
* On success C_OK is returned, otherwise an error is logged and
|
|
|
|
* the function returns C_ERR to signal a lock was not acquired. */
|
2014-04-24 16:04:08 +02:00
|
|
|
int clusterLockConfig(char *filename) {
|
2015-06-24 12:55:00 +02:00
|
|
|
/* flock() does not exist on Solaris
|
|
|
|
* and a fcntl-based solution won't help, as we constantly re-open that file,
|
|
|
|
* which will release _all_ locks anyway
|
|
|
|
*/
|
|
|
|
#if !defined(__sun)
|
2014-04-24 16:04:08 +02:00
|
|
|
/* To lock it, we need to open the file in a way it is created if
|
|
|
|
* it does not exist, otherwise there is a race condition with other
|
|
|
|
* processes. */
|
2021-01-20 04:57:30 +08:00
|
|
|
int fd = open(filename,O_WRONLY|O_CREAT|O_CLOEXEC,0644);
|
2014-04-24 16:04:08 +02:00
|
|
|
if (fd == -1) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2014-04-24 16:04:08 +02:00
|
|
|
"Can't open %s in order to acquire a lock: %s",
|
|
|
|
filename, strerror(errno));
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2014-04-24 16:04:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (flock(fd,LOCK_EX|LOCK_NB) == -1) {
|
|
|
|
if (errno == EWOULDBLOCK) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2014-04-24 16:04:08 +02:00
|
|
|
"Sorry, the cluster configuration file %s is already used "
|
|
|
|
"by a different Redis Cluster node. Please make sure that "
|
|
|
|
"different nodes use different cluster configuration "
|
|
|
|
"files.", filename);
|
|
|
|
} else {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2014-04-24 16:04:08 +02:00
|
|
|
"Impossible to lock %s: %s", filename, strerror(errno));
|
|
|
|
}
|
|
|
|
close(fd);
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2014-04-24 16:04:08 +02:00
|
|
|
}
|
2022-07-03 23:38:19 -07:00
|
|
|
/* Lock acquired: leak the 'fd' by not closing it until shutdown time, so that
|
|
|
|
* we'll retain the lock to the file as long as the process exists.
|
2020-08-20 13:59:02 +08:00
|
|
|
*
|
|
|
|
* After fork, the child process will get the fd opened by the parent process,
|
|
|
|
* we need save `fd` to `cluster_config_file_lock_fd`, so that in redisFork(),
|
|
|
|
* it will be closed in the child process.
|
|
|
|
* If it is not closed, when the main process is killed -9, but the child process
|
|
|
|
* (redis-aof-rewrite) is still alive, the fd(lock) will still be held by the
|
|
|
|
* child process, and the main process will fail to get lock, means fail to start. */
|
|
|
|
server.cluster_config_file_lock_fd = fd;
|
2020-12-13 17:09:54 +02:00
|
|
|
#else
|
|
|
|
UNUSED(filename);
|
2015-06-24 12:55:00 +02:00
|
|
|
#endif /* __sun */
|
|
|
|
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2014-04-24 16:04:08 +02:00
|
|
|
}
|
|
|
|
|
2021-03-30 22:11:32 +02:00
|
|
|
/* Derives our ports to be announced in the cluster bus. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
void deriveAnnouncedPorts(int *announced_tcp_port, int *announced_tls_port,
|
2021-03-30 22:11:32 +02:00
|
|
|
int *announced_cport) {
|
|
|
|
/* Config overriding announced ports. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
*announced_tcp_port = server.cluster_announce_port ?
|
|
|
|
server.cluster_announce_port : server.port;
|
|
|
|
*announced_tls_port = server.cluster_announce_tls_port ?
|
|
|
|
server.cluster_announce_tls_port : server.tls_port;
|
|
|
|
/* Derive cluster bus port. */
|
2021-03-30 22:11:32 +02:00
|
|
|
if (server.cluster_announce_bus_port) {
|
|
|
|
*announced_cport = server.cluster_announce_bus_port;
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
} else if (server.cluster_port) {
|
|
|
|
*announced_cport = server.cluster_port;
|
|
|
|
} else {
|
|
|
|
*announced_cport = defaultClientPort() + CLUSTER_PORT_INCR;
|
2021-03-30 22:11:32 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-14 13:46:36 +01:00
|
|
|
/* Some flags (currently just the NOFAILOVER flag) may need to be updated
|
|
|
|
* in the "myself" node based on the current configuration of the node,
|
|
|
|
* that may change at runtime via CONFIG SET. This function changes the
|
|
|
|
* set of flags in myself->flags accordingly. */
|
|
|
|
void clusterUpdateMyselfFlags(void) {
|
2021-11-08 10:56:03 +08:00
|
|
|
if (!myself) return;
|
2018-03-14 13:46:36 +01:00
|
|
|
int oldflags = myself->flags;
|
|
|
|
int nofailover = server.cluster_slave_no_failover ?
|
|
|
|
CLUSTER_NODE_NOFAILOVER : 0;
|
|
|
|
myself->flags &= ~CLUSTER_NODE_NOFAILOVER;
|
|
|
|
myself->flags |= nofailover;
|
|
|
|
if (myself->flags != oldflags) {
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-08 10:56:03 +08:00
|
|
|
|
2022-11-26 10:01:01 +08:00
|
|
|
/* We want to take myself->port/cport/pport in sync with the
|
|
|
|
* cluster-announce-port/cluster-announce-bus-port/cluster-announce-tls-port option.
|
|
|
|
* The option can be set at runtime via CONFIG SET. */
|
|
|
|
void clusterUpdateMyselfAnnouncedPorts(void) {
|
|
|
|
if (!myself) return;
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
deriveAnnouncedPorts(&myself->tcp_port,&myself->tls_port,&myself->cport);
|
2022-11-26 10:01:01 +08:00
|
|
|
}
|
|
|
|
|
2021-11-08 10:56:03 +08:00
|
|
|
/* We want to take myself->ip in sync with the cluster-announce-ip option.
|
|
|
|
* The option can be set at runtime via CONFIG SET. */
|
|
|
|
void clusterUpdateMyselfIp(void) {
|
|
|
|
if (!myself) return;
|
|
|
|
static char *prev_ip = NULL;
|
|
|
|
char *curr_ip = server.cluster_announce_ip;
|
|
|
|
int changed = 0;
|
|
|
|
|
|
|
|
if (prev_ip == NULL && curr_ip != NULL) changed = 1;
|
|
|
|
else if (prev_ip != NULL && curr_ip == NULL) changed = 1;
|
|
|
|
else if (prev_ip && curr_ip && strcmp(prev_ip,curr_ip)) changed = 1;
|
|
|
|
|
|
|
|
if (changed) {
|
|
|
|
if (prev_ip) zfree(prev_ip);
|
|
|
|
prev_ip = curr_ip;
|
|
|
|
|
|
|
|
if (curr_ip) {
|
|
|
|
/* We always take a copy of the previous IP address, by
|
|
|
|
* duplicating the string. This way later we can check if
|
|
|
|
* the address really changed. */
|
|
|
|
prev_ip = zstrdup(prev_ip);
|
2022-07-18 10:56:26 +03:00
|
|
|
redis_strlcpy(myself->ip,server.cluster_announce_ip,NET_IP_STR_LEN);
|
2021-11-08 10:56:03 +08:00
|
|
|
} else {
|
|
|
|
myself->ip[0] = '\0'; /* Force autodetection. */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* Update the hostname for the specified node with the provided C string. */
|
|
|
|
static void updateAnnouncedHostname(clusterNode *node, char *new) {
|
|
|
|
/* Previous and new hostname are the same, no need to update. */
|
2022-02-16 13:35:49 -08:00
|
|
|
if (new && !strcmp(new, node->hostname)) {
|
2022-01-02 19:48:29 -08:00
|
|
|
return;
|
2022-11-16 19:24:18 -08:00
|
|
|
} else if (!new && (sdslen(node->hostname) == 0)) {
|
|
|
|
return;
|
2022-01-02 19:48:29 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (new) {
|
2022-02-16 13:35:49 -08:00
|
|
|
node->hostname = sdscpy(node->hostname, new);
|
|
|
|
} else if (sdslen(node->hostname) != 0) {
|
|
|
|
sdsclear(node->hostname);
|
2022-01-02 19:48:29 -08:00
|
|
|
}
|
2022-11-16 19:24:18 -08:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
}
|
|
|
|
|
2023-06-18 12:16:51 +08:00
|
|
|
static void updateAnnouncedHumanNodename(clusterNode *node, char *new) {
|
|
|
|
if (new && !strcmp(new, node->human_nodename)) {
|
|
|
|
return;
|
|
|
|
} else if (!new && (sdslen(node->human_nodename) == 0)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (new) {
|
|
|
|
node->human_nodename = sdscpy(node->human_nodename, new);
|
|
|
|
} else if (sdslen(node->human_nodename) != 0) {
|
|
|
|
sdsclear(node->human_nodename);
|
|
|
|
}
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
static void updateShardId(clusterNode *node, const char *shard_id) {
|
2023-09-03 05:14:48 +02:00
|
|
|
if (shard_id && memcmp(node->shard_id, shard_id, CLUSTER_NAMELEN) != 0) {
|
2022-11-16 19:24:18 -08:00
|
|
|
clusterRemoveNodeFromShard(node);
|
|
|
|
memcpy(node->shard_id, shard_id, CLUSTER_NAMELEN);
|
|
|
|
clusterAddNodeToShard(shard_id, node);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
}
|
2023-09-03 05:14:48 +02:00
|
|
|
if (shard_id && myself != node && myself->slaveof == node) {
|
2022-11-16 19:24:18 -08:00
|
|
|
if (memcmp(myself->shard_id, shard_id, CLUSTER_NAMELEN) != 0) {
|
|
|
|
/* shard-id can diverge right after a rolling upgrade
|
|
|
|
* from pre-7.2 releases */
|
|
|
|
clusterRemoveNodeFromShard(myself);
|
|
|
|
memcpy(myself->shard_id, shard_id, CLUSTER_NAMELEN);
|
|
|
|
clusterAddNodeToShard(shard_id, myself);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_FSYNC_CONFIG);
|
|
|
|
}
|
|
|
|
}
|
2022-01-02 19:48:29 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Update my hostname based on server configuration values */
|
|
|
|
void clusterUpdateMyselfHostname(void) {
|
|
|
|
if (!myself) return;
|
|
|
|
updateAnnouncedHostname(myself, server.cluster_announce_hostname);
|
|
|
|
}
|
|
|
|
|
2023-06-18 12:16:51 +08:00
|
|
|
void clusterUpdateMyselfHumanNodename(void) {
|
|
|
|
if (!myself) return;
|
|
|
|
updateAnnouncedHumanNodename(myself, server.cluster_announce_human_nodename);
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterInit(void) {
|
2013-08-22 14:05:07 +02:00
|
|
|
int saveconf = 0;
|
2011-03-30 16:51:28 +02:00
|
|
|
|
2023-10-30 12:38:43 +02:00
|
|
|
server.cluster = zmalloc(sizeof(struct clusterState));
|
2013-02-14 13:20:56 +01:00
|
|
|
server.cluster->myself = NULL;
|
2013-09-25 11:47:13 +02:00
|
|
|
server.cluster->currentEpoch = 0;
|
2015-07-27 14:55:45 +02:00
|
|
|
server.cluster->state = CLUSTER_FAIL;
|
2013-02-22 19:18:30 +01:00
|
|
|
server.cluster->size = 1;
|
2013-12-17 12:22:02 +01:00
|
|
|
server.cluster->todo_before_sleep = 0;
|
2021-08-05 08:25:58 +03:00
|
|
|
server.cluster->nodes = dictCreate(&clusterNodesDictType);
|
2022-11-16 19:24:18 -08:00
|
|
|
server.cluster->shards = dictCreate(&clusterSdsToListType);
|
2013-11-29 17:37:06 +01:00
|
|
|
server.cluster->nodes_black_list =
|
2021-08-05 08:25:58 +03:00
|
|
|
dictCreate(&clusterNodesBlackListDictType);
|
2013-03-13 13:10:49 +01:00
|
|
|
server.cluster->failover_auth_time = 0;
|
|
|
|
server.cluster->failover_auth_count = 0;
|
2014-01-29 16:51:11 +01:00
|
|
|
server.cluster->failover_auth_rank = 0;
|
2013-09-26 11:13:17 +02:00
|
|
|
server.cluster->failover_auth_epoch = 0;
|
2015-07-27 14:55:45 +02:00
|
|
|
server.cluster->cant_failover_reason = CLUSTER_CANT_FAILOVER_NONE;
|
2014-03-27 15:01:24 +01:00
|
|
|
server.cluster->lastVoteEpoch = 0;
|
2021-12-16 21:56:59 -08:00
|
|
|
|
|
|
|
/* Initialize stats */
|
2017-04-13 19:22:35 +02:00
|
|
|
for (int i = 0; i < CLUSTERMSG_TYPE_COUNT; i++) {
|
|
|
|
server.cluster->stats_bus_messages_sent[i] = 0;
|
|
|
|
server.cluster->stats_bus_messages_received[i] = 0;
|
|
|
|
}
|
2017-04-14 13:39:49 +02:00
|
|
|
server.cluster->stats_pfail_nodes = 0;
|
2021-12-16 21:56:59 -08:00
|
|
|
server.cluster->stat_cluster_links_buffer_limit_exceeded = 0;
|
|
|
|
|
2014-03-11 11:16:18 +01:00
|
|
|
memset(server.cluster->slots,0, sizeof(server.cluster->slots));
|
|
|
|
clusterCloseAllSlots();
|
2014-04-24 16:04:08 +02:00
|
|
|
|
2023-07-07 21:40:44 +08:00
|
|
|
memset(server.cluster->owner_not_claiming_slot, 0, sizeof(server.cluster->owner_not_claiming_slot));
|
|
|
|
|
2014-04-24 16:04:08 +02:00
|
|
|
/* Lock the cluster config file to make sure every node uses
|
|
|
|
* its own nodes.conf. */
|
2020-08-20 13:59:02 +08:00
|
|
|
server.cluster_config_file_lock_fd = -1;
|
2015-07-26 23:17:55 +02:00
|
|
|
if (clusterLockConfig(server.cluster_configfile) == C_ERR)
|
2014-04-24 16:04:08 +02:00
|
|
|
exit(1);
|
|
|
|
|
|
|
|
/* Load or create a new nodes configuration. */
|
2015-07-26 23:17:55 +02:00
|
|
|
if (clusterLoadConfig(server.cluster_configfile) == C_ERR) {
|
2011-03-29 17:51:15 +02:00
|
|
|
/* No configuration found. We will just use the random name provided
|
|
|
|
* by the createClusterNode() function. */
|
2014-01-29 11:22:22 +01:00
|
|
|
myself = server.cluster->myself =
|
2015-07-27 14:55:45 +02:00
|
|
|
createClusterNode(NULL,CLUSTER_NODE_MYSELF|CLUSTER_NODE_MASTER);
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,"No cluster configuration found, I'm %.40s",
|
2014-01-29 11:38:14 +01:00
|
|
|
myself->name);
|
|
|
|
clusterAddNode(myself);
|
2022-11-16 19:24:18 -08:00
|
|
|
clusterAddNodeToShard(myself->shard_id, myself);
|
2011-03-30 16:51:28 +02:00
|
|
|
saveconf = 1;
|
|
|
|
}
|
2013-10-03 09:55:20 +02:00
|
|
|
if (saveconf) clusterSaveConfigOrDie(1);
|
2013-08-22 14:05:07 +02:00
|
|
|
|
2014-02-19 17:30:07 -05:00
|
|
|
/* Port sanity check II
|
2014-03-10 10:41:27 +01:00
|
|
|
* The other handshake port check is triggered too late to stop
|
|
|
|
* us from trying to use a too-high cluster port number. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int port = defaultClientPort();
|
2021-10-19 01:28:27 -04:00
|
|
|
if (!server.cluster_port && port > (65535-CLUSTER_PORT_INCR)) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING, "Redis port number too high. "
|
2014-02-19 17:30:07 -05:00
|
|
|
"Cluster communication port is 10,000 port "
|
|
|
|
"numbers higher than your Redis port. "
|
2021-01-21 15:08:05 +09:00
|
|
|
"Your Redis port number must be 55535 or less.");
|
2014-03-10 10:41:27 +01:00
|
|
|
exit(1);
|
2014-02-19 17:30:07 -05:00
|
|
|
}
|
2021-06-22 12:50:17 +03:00
|
|
|
if (!server.bindaddr_count) {
|
|
|
|
serverLog(LL_WARNING, "No bind address is configured, but it is required for the Cluster bus.");
|
|
|
|
exit(1);
|
|
|
|
}
|
Introduce .listen into connection type
Introduce listen method into connection type, this allows no hard code
of listen logic. Originally, we initialize server during startup like
this:
if (server.port)
listenToPort(server.port,&server.ipfd);
if (server.tls_port)
listenToPort(server.port,&server.tlsfd);
if (server.unixsocket)
anetUnixServer(...server.unixsocket...);
...
if (createSocketAcceptHandler(&server.ipfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.tlsfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.sofd, acceptTcpHandler) != C_OK)
...
If a new connection type gets supported, we have to add more hard code
to setup listener.
Introduce .listen and refactor listener, and Unix socket supports this.
this allows to setup listener arguments and create listener in a loop.
What's more, '.listen' is defined in connection.h, so we should include
server.h to import 'struct socketFds', but server.h has already include
'connection.h'. To avoid including loop(also to make code reasonable),
define 'struct connListener' in connection.h instead of 'struct socketFds'
in server.h. This leads this commit to get more changes.
There are more fields in 'struct connListener', hence it's possible to
simplify changeBindAddr & applyTLSPort() & updatePort() into a single
logic: update the listener config from the server.xxx, and re-create
the listener.
Because of the new field 'priv' in struct connListener, we expect to pass
this to the accept handler(even it's not used currently), this may be used
in the future.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 12:18:28 +08:00
|
|
|
|
2022-10-12 13:09:51 +03:00
|
|
|
/* The slots -> channels map is a radix tree. Initialize it here. */
|
|
|
|
server.cluster->slots_to_channels = raxNew();
|
|
|
|
|
|
|
|
/* Set myself->port/cport/pport to my listening ports, we'll just need to
|
|
|
|
* discover the IP address via MEET messages. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
deriveAnnouncedPorts(&myself->tcp_port, &myself->tls_port, &myself->cport);
|
2022-10-12 13:09:51 +03:00
|
|
|
|
|
|
|
server.cluster->mf_end = 0;
|
|
|
|
server.cluster->mf_slave = NULL;
|
|
|
|
resetManualFailover();
|
|
|
|
clusterUpdateMyselfFlags();
|
|
|
|
clusterUpdateMyselfIp();
|
|
|
|
clusterUpdateMyselfHostname();
|
2023-06-18 12:16:51 +08:00
|
|
|
clusterUpdateMyselfHumanNodename();
|
2022-10-12 13:09:51 +03:00
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
void clusterInitLast(void) {
|
Introduce .listen into connection type
Introduce listen method into connection type, this allows no hard code
of listen logic. Originally, we initialize server during startup like
this:
if (server.port)
listenToPort(server.port,&server.ipfd);
if (server.tls_port)
listenToPort(server.port,&server.tlsfd);
if (server.unixsocket)
anetUnixServer(...server.unixsocket...);
...
if (createSocketAcceptHandler(&server.ipfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.tlsfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.sofd, acceptTcpHandler) != C_OK)
...
If a new connection type gets supported, we have to add more hard code
to setup listener.
Introduce .listen and refactor listener, and Unix socket supports this.
this allows to setup listener arguments and create listener in a loop.
What's more, '.listen' is defined in connection.h, so we should include
server.h to import 'struct socketFds', but server.h has already include
'connection.h'. To avoid including loop(also to make code reasonable),
define 'struct connListener' in connection.h instead of 'struct socketFds'
in server.h. This leads this commit to get more changes.
There are more fields in 'struct connListener', hence it's possible to
simplify changeBindAddr & applyTLSPort() & updatePort() into a single
logic: update the listener config from the server.xxx, and re-create
the listener.
Because of the new field 'priv' in struct connListener, we expect to pass
this to the accept handler(even it's not used currently), this may be used
in the future.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 12:18:28 +08:00
|
|
|
if (connectionIndexByType(connTypeOfCluster()->get_type(NULL)) < 0) {
|
|
|
|
serverLog(LL_WARNING, "Missing connection type %s, but it is required for the Cluster bus.", connTypeOfCluster()->get_type(NULL));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int port = defaultClientPort();
|
Introduce .listen into connection type
Introduce listen method into connection type, this allows no hard code
of listen logic. Originally, we initialize server during startup like
this:
if (server.port)
listenToPort(server.port,&server.ipfd);
if (server.tls_port)
listenToPort(server.port,&server.tlsfd);
if (server.unixsocket)
anetUnixServer(...server.unixsocket...);
...
if (createSocketAcceptHandler(&server.ipfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.tlsfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.sofd, acceptTcpHandler) != C_OK)
...
If a new connection type gets supported, we have to add more hard code
to setup listener.
Introduce .listen and refactor listener, and Unix socket supports this.
this allows to setup listener arguments and create listener in a loop.
What's more, '.listen' is defined in connection.h, so we should include
server.h to import 'struct socketFds', but server.h has already include
'connection.h'. To avoid including loop(also to make code reasonable),
define 'struct connListener' in connection.h instead of 'struct socketFds'
in server.h. This leads this commit to get more changes.
There are more fields in 'struct connListener', hence it's possible to
simplify changeBindAddr & applyTLSPort() & updatePort() into a single
logic: update the listener config from the server.xxx, and re-create
the listener.
Because of the new field 'priv' in struct connListener, we expect to pass
this to the accept handler(even it's not used currently), this may be used
in the future.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 12:18:28 +08:00
|
|
|
connListener *listener = &server.clistener;
|
|
|
|
listener->count = 0;
|
|
|
|
listener->bindaddr = server.bindaddr;
|
|
|
|
listener->bindaddr_count = server.bindaddr_count;
|
|
|
|
listener->port = server.cluster_port ? server.cluster_port : port + CLUSTER_PORT_INCR;
|
|
|
|
listener->ct = connTypeOfCluster();
|
|
|
|
if (connListen(listener) == C_ERR ) {
|
2021-10-20 15:40:28 +03:00
|
|
|
/* Note: the following log text is matched by the test suite. */
|
Introduce .listen into connection type
Introduce listen method into connection type, this allows no hard code
of listen logic. Originally, we initialize server during startup like
this:
if (server.port)
listenToPort(server.port,&server.ipfd);
if (server.tls_port)
listenToPort(server.port,&server.tlsfd);
if (server.unixsocket)
anetUnixServer(...server.unixsocket...);
...
if (createSocketAcceptHandler(&server.ipfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.tlsfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.sofd, acceptTcpHandler) != C_OK)
...
If a new connection type gets supported, we have to add more hard code
to setup listener.
Introduce .listen and refactor listener, and Unix socket supports this.
this allows to setup listener arguments and create listener in a loop.
What's more, '.listen' is defined in connection.h, so we should include
server.h to import 'struct socketFds', but server.h has already include
'connection.h'. To avoid including loop(also to make code reasonable),
define 'struct connListener' in connection.h instead of 'struct socketFds'
in server.h. This leads this commit to get more changes.
There are more fields in 'struct connListener', hence it's possible to
simplify changeBindAddr & applyTLSPort() & updatePort() into a single
logic: update the listener config from the server.xxx, and re-create
the listener.
Because of the new field 'priv' in struct connListener, we expect to pass
this to the accept handler(even it's not used currently), this may be used
in the future.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 12:18:28 +08:00
|
|
|
serverLog(LL_WARNING, "Failed listening on port %u (cluster), aborting.", listener->port);
|
2013-08-22 14:05:07 +02:00
|
|
|
exit(1);
|
2021-03-01 16:04:44 +02:00
|
|
|
}
|
2021-10-19 01:28:27 -04:00
|
|
|
|
Introduce .listen into connection type
Introduce listen method into connection type, this allows no hard code
of listen logic. Originally, we initialize server during startup like
this:
if (server.port)
listenToPort(server.port,&server.ipfd);
if (server.tls_port)
listenToPort(server.port,&server.tlsfd);
if (server.unixsocket)
anetUnixServer(...server.unixsocket...);
...
if (createSocketAcceptHandler(&server.ipfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.tlsfd, acceptTcpHandler) != C_OK)
if (createSocketAcceptHandler(&server.sofd, acceptTcpHandler) != C_OK)
...
If a new connection type gets supported, we have to add more hard code
to setup listener.
Introduce .listen and refactor listener, and Unix socket supports this.
this allows to setup listener arguments and create listener in a loop.
What's more, '.listen' is defined in connection.h, so we should include
server.h to import 'struct socketFds', but server.h has already include
'connection.h'. To avoid including loop(also to make code reasonable),
define 'struct connListener' in connection.h instead of 'struct socketFds'
in server.h. This leads this commit to get more changes.
There are more fields in 'struct connListener', hence it's possible to
simplify changeBindAddr & applyTLSPort() & updatePort() into a single
logic: update the listener config from the server.xxx, and re-create
the listener.
Because of the new field 'priv' in struct connListener, we expect to pass
this to the accept handler(even it's not used currently), this may be used
in the future.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 12:18:28 +08:00
|
|
|
if (createSocketAcceptHandler(&server.clistener, clusterAcceptHandler) != C_OK) {
|
2021-03-01 16:04:44 +02:00
|
|
|
serverPanic("Unrecoverable error creating Redis Cluster socket accept handler.");
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-15 11:43:06 +02:00
|
|
|
/* Reset a node performing a soft or hard reset:
|
|
|
|
*
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* 1) All other nodes are forgotten.
|
2014-05-15 11:43:06 +02:00
|
|
|
* 2) All the assigned / open slots are released.
|
|
|
|
* 3) If the node is a slave, it turns into a master.
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* 4) Only for hard reset: a new Node ID is generated.
|
|
|
|
* 5) Only for hard reset: currentEpoch and configEpoch are set to 0.
|
|
|
|
* 6) The new configuration is saved and the cluster state updated.
|
|
|
|
* 7) If the node was a slave, the whole data set is flushed away. */
|
2014-05-15 11:43:06 +02:00
|
|
|
void clusterReset(int hard) {
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
int j;
|
|
|
|
|
|
|
|
/* Turn into master. */
|
|
|
|
if (nodeIsSlave(myself)) {
|
|
|
|
clusterSetNodeAsMaster(myself);
|
|
|
|
replicationUnsetMaster();
|
Change FUNCTION CREATE, DELETE and FLUSH to be WRITE commands instead of MAY_REPLICATE. (#9953)
The issue with MAY_REPLICATE is that all automatic mechanisms to handle
write commands will not work. This require have a special treatment for:
* Not allow those commands to be executed on RO replica.
* Allow those commands to be executed on RO replica from primary connection.
* Allow those commands to be executed on the RO replica from AOF.
By setting those commands as WRITE commands we are getting all those properties from Redis.
Test was added to verify that those properties work as expected.
In addition, rearrange when and where functions are flushed. Before this PR functions were
flushed manually on `rdbLoadRio` and cleaned manually on failure. This contradicts the
assumptions that functions are data and need to be created/deleted alongside with the
data. A side effect of this, for example, `debug reload noflush` did not flush the data but
did flush the functions, `debug loadaof` flush the data but not the functions.
This PR move functions deletion into `emptyDb`. `emptyDb` (renamed to `emptyData`) will
now accept an additional flag, `NOFUNCTIONS` which specifically indicate that we do not
want to flush the functions (on all other cases, functions will be flushed). Used the new flag
on FLUSHALL and FLUSHDB only! Tests were added to `debug reload` and `debug loadaof`
to verify that functions behave the same as the data.
Notice that because now functions will be deleted along side with the data we can not allow
`CLUSTER RESET` to be called from within a function (it will cause the function to be released
while running), this PR adds `NO_SCRIPT` flag to `CLUSTER RESET` so it will not be possible
to be called from within a function. The other cluster commands are allowed from within a
function (there are use-cases that uses `GETKEYSINSLOT` to iterate over all the keys on a
given slot). Tests was added to verify `CLUSTER RESET` is denied from within a script.
Another small change on this PR is that `RDBFLAGS_ALLOW_DUP` is also applicable on functions.
When loading functions, if this flag is set, we will replace old functions with new ones on collisions.
2021-12-21 16:13:29 +02:00
|
|
|
emptyData(-1,EMPTYDB_NO_FLAGS,NULL);
|
2014-05-15 11:43:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Close slots, reset manual failover state. */
|
|
|
|
clusterCloseAllSlots();
|
|
|
|
resetManualFailover();
|
|
|
|
|
|
|
|
/* Unassign all the slots. */
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) clusterDelSlot(j);
|
2014-05-15 11:43:06 +02:00
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Recreate shards dict */
|
|
|
|
dictEmpty(server.cluster->shards, NULL);
|
|
|
|
|
2014-05-15 11:43:06 +02:00
|
|
|
/* Forget all the nodes, but myself. */
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
|
|
|
if (node == myself) continue;
|
|
|
|
clusterDelNode(node);
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
|
2023-10-31 15:20:06 +01:00
|
|
|
/* Empty the nodes blacklist. */
|
|
|
|
dictEmpty(server.cluster->nodes_black_list, NULL);
|
|
|
|
|
2014-05-15 11:43:06 +02:00
|
|
|
/* Hard reset only: set epochs to 0, change node ID. */
|
|
|
|
if (hard) {
|
|
|
|
sds oldname;
|
|
|
|
|
|
|
|
server.cluster->currentEpoch = 0;
|
|
|
|
server.cluster->lastVoteEpoch = 0;
|
|
|
|
myself->configEpoch = 0;
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE, "configEpoch set to 0 via CLUSTER RESET HARD");
|
2014-05-15 11:43:06 +02:00
|
|
|
|
|
|
|
/* To change the Node ID we need to remove the old name from the
|
|
|
|
* nodes table, change the ID, and re-add back with new name. */
|
2015-07-27 14:55:45 +02:00
|
|
|
oldname = sdsnewlen(myself->name, CLUSTER_NAMELEN);
|
2014-05-15 11:43:06 +02:00
|
|
|
dictDelete(server.cluster->nodes,oldname);
|
|
|
|
sdsfree(oldname);
|
2015-07-27 14:55:45 +02:00
|
|
|
getRandomHexChars(myself->name, CLUSTER_NAMELEN);
|
2022-11-16 19:24:18 -08:00
|
|
|
getRandomHexChars(myself->shard_id, CLUSTER_NAMELEN);
|
2014-05-15 11:43:06 +02:00
|
|
|
clusterAddNode(myself);
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
serverLog(LL_NOTICE,"Node hard reset, now I'm %.40s", myself->name);
|
2014-05-15 11:43:06 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Re-populate shards */
|
|
|
|
clusterAddNodeToShard(myself->shard_id, myself);
|
|
|
|
|
2014-05-15 11:43:06 +02:00
|
|
|
/* Make sure to persist the new config and update the state. */
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER communication link
|
|
|
|
* -------------------------------------------------------------------------- */
|
2022-11-01 22:26:44 -04:00
|
|
|
static clusterMsgSendBlock *createClusterMsgSendBlock(int type, uint32_t msglen) {
|
|
|
|
uint32_t blocklen = msglen + sizeof(clusterMsgSendBlock) - sizeof(clusterMsg);
|
|
|
|
clusterMsgSendBlock *msgblock = zcalloc(blocklen);
|
|
|
|
msgblock->refcount = 1;
|
|
|
|
msgblock->totlen = blocklen;
|
|
|
|
server.stat_cluster_links_memory += blocklen;
|
|
|
|
clusterBuildMessageHdr(&msgblock->msg,type,msglen);
|
|
|
|
return msgblock;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void clusterMsgSendBlockDecrRefCount(void *node) {
|
|
|
|
clusterMsgSendBlock *msgblock = (clusterMsgSendBlock*)node;
|
|
|
|
msgblock->refcount--;
|
|
|
|
serverAssert(msgblock->refcount >= 0);
|
|
|
|
if (msgblock->refcount == 0) {
|
|
|
|
server.stat_cluster_links_memory -= msgblock->totlen;
|
|
|
|
zfree(msgblock);
|
|
|
|
}
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
clusterLink *createClusterLink(clusterNode *node) {
|
|
|
|
clusterLink *link = zmalloc(sizeof(*link));
|
2013-10-09 16:18:33 +02:00
|
|
|
link->ctime = mstime();
|
2022-11-01 22:26:44 -04:00
|
|
|
link->send_msg_queue = listCreate();
|
|
|
|
listSetFreeMethod(link->send_msg_queue, clusterMsgSendBlockDecrRefCount);
|
|
|
|
link->head_msg_send_offset = 0;
|
|
|
|
link->send_msg_queue_mem = sizeof(list);
|
2020-10-27 16:36:00 +02:00
|
|
|
link->rcvbuf = zmalloc(link->rcvbuf_alloc = RCVBUF_INIT_LEN);
|
|
|
|
link->rcvbuf_len = 0;
|
2022-11-01 22:26:44 -04:00
|
|
|
server.stat_cluster_links_memory += link->rcvbuf_alloc + link->send_msg_queue_mem;
|
2019-09-12 10:56:54 +03:00
|
|
|
link->conn = NULL;
|
2021-12-16 21:56:59 -08:00
|
|
|
link->node = node;
|
|
|
|
/* Related node can only possibly be known at link creation time if this is an outbound link */
|
|
|
|
link->inbound = (node == NULL);
|
|
|
|
if (!link->inbound) {
|
|
|
|
node->link = link;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
return link;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free a cluster link, but does not free the associated node of course.
|
2013-04-11 17:02:39 +02:00
|
|
|
* This function will just make sure that the original node associated
|
2011-03-29 17:51:15 +02:00
|
|
|
* with this link will have the 'link' field set to NULL. */
|
|
|
|
void freeClusterLink(clusterLink *link) {
|
2019-09-12 10:56:54 +03:00
|
|
|
if (link->conn) {
|
|
|
|
connClose(link->conn);
|
|
|
|
link->conn = NULL;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
server.stat_cluster_links_memory -= sizeof(list) + listLength(link->send_msg_queue)*sizeof(listNode);
|
|
|
|
listRelease(link->send_msg_queue);
|
|
|
|
server.stat_cluster_links_memory -= link->rcvbuf_alloc;
|
2020-10-27 16:36:00 +02:00
|
|
|
zfree(link->rcvbuf);
|
2021-12-16 21:56:59 -08:00
|
|
|
if (link->node) {
|
|
|
|
if (link->node->link == link) {
|
|
|
|
serverAssert(!link->inbound);
|
|
|
|
link->node->link = NULL;
|
|
|
|
} else if (link->node->inbound_link == link) {
|
|
|
|
serverAssert(link->inbound);
|
|
|
|
link->node->inbound_link = NULL;
|
|
|
|
}
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
zfree(link);
|
|
|
|
}
|
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
void setClusterNodeToInboundClusterLink(clusterNode *node, clusterLink *link) {
|
|
|
|
serverAssert(!link->node);
|
|
|
|
serverAssert(link->inbound);
|
|
|
|
if (node->inbound_link) {
|
|
|
|
/* A peer may disconnect and then reconnect with us, and it's not guaranteed that
|
|
|
|
* we would always process the disconnection of the existing inbound link before
|
|
|
|
* accepting a new existing inbound link. Therefore, it's possible to have more than
|
2022-09-13 16:19:29 -05:00
|
|
|
* one inbound link from the same node at the same time. Our cleanup logic assumes
|
|
|
|
* a one to one relationship between nodes and inbound links, so we need to kill
|
|
|
|
* one of the links. The existing link is more likely the outdated one, but it's
|
2022-10-02 18:56:45 +08:00
|
|
|
* possible the other node may need to open another link. */
|
2022-03-03 14:41:31 +08:00
|
|
|
serverLog(LL_DEBUG, "Replacing inbound link fd %d from node %.40s with fd %d",
|
2021-12-16 21:56:59 -08:00
|
|
|
node->inbound_link->conn->fd, node->name, link->conn->fd);
|
2022-09-13 16:19:29 -05:00
|
|
|
freeClusterLink(node->inbound_link);
|
2021-12-16 21:56:59 -08:00
|
|
|
}
|
2022-09-13 16:19:29 -05:00
|
|
|
serverAssert(!node->inbound_link);
|
2021-12-16 21:56:59 -08:00
|
|
|
node->inbound_link = link;
|
|
|
|
link->node = node;
|
|
|
|
}
|
|
|
|
|
2019-09-12 10:56:54 +03:00
|
|
|
static void clusterConnAcceptHandler(connection *conn) {
|
|
|
|
clusterLink *link;
|
|
|
|
|
|
|
|
if (connGetState(conn) != CONN_STATE_CONNECTED) {
|
|
|
|
serverLog(LL_VERBOSE,
|
|
|
|
"Error accepting cluster node connection: %s", connGetLastError(conn));
|
|
|
|
connClose(conn);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Create a link object we use to handle the connection.
|
|
|
|
* It gets passed to the readable handler when data is available.
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* Initially the link->node pointer is set to NULL as we don't know
|
2019-09-12 10:56:54 +03:00
|
|
|
* which node is, but the right node is references once we know the
|
|
|
|
* node identity. */
|
|
|
|
link = createClusterLink(NULL);
|
|
|
|
link->conn = conn;
|
|
|
|
connSetPrivateData(conn, link);
|
|
|
|
|
|
|
|
/* Register read handler */
|
|
|
|
connSetReadHandler(conn, clusterReadHandler);
|
|
|
|
}
|
|
|
|
|
2014-05-09 11:51:36 +02:00
|
|
|
#define MAX_CLUSTER_ACCEPTS_PER_CALL 1000
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterAcceptHandler(aeEventLoop *el, int fd, void *privdata, int mask) {
|
|
|
|
int cport, cfd;
|
2014-05-09 11:51:36 +02:00
|
|
|
int max = MAX_CLUSTER_ACCEPTS_PER_CALL;
|
2015-07-27 09:41:48 +02:00
|
|
|
char cip[NET_IP_STR_LEN];
|
2022-07-27 10:46:31 +08:00
|
|
|
int require_auth = TLS_CLIENT_AUTH_YES;
|
2015-07-27 09:41:48 +02:00
|
|
|
UNUSED(el);
|
|
|
|
UNUSED(mask);
|
|
|
|
UNUSED(privdata);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2014-05-14 12:04:42 +02:00
|
|
|
/* If the server is starting up, don't accept cluster connections:
|
|
|
|
* UPDATE messages may interact with the database content. */
|
|
|
|
if (server.masterhost == NULL && server.loading) return;
|
|
|
|
|
2014-05-09 11:51:36 +02:00
|
|
|
while(max--) {
|
|
|
|
cfd = anetTcpAccept(server.neterr, fd, cip, sizeof(cip), &cport);
|
|
|
|
if (cfd == ANET_ERR) {
|
|
|
|
if (errno != EWOULDBLOCK)
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2014-03-06 12:27:13 -05:00
|
|
|
"Error accepting cluster node: %s", server.neterr);
|
2014-05-09 11:51:36 +02:00
|
|
|
return;
|
|
|
|
}
|
2019-09-12 10:56:54 +03:00
|
|
|
|
2022-07-27 10:46:31 +08:00
|
|
|
connection *conn = connCreateAccepted(connTypeOfCluster(), cfd, &require_auth);
|
2020-07-28 11:32:47 +03:00
|
|
|
|
|
|
|
/* Make sure connection is not in an error state */
|
|
|
|
if (connGetState(conn) != CONN_STATE_ACCEPTING) {
|
|
|
|
serverLog(LL_VERBOSE,
|
|
|
|
"Error creating an accepting connection for cluster node: %s",
|
|
|
|
connGetLastError(conn));
|
|
|
|
connClose(conn);
|
|
|
|
return;
|
|
|
|
}
|
2019-09-12 10:56:54 +03:00
|
|
|
connEnableTcpNoDelay(conn);
|
2023-02-16 11:21:17 +08:00
|
|
|
connKeepAlive(conn,server.cluster_node_timeout / 1000 * 2);
|
2014-05-09 11:51:36 +02:00
|
|
|
|
|
|
|
/* Use non-blocking I/O for cluster messages. */
|
2019-09-12 10:56:54 +03:00
|
|
|
serverLog(LL_VERBOSE,"Accepting cluster node connection from %s:%d", cip, cport);
|
|
|
|
|
|
|
|
/* Accept the connection now. connAccept() may call our handler directly
|
|
|
|
* or schedule it for later depending on connection implementation.
|
|
|
|
*/
|
|
|
|
if (connAccept(conn, clusterConnAcceptHandler) == C_ERR) {
|
2020-03-22 14:46:16 +02:00
|
|
|
if (connGetState(conn) == CONN_STATE_ERROR)
|
|
|
|
serverLog(LL_VERBOSE,
|
|
|
|
"Error accepting cluster node connection: %s",
|
|
|
|
connGetLastError(conn));
|
2019-09-12 10:56:54 +03:00
|
|
|
connClose(conn);
|
|
|
|
return;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-16 11:45:03 +02:00
|
|
|
/* Return the approximated number of sockets we are using in order to
|
|
|
|
* take the cluster bus connections. */
|
|
|
|
unsigned long getClusterConnectionsCount(void) {
|
2020-06-22 11:21:21 +02:00
|
|
|
/* We decrement the number of nodes by one, since there is the
|
|
|
|
* "myself" node too in the list. Each node uses two file descriptors,
|
|
|
|
* one incoming and one outgoing, thus the multiplication by 2. */
|
2020-06-16 11:45:03 +02:00
|
|
|
return server.cluster_enabled ?
|
2020-06-22 11:21:21 +02:00
|
|
|
((dictSize(server.cluster->nodes)-1)*2) : 0;
|
2020-06-16 11:45:03 +02:00
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER node API
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
/* Create a new cluster node, with the specified flags.
|
|
|
|
* If "nodename" is NULL this is considered a first handshake and a random
|
|
|
|
* node name is assigned to this node (it will be fixed later when we'll
|
|
|
|
* receive the first pong).
|
|
|
|
*
|
|
|
|
* The node is created and returned to the user, but it is not automatically
|
|
|
|
* added to the nodes hash table. */
|
|
|
|
clusterNode *createClusterNode(char *nodename, int flags) {
|
|
|
|
clusterNode *node = zmalloc(sizeof(*node));
|
|
|
|
|
|
|
|
if (nodename)
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(node->name, nodename, CLUSTER_NAMELEN);
|
2011-03-29 17:51:15 +02:00
|
|
|
else
|
2015-07-27 14:55:45 +02:00
|
|
|
getRandomHexChars(node->name, CLUSTER_NAMELEN);
|
2022-11-16 19:24:18 -08:00
|
|
|
getRandomHexChars(node->shard_id, CLUSTER_NAMELEN);
|
2013-10-09 16:18:33 +02:00
|
|
|
node->ctime = mstime();
|
2013-09-25 11:47:13 +02:00
|
|
|
node->configEpoch = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
node->flags = flags;
|
|
|
|
memset(node->slots,0,sizeof(node->slots));
|
2022-03-16 02:24:40 +01:00
|
|
|
node->slot_info_pairs = NULL;
|
2022-03-29 10:05:06 +03:00
|
|
|
node->slot_info_pairs_count = 0;
|
2013-02-28 15:11:05 +01:00
|
|
|
node->numslots = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
node->numslaves = 0;
|
|
|
|
node->slaves = NULL;
|
|
|
|
node->slaveof = NULL;
|
2022-06-21 12:02:22 +08:00
|
|
|
node->last_in_ping_gossip = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
node->ping_sent = node->pong_received = 0;
|
2020-05-08 11:38:07 +02:00
|
|
|
node->data_received = 0;
|
2013-03-05 13:15:05 +01:00
|
|
|
node->fail_time = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
node->link = NULL;
|
2021-12-16 21:56:59 -08:00
|
|
|
node->inbound_link = NULL;
|
2013-02-15 12:58:35 +01:00
|
|
|
memset(node->ip,0,sizeof(node->ip));
|
2022-02-16 13:35:49 -08:00
|
|
|
node->hostname = sdsempty();
|
2023-06-18 12:16:51 +08:00
|
|
|
node->human_nodename = sdsempty();
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tcp_port = 0;
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport = 0;
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tls_port = 0;
|
2013-02-22 17:43:35 +01:00
|
|
|
node->fail_reports = listCreate();
|
2013-09-26 13:00:41 +02:00
|
|
|
node->voted_time = 0;
|
2015-12-11 09:19:06 +01:00
|
|
|
node->orphaned_time = 0;
|
2014-01-28 16:28:07 +01:00
|
|
|
node->repl_offset_time = 0;
|
|
|
|
node->repl_offset = 0;
|
2013-02-22 17:43:35 +01:00
|
|
|
listSetFreeMethod(node->fail_reports,zfree);
|
2011-03-29 17:51:15 +02:00
|
|
|
return node;
|
|
|
|
}
|
|
|
|
|
2013-02-22 17:43:35 +01:00
|
|
|
/* This function is called every time we get a failure report from a node.
|
|
|
|
* The side effect is to populate the fail_reports list (or to update
|
|
|
|
* the timestamp of an existing report).
|
|
|
|
*
|
|
|
|
* 'failing' is the node that is in failure state according to the
|
2013-02-26 14:58:39 +01:00
|
|
|
* 'sender' node.
|
|
|
|
*
|
|
|
|
* The function returns 0 if it just updates a timestamp of an existing
|
|
|
|
* failure report from the same sender. 1 is returned if a new failure
|
|
|
|
* report is created. */
|
|
|
|
int clusterNodeAddFailureReport(clusterNode *failing, clusterNode *sender) {
|
2013-02-22 17:43:35 +01:00
|
|
|
list *l = failing->fail_reports;
|
|
|
|
listNode *ln;
|
|
|
|
listIter li;
|
|
|
|
clusterNodeFailReport *fr;
|
|
|
|
|
|
|
|
/* If a failure report from the same sender already exists, just update
|
|
|
|
* the timestamp. */
|
|
|
|
listRewind(l,&li);
|
|
|
|
while ((ln = listNext(&li)) != NULL) {
|
|
|
|
fr = ln->value;
|
|
|
|
if (fr->node == sender) {
|
2013-10-09 16:18:33 +02:00
|
|
|
fr->time = mstime();
|
2013-02-26 14:58:39 +01:00
|
|
|
return 0;
|
2013-02-22 17:43:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Otherwise create a new report. */
|
|
|
|
fr = zmalloc(sizeof(*fr));
|
|
|
|
fr->node = sender;
|
2013-10-09 16:18:33 +02:00
|
|
|
fr->time = mstime();
|
2013-02-22 17:43:35 +01:00
|
|
|
listAddNodeTail(l,fr);
|
2013-02-26 14:58:39 +01:00
|
|
|
return 1;
|
2013-02-22 17:43:35 +01:00
|
|
|
}
|
|
|
|
|
2013-02-26 11:19:48 +01:00
|
|
|
/* Remove failure reports that are too old, where too old means reasonably
|
|
|
|
* older than the global node timeout. Note that anyway for a node to be
|
|
|
|
* flagged as FAIL we need to have a local PFAIL state that is at least
|
|
|
|
* older than the global node timeout, so we don't just trust the number
|
|
|
|
* of failure reports from other nodes. */
|
|
|
|
void clusterNodeCleanupFailureReports(clusterNode *node) {
|
|
|
|
list *l = node->fail_reports;
|
|
|
|
listNode *ln;
|
|
|
|
listIter li;
|
|
|
|
clusterNodeFailReport *fr;
|
2013-10-09 16:18:33 +02:00
|
|
|
mstime_t maxtime = server.cluster_node_timeout *
|
2015-07-27 14:55:45 +02:00
|
|
|
CLUSTER_FAIL_REPORT_VALIDITY_MULT;
|
2013-10-09 16:18:33 +02:00
|
|
|
mstime_t now = mstime();
|
2013-02-26 11:19:48 +01:00
|
|
|
|
|
|
|
listRewind(l,&li);
|
|
|
|
while ((ln = listNext(&li)) != NULL) {
|
|
|
|
fr = ln->value;
|
|
|
|
if (now - fr->time > maxtime) listDelNode(l,ln);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-25 19:13:22 +01:00
|
|
|
/* Remove the failing report for 'node' if it was previously considered
|
|
|
|
* failing by 'sender'. This function is called when a node informs us via
|
|
|
|
* gossip that a node is OK from its point of view (no FAIL or PFAIL flags).
|
|
|
|
*
|
|
|
|
* Note that this function is called relatively often as it gets called even
|
|
|
|
* when there are no nodes failing, and is O(N), however when the cluster is
|
|
|
|
* fine the failure reports list is empty so the function runs in constant
|
2013-02-26 14:58:39 +01:00
|
|
|
* time.
|
|
|
|
*
|
|
|
|
* The function returns 1 if the failure report was found and removed.
|
|
|
|
* Otherwise 0 is returned. */
|
|
|
|
int clusterNodeDelFailureReport(clusterNode *node, clusterNode *sender) {
|
2013-02-25 19:13:22 +01:00
|
|
|
list *l = node->fail_reports;
|
|
|
|
listNode *ln;
|
|
|
|
listIter li;
|
|
|
|
clusterNodeFailReport *fr;
|
|
|
|
|
|
|
|
/* Search for a failure report from this sender. */
|
|
|
|
listRewind(l,&li);
|
|
|
|
while ((ln = listNext(&li)) != NULL) {
|
|
|
|
fr = ln->value;
|
|
|
|
if (fr->node == sender) break;
|
|
|
|
}
|
2013-02-26 14:58:39 +01:00
|
|
|
if (!ln) return 0; /* No failure report from this sender. */
|
2013-02-25 19:13:22 +01:00
|
|
|
|
|
|
|
/* Remove the failure report. */
|
|
|
|
listDelNode(l,ln);
|
2013-02-26 11:08:03 +01:00
|
|
|
clusterNodeCleanupFailureReports(node);
|
2013-02-26 14:58:39 +01:00
|
|
|
return 1;
|
2013-02-25 19:13:22 +01:00
|
|
|
}
|
|
|
|
|
2013-02-22 17:43:35 +01:00
|
|
|
/* Return the number of external nodes that believe 'node' is failing,
|
|
|
|
* not including this node, that may have a PFAIL or FAIL state for this
|
|
|
|
* node as well. */
|
|
|
|
int clusterNodeFailureReportsCount(clusterNode *node) {
|
|
|
|
clusterNodeCleanupFailureReports(node);
|
|
|
|
return listLength(node->fail_reports);
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
int clusterNodeRemoveSlave(clusterNode *master, clusterNode *slave) {
|
|
|
|
int j;
|
|
|
|
|
|
|
|
for (j = 0; j < master->numslaves; j++) {
|
|
|
|
if (master->slaves[j] == slave) {
|
2015-01-14 11:10:25 -05:00
|
|
|
if ((j+1) < master->numslaves) {
|
|
|
|
int remaining_slaves = (master->numslaves - j) - 1;
|
|
|
|
memmove(master->slaves+j,master->slaves+(j+1),
|
|
|
|
(sizeof(*master->slaves) * remaining_slaves));
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
master->numslaves--;
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
if (master->numslaves == 0)
|
|
|
|
master->flags &= ~CLUSTER_NODE_MIGRATE_TO;
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int clusterNodeAddSlave(clusterNode *master, clusterNode *slave) {
|
|
|
|
int j;
|
|
|
|
|
|
|
|
/* If it's already a slave, don't add it again. */
|
|
|
|
for (j = 0; j < master->numslaves; j++)
|
2015-07-26 23:17:55 +02:00
|
|
|
if (master->slaves[j] == slave) return C_ERR;
|
2011-03-29 17:51:15 +02:00
|
|
|
master->slaves = zrealloc(master->slaves,
|
|
|
|
sizeof(clusterNode*)*(master->numslaves+1));
|
|
|
|
master->slaves[master->numslaves] = slave;
|
|
|
|
master->numslaves++;
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
master->flags |= CLUSTER_NODE_MIGRATE_TO;
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2014-01-30 18:05:11 +01:00
|
|
|
int clusterCountNonFailingSlaves(clusterNode *n) {
|
|
|
|
int j, okslaves = 0;
|
|
|
|
|
|
|
|
for (j = 0; j < n->numslaves; j++)
|
|
|
|
if (!nodeFailed(n->slaves[j])) okslaves++;
|
|
|
|
return okslaves;
|
|
|
|
}
|
|
|
|
|
2015-01-21 16:03:43 +01:00
|
|
|
/* Low level cleanup of the node structure. Only called by clusterDelNode(). */
|
2011-03-29 17:51:15 +02:00
|
|
|
void freeClusterNode(clusterNode *n) {
|
|
|
|
sds nodename;
|
2015-01-21 15:55:53 +01:00
|
|
|
int j;
|
|
|
|
|
2016-01-14 17:34:49 +01:00
|
|
|
/* If the node has associated slaves, we have to set
|
2015-01-21 15:55:53 +01:00
|
|
|
* all the slaves->slaveof fields to NULL (unknown). */
|
2016-01-14 17:34:49 +01:00
|
|
|
for (j = 0; j < n->numslaves; j++)
|
|
|
|
n->slaves[j]->slaveof = NULL;
|
2013-02-22 17:43:35 +01:00
|
|
|
|
2015-01-21 16:03:43 +01:00
|
|
|
/* Remove this node from the list of slaves of its master. */
|
|
|
|
if (nodeIsSlave(n) && n->slaveof) clusterNodeRemoveSlave(n->slaveof,n);
|
|
|
|
|
|
|
|
/* Unlink from the set of nodes. */
|
2015-07-27 14:55:45 +02:00
|
|
|
nodename = sdsnewlen(n->name, CLUSTER_NAMELEN);
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(dictDelete(server.cluster->nodes,nodename) == DICT_OK);
|
2011-03-29 17:51:15 +02:00
|
|
|
sdsfree(nodename);
|
2022-02-16 13:35:49 -08:00
|
|
|
sdsfree(n->hostname);
|
2023-06-18 12:16:51 +08:00
|
|
|
sdsfree(n->human_nodename);
|
2015-01-21 16:03:43 +01:00
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
/* Release links and associated data structures. */
|
2011-03-29 17:51:15 +02:00
|
|
|
if (n->link) freeClusterLink(n->link);
|
2021-12-16 21:56:59 -08:00
|
|
|
if (n->inbound_link) freeClusterLink(n->inbound_link);
|
2013-02-22 17:43:35 +01:00
|
|
|
listRelease(n->fail_reports);
|
2015-01-14 11:31:17 -05:00
|
|
|
zfree(n->slaves);
|
2011-03-29 17:51:15 +02:00
|
|
|
zfree(n);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add a node to the nodes hash table */
|
2021-01-10 02:24:58 +08:00
|
|
|
void clusterAddNode(clusterNode *node) {
|
2011-03-29 17:51:15 +02:00
|
|
|
int retval;
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2013-02-14 13:20:56 +01:00
|
|
|
retval = dictAdd(server.cluster->nodes,
|
2015-07-27 14:55:45 +02:00
|
|
|
sdsnewlen(node->name,CLUSTER_NAMELEN), node);
|
2021-01-10 02:24:58 +08:00
|
|
|
serverAssert(retval == DICT_OK);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2020-03-18 09:48:03 -04:00
|
|
|
/* Remove a node from the cluster. The function performs the high level
|
2015-01-21 16:03:43 +01:00
|
|
|
* cleanup, calling freeClusterNode() for the low level cleanup.
|
|
|
|
* Here we do the following:
|
|
|
|
*
|
|
|
|
* 1) Mark all the slots handled by it as unassigned.
|
|
|
|
* 2) Remove all the failure reports sent by this node and referenced by
|
|
|
|
* other nodes.
|
2022-11-16 19:24:18 -08:00
|
|
|
* 3) Remove the node from the owning shard
|
|
|
|
* 4) Free the node with freeClusterNode() that will in turn remove it
|
2015-01-21 16:03:43 +01:00
|
|
|
* from the hash table and from the list of slaves of its master, if
|
|
|
|
* it is a slave node.
|
2013-02-27 17:55:59 +01:00
|
|
|
*/
|
|
|
|
void clusterDelNode(clusterNode *delnode) {
|
|
|
|
int j;
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
/* 1) Mark slots as unassigned. */
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2013-02-27 17:55:59 +01:00
|
|
|
if (server.cluster->importing_slots_from[j] == delnode)
|
|
|
|
server.cluster->importing_slots_from[j] = NULL;
|
|
|
|
if (server.cluster->migrating_slots_to[j] == delnode)
|
|
|
|
server.cluster->migrating_slots_to[j] = NULL;
|
|
|
|
if (server.cluster->slots[j] == delnode)
|
|
|
|
clusterDelSlot(j);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 2) Remove failure reports. */
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2013-02-27 17:55:59 +01:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
|
|
|
if (node == delnode) continue;
|
|
|
|
clusterNodeDelFailureReport(node,delnode);
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* 3) Remove the node from the owning shard */
|
|
|
|
clusterRemoveNodeFromShard(delnode);
|
|
|
|
|
|
|
|
/* 4) Free the node, unlinking it from the cluster. */
|
2013-02-27 17:55:59 +01:00
|
|
|
freeClusterNode(delnode);
|
|
|
|
}
|
|
|
|
|
2022-04-05 13:51:51 +08:00
|
|
|
/* Node lookup by name */
|
|
|
|
clusterNode *clusterLookupNode(const char *name, int length) {
|
|
|
|
if (verifyClusterNodeId(name, length) != C_OK) return NULL;
|
|
|
|
sds s = sdsnewlen(name, length);
|
|
|
|
dictEntry *de = dictFind(server.cluster->nodes, s);
|
2011-03-29 17:51:15 +02:00
|
|
|
sdsfree(s);
|
|
|
|
if (de == NULL) return NULL;
|
2011-11-08 17:07:55 +01:00
|
|
|
return dictGetVal(de);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Get all the nodes in my shard.
|
|
|
|
* Note that the list returned is not computed on the fly
|
|
|
|
* via slaveof; rather, it is maintained permanently to
|
|
|
|
* track the shard membership and its life cycle is tied
|
|
|
|
* to this Redis process. Therefore, the caller must not
|
|
|
|
* release the list. */
|
|
|
|
list *clusterGetNodesInMyShard(clusterNode *node) {
|
|
|
|
sds s = sdsnewlen(node->shard_id, CLUSTER_NAMELEN);
|
|
|
|
dictEntry *de = dictFind(server.cluster->shards,s);
|
|
|
|
sdsfree(s);
|
|
|
|
return (de != NULL) ? dictGetVal(de) : NULL;
|
2022-01-03 01:54:47 +01:00
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* This is only used after the handshake. When we connect a given IP/PORT
|
|
|
|
* as a result of CLUSTER MEET we don't have the node name yet, so we
|
|
|
|
* pick a random one, and will fix it when we receive the PONG request using
|
|
|
|
* this function. */
|
|
|
|
void clusterRenameNode(clusterNode *node, char *newname) {
|
|
|
|
int retval;
|
2015-07-27 14:55:45 +02:00
|
|
|
sds s = sdsnewlen(node->name, CLUSTER_NAMELEN);
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_DEBUG,"Renaming node %.40s into %.40s",
|
2011-03-29 17:51:15 +02:00
|
|
|
node->name, newname);
|
2013-02-14 13:20:56 +01:00
|
|
|
retval = dictDelete(server.cluster->nodes, s);
|
2011-03-29 17:51:15 +02:00
|
|
|
sdsfree(s);
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(retval == DICT_OK);
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(node->name, newname, CLUSTER_NAMELEN);
|
2011-03-29 17:51:15 +02:00
|
|
|
clusterAddNode(node);
|
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
void clusterAddNodeToShard(const char *shard_id, clusterNode *node) {
|
|
|
|
sds s = sdsnewlen(shard_id, CLUSTER_NAMELEN);
|
|
|
|
dictEntry *de = dictFind(server.cluster->shards,s);
|
|
|
|
if (de == NULL) {
|
|
|
|
list *l = listCreate();
|
|
|
|
listAddNodeTail(l, node);
|
|
|
|
serverAssert(dictAdd(server.cluster->shards, s, l) == DICT_OK);
|
|
|
|
} else {
|
|
|
|
list *l = dictGetVal(de);
|
|
|
|
if (listSearchKey(l, node) == NULL) {
|
|
|
|
listAddNodeTail(l, node);
|
|
|
|
}
|
|
|
|
sdsfree(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void clusterRemoveNodeFromShard(clusterNode *node) {
|
|
|
|
sds s = sdsnewlen(node->shard_id, CLUSTER_NAMELEN);
|
|
|
|
dictEntry *de = dictFind(server.cluster->shards, s);
|
|
|
|
if (de != NULL) {
|
|
|
|
list *l = dictGetVal(de);
|
|
|
|
listNode *ln = listSearchKey(l, node);
|
|
|
|
if (ln != NULL) {
|
|
|
|
listDelNode(l, ln);
|
|
|
|
}
|
|
|
|
if (listLength(l) == 0) {
|
|
|
|
dictDelete(server.cluster->shards, s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sdsfree(s);
|
|
|
|
}
|
|
|
|
|
2015-03-20 16:42:49 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER config epoch handling
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2015-03-21 12:12:23 +01:00
|
|
|
/* Return the greatest configEpoch found in the cluster, or the current
|
|
|
|
* epoch if greater than any node configEpoch. */
|
2015-03-20 16:42:49 +01:00
|
|
|
uint64_t clusterGetMaxEpoch(void) {
|
|
|
|
uint64_t max = 0;
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
if (node->configEpoch > max) max = node->configEpoch;
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
if (max < server.cluster->currentEpoch) max = server.cluster->currentEpoch;
|
|
|
|
return max;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If this node epoch is zero or is not already the greatest across the
|
|
|
|
* cluster (from the POV of the local configuration), this function will:
|
|
|
|
*
|
2016-01-08 12:07:52 +01:00
|
|
|
* 1) Generate a new config epoch, incrementing the current epoch.
|
2015-03-20 16:42:49 +01:00
|
|
|
* 2) Assign the new epoch to this node, WITHOUT any consensus.
|
|
|
|
* 3) Persist the configuration on disk before sending packets with the
|
|
|
|
* new configuration.
|
|
|
|
*
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* If the new config epoch is generated and assigned, C_OK is returned,
|
2015-07-26 23:17:55 +02:00
|
|
|
* otherwise C_ERR is returned (since the node has already the greatest
|
2015-03-20 16:42:49 +01:00
|
|
|
* configuration around) and no operation is performed.
|
|
|
|
*
|
|
|
|
* Important note: this function violates the principle that config epochs
|
|
|
|
* should be generated with consensus and should be unique across the cluster.
|
|
|
|
* However Redis Cluster uses this auto-generated new config epochs in two
|
|
|
|
* cases:
|
|
|
|
*
|
|
|
|
* 1) When slots are closed after importing. Otherwise resharding would be
|
2016-01-28 21:47:18 +02:00
|
|
|
* too expensive.
|
2015-03-20 16:42:49 +01:00
|
|
|
* 2) When CLUSTER FAILOVER is called with options that force a slave to
|
|
|
|
* failover its master even if there is not master majority able to
|
|
|
|
* create a new configuration epoch.
|
|
|
|
*
|
2016-01-08 12:07:52 +01:00
|
|
|
* Redis Cluster will not explode using this function, even in the case of
|
2015-03-20 16:42:49 +01:00
|
|
|
* a collision between this node and another node, generating the same
|
|
|
|
* configuration epoch unilaterally, because the config epoch conflict
|
|
|
|
* resolution algorithm will eventually move colliding nodes to different
|
2016-01-08 12:07:52 +01:00
|
|
|
* config epochs. However using this function may violate the "last failover
|
2015-03-20 16:42:49 +01:00
|
|
|
* wins" rule, so should only be used with care. */
|
|
|
|
int clusterBumpConfigEpochWithoutConsensus(void) {
|
|
|
|
uint64_t maxEpoch = clusterGetMaxEpoch();
|
|
|
|
|
|
|
|
if (myself->configEpoch == 0 ||
|
|
|
|
myself->configEpoch != maxEpoch)
|
|
|
|
{
|
|
|
|
server.cluster->currentEpoch++;
|
|
|
|
myself->configEpoch = server.cluster->currentEpoch;
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2015-03-20 16:42:49 +01:00
|
|
|
"New configEpoch set to %llu",
|
|
|
|
(unsigned long long) myself->configEpoch);
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2015-03-20 16:42:49 +01:00
|
|
|
} else {
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_ERR;
|
2015-03-20 16:42:49 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called when this node is a master, and we receive from
|
|
|
|
* another master a configuration epoch that is equal to our configuration
|
|
|
|
* epoch.
|
|
|
|
*
|
|
|
|
* BACKGROUND
|
|
|
|
*
|
|
|
|
* It is not possible that different slaves get the same config
|
|
|
|
* epoch during a failover election, because the slaves need to get voted
|
|
|
|
* by a majority. However when we perform a manual resharding of the cluster
|
|
|
|
* the node will assign a configuration epoch to itself without to ask
|
|
|
|
* for agreement. Usually resharding happens when the cluster is working well
|
|
|
|
* and is supervised by the sysadmin, however it is possible for a failover
|
|
|
|
* to happen exactly while the node we are resharding a slot to assigns itself
|
|
|
|
* a new configuration epoch, but before it is able to propagate it.
|
|
|
|
*
|
|
|
|
* So technically it is possible in this condition that two nodes end with
|
|
|
|
* the same configuration epoch.
|
|
|
|
*
|
|
|
|
* Another possibility is that there are bugs in the implementation causing
|
|
|
|
* this to happen.
|
|
|
|
*
|
|
|
|
* Moreover when a new cluster is created, all the nodes start with the same
|
|
|
|
* configEpoch. This collision resolution code allows nodes to automatically
|
|
|
|
* end with a different configEpoch at startup automatically.
|
|
|
|
*
|
|
|
|
* In all the cases, we want a mechanism that resolves this issue automatically
|
|
|
|
* as a safeguard. The same configuration epoch for masters serving different
|
|
|
|
* set of slots is not harmful, but it is if the nodes end serving the same
|
|
|
|
* slots for some reason (manual errors or software bugs) without a proper
|
|
|
|
* failover procedure.
|
|
|
|
*
|
|
|
|
* In general we want a system that eventually always ends with different
|
|
|
|
* masters having different configuration epochs whatever happened, since
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* nothing is worse than a split-brain condition in a distributed system.
|
2015-03-20 16:42:49 +01:00
|
|
|
*
|
|
|
|
* BEHAVIOR
|
|
|
|
*
|
|
|
|
* When this function gets called, what happens is that if this node
|
|
|
|
* has the lexicographically smaller Node ID compared to the other node
|
|
|
|
* with the conflicting epoch (the 'sender' node), it will assign itself
|
|
|
|
* the greatest configuration epoch currently detected among nodes plus 1.
|
|
|
|
*
|
|
|
|
* This means that even if there are multiple nodes colliding, the node
|
|
|
|
* with the greatest Node ID never moves forward, so eventually all the nodes
|
|
|
|
* end with a different configuration epoch.
|
|
|
|
*/
|
|
|
|
void clusterHandleConfigEpochCollision(clusterNode *sender) {
|
|
|
|
/* Prerequisites: nodes have the same configEpoch and are both masters. */
|
|
|
|
if (sender->configEpoch != myself->configEpoch ||
|
2023-11-09 11:04:47 +02:00
|
|
|
!clusterNodeIsMaster(sender) || !clusterNodeIsMaster(myself)) return;
|
2015-03-20 16:42:49 +01:00
|
|
|
/* Don't act if the colliding node has a smaller Node ID. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (memcmp(sender->name,myself->name,CLUSTER_NAMELEN) <= 0) return;
|
2015-03-20 16:42:49 +01:00
|
|
|
/* Get the next ID available at the best of this node knowledge. */
|
|
|
|
server.cluster->currentEpoch++;
|
|
|
|
myself->configEpoch = server.cluster->currentEpoch;
|
|
|
|
clusterSaveConfigOrDie(1);
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"WARNING: configEpoch collision with node %.40s (%s)."
|
2015-03-20 16:42:49 +01:00
|
|
|
" configEpoch set to %llu",
|
2023-06-18 12:16:51 +08:00
|
|
|
sender->name,sender->human_nodename,
|
2015-03-20 16:42:49 +01:00
|
|
|
(unsigned long long) myself->configEpoch);
|
|
|
|
}
|
|
|
|
|
2013-12-02 11:12:23 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER nodes blacklist
|
|
|
|
*
|
|
|
|
* The nodes blacklist is just a way to ensure that a given node with a given
|
2021-06-10 20:39:33 +08:00
|
|
|
* Node ID is not re-added before some time elapsed (this time is specified
|
2015-07-27 14:55:45 +02:00
|
|
|
* in seconds in CLUSTER_BLACKLIST_TTL).
|
2013-12-02 11:12:23 +01:00
|
|
|
*
|
|
|
|
* This is useful when we want to remove a node from the cluster completely:
|
|
|
|
* when CLUSTER FORGET is called, it also puts the node into the blacklist so
|
|
|
|
* that even if we receive gossip messages from other nodes that still remember
|
|
|
|
* about the node we want to remove, we don't re-add it before some time.
|
|
|
|
*
|
2015-07-27 14:55:45 +02:00
|
|
|
* Currently the CLUSTER_BLACKLIST_TTL is set to 1 minute, this means
|
2021-09-21 00:30:22 +08:00
|
|
|
* that redis-cli has 60 seconds to send CLUSTER FORGET messages to nodes
|
2014-01-15 16:06:54 +01:00
|
|
|
* in the cluster without dealing with the problem of other nodes re-adding
|
2013-12-02 11:12:23 +01:00
|
|
|
* back the node to nodes we already sent the FORGET command to.
|
|
|
|
*
|
2013-12-05 16:35:32 +01:00
|
|
|
* The data structure used is a hash table with an sds string representing
|
2013-12-02 11:12:23 +01:00
|
|
|
* the node ID as key, and the time when it is ok to re-add the node as
|
|
|
|
* value.
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
#define CLUSTER_BLACKLIST_TTL 60 /* 1 minute. */
|
2013-12-02 11:12:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Before of the addNode() or Exists() operations we always remove expired
|
|
|
|
* entries from the black list. This is an O(N) operation but it is not a
|
|
|
|
* problem since add / exists operations are called very infrequently and
|
|
|
|
* the hash table is supposed to contain very little elements at max.
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* However without the cleanup during long uptime and with some automated
|
2013-12-02 11:12:23 +01:00
|
|
|
* node add/removal procedures, entries could accumulate. */
|
|
|
|
void clusterBlacklistCleanup(void) {
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes_black_list);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
int64_t expire = dictGetUnsignedIntegerVal(de);
|
|
|
|
|
|
|
|
if (expire < server.unixtime)
|
|
|
|
dictDelete(server.cluster->nodes_black_list,dictGetKey(de));
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Cleanup the blacklist and add a new node ID to the black list. */
|
|
|
|
void clusterBlacklistAddNode(clusterNode *node) {
|
|
|
|
dictEntry *de;
|
2015-07-27 14:55:45 +02:00
|
|
|
sds id = sdsnewlen(node->name,CLUSTER_NAMELEN);
|
2013-12-02 11:12:23 +01:00
|
|
|
|
|
|
|
clusterBlacklistCleanup();
|
2014-01-15 16:44:06 +01:00
|
|
|
if (dictAdd(server.cluster->nodes_black_list,id,NULL) == DICT_OK) {
|
|
|
|
/* If the key was added, duplicate the sds string representation of
|
|
|
|
* the key for the next lookup. We'll free it at the end. */
|
|
|
|
id = sdsdup(id);
|
|
|
|
}
|
|
|
|
de = dictFind(server.cluster->nodes_black_list,id);
|
2015-07-27 14:55:45 +02:00
|
|
|
dictSetUnsignedIntegerVal(de,time(NULL)+CLUSTER_BLACKLIST_TTL);
|
2014-01-15 16:44:06 +01:00
|
|
|
sdsfree(id);
|
2013-12-02 11:12:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return non-zero if the specified node ID exists in the blacklist.
|
|
|
|
* You don't need to pass an sds string here, any pointer to 40 bytes
|
|
|
|
* will work. */
|
|
|
|
int clusterBlacklistExists(char *nodeid) {
|
2015-07-27 14:55:45 +02:00
|
|
|
sds id = sdsnewlen(nodeid,CLUSTER_NAMELEN);
|
2013-12-02 11:12:23 +01:00
|
|
|
int retval;
|
|
|
|
|
2014-01-15 16:06:54 +01:00
|
|
|
clusterBlacklistCleanup();
|
2013-12-02 11:12:23 +01:00
|
|
|
retval = dictFind(server.cluster->nodes_black_list,id) != NULL;
|
|
|
|
sdsfree(id);
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER messages exchange - PING/PONG and gossip
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2013-02-26 14:58:39 +01:00
|
|
|
/* This function checks if a given node should be marked as FAIL.
|
|
|
|
* It happens if the following conditions are met:
|
|
|
|
*
|
2013-09-20 11:26:44 +02:00
|
|
|
* 1) We received enough failure reports from other master nodes via gossip.
|
|
|
|
* Enough means that the majority of the masters signaled the node is
|
|
|
|
* down recently.
|
|
|
|
* 2) We believe this node is in PFAIL state.
|
2013-02-26 14:58:39 +01:00
|
|
|
*
|
|
|
|
* If a failure is detected we also inform the whole cluster about this
|
|
|
|
* event trying to force every other node to set the FAIL flag for the node.
|
2013-09-20 11:26:44 +02:00
|
|
|
*
|
|
|
|
* Note that the form of agreement used here is weak, as we collect the majority
|
|
|
|
* of masters state during some time, and even if we force agreement by
|
|
|
|
* propagating the FAIL message, because of partitions we may not reach every
|
|
|
|
* node. However:
|
|
|
|
*
|
|
|
|
* 1) Either we reach the majority and eventually the FAIL state will propagate
|
|
|
|
* to all the cluster.
|
|
|
|
* 2) Or there is no majority so no slave promotion will be authorized and the
|
|
|
|
* FAIL flag will be cleared after some time.
|
2013-02-26 14:58:39 +01:00
|
|
|
*/
|
|
|
|
void markNodeAsFailingIfNeeded(clusterNode *node) {
|
|
|
|
int failures;
|
|
|
|
int needed_quorum = (server.cluster->size / 2) + 1;
|
|
|
|
|
2014-01-29 12:17:16 +01:00
|
|
|
if (!nodeTimedOut(node)) return; /* We can reach it. */
|
|
|
|
if (nodeFailed(node)) return; /* Already FAILing. */
|
2013-02-26 14:58:39 +01:00
|
|
|
|
2013-09-20 11:26:44 +02:00
|
|
|
failures = clusterNodeFailureReportsCount(node);
|
|
|
|
/* Also count myself as a voter if I'm a master. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself)) failures++;
|
2013-09-20 11:26:44 +02:00
|
|
|
if (failures < needed_quorum) return; /* No weak agreement from masters. */
|
2013-02-26 14:58:39 +01:00
|
|
|
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Marking node %.40s (%s) as failing (quorum reached).", node->name, node->human_nodename);
|
2013-02-26 14:58:39 +01:00
|
|
|
|
|
|
|
/* Mark the node as failing. */
|
2015-07-27 14:55:45 +02:00
|
|
|
node->flags &= ~CLUSTER_NODE_PFAIL;
|
|
|
|
node->flags |= CLUSTER_NODE_FAIL;
|
2013-10-09 16:18:33 +02:00
|
|
|
node->fail_time = mstime();
|
2013-02-26 14:58:39 +01:00
|
|
|
|
2013-09-20 11:26:44 +02:00
|
|
|
/* Broadcast the failing node name to everybody, forcing all the other
|
2020-06-25 12:58:21 +02:00
|
|
|
* reachable nodes to flag the node as FAIL.
|
|
|
|
* We do that even if this node is a replica and not a master: anyway
|
|
|
|
* the failing state is triggered collecting failure reports from masters,
|
|
|
|
* so here the replica is only helping propagating this status. */
|
2020-06-15 10:18:14 +08:00
|
|
|
clusterSendFail(node->name);
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
2013-02-26 14:58:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called only if a node is marked as FAIL, but we are able
|
|
|
|
* to reach it again. It checks if there are the conditions to undo the FAIL
|
2013-03-21 10:47:10 +01:00
|
|
|
* state. */
|
2013-02-26 14:58:39 +01:00
|
|
|
void clearNodeFailureIfNeeded(clusterNode *node) {
|
2013-12-17 09:45:42 +01:00
|
|
|
mstime_t now = mstime();
|
2013-03-05 15:05:32 +01:00
|
|
|
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(nodeFailed(node));
|
2013-03-05 15:05:32 +01:00
|
|
|
|
|
|
|
/* For slaves we always clear the FAIL flag if we can contact the
|
|
|
|
* node again. */
|
2014-02-10 17:18:16 +01:00
|
|
|
if (nodeIsSlave(node) || node->numslots == 0) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Clear FAIL state for node %.40s (%s):%s is reachable again.",
|
|
|
|
node->name,node->human_nodename,
|
2018-09-10 10:49:03 +02:00
|
|
|
nodeIsSlave(node) ? "replica" : "master without slots");
|
2015-07-27 14:55:45 +02:00
|
|
|
node->flags &= ~CLUSTER_NODE_FAIL;
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
2013-03-05 15:05:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If it is a master and...
|
2013-10-09 16:18:33 +02:00
|
|
|
* 1) The FAIL state is old enough.
|
2013-03-05 15:05:32 +01:00
|
|
|
* 2) It is yet serving slots from our point of view (not failed over).
|
|
|
|
* Apparently no one is going to fix these slots, clear the FAIL flag. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(node) && node->numslots > 0 &&
|
2013-04-04 12:02:48 +02:00
|
|
|
(now - node->fail_time) >
|
2015-07-27 14:55:45 +02:00
|
|
|
(server.cluster_node_timeout * CLUSTER_FAIL_UNDO_TIME_MULT))
|
2013-03-05 15:05:32 +01:00
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Clear FAIL state for node %.40s (%s): is reachable again and nobody is serving its slots after some time.",
|
|
|
|
node->name, node->human_nodename);
|
2015-07-27 14:55:45 +02:00
|
|
|
node->flags &= ~CLUSTER_NODE_FAIL;
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
2013-02-26 14:58:39 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-04 15:52:16 +02:00
|
|
|
/* Return true if we already have a node in HANDSHAKE state matching the
|
|
|
|
* specified ip address and port number. This function is used in order to
|
|
|
|
* avoid adding a new handshake node for the same address multiple times. */
|
2016-01-21 16:57:35 +01:00
|
|
|
int clusterHandshakeInProgress(char *ip, int port, int cport) {
|
2013-09-04 15:52:16 +02:00
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
2014-01-29 12:17:16 +01:00
|
|
|
if (!nodeInHandshake(node)) continue;
|
2016-01-21 16:57:35 +01:00
|
|
|
if (!strcasecmp(node->ip,ip) &&
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
getNodeDefaultClientPort(node) == port &&
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport == cport) break;
|
2013-09-04 15:52:16 +02:00
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
return de != NULL;
|
|
|
|
}
|
|
|
|
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
/* Start a handshake with the specified address if there is not one
|
2013-12-20 12:37:18 +01:00
|
|
|
* already in progress. Returns non-zero if the handshake was actually
|
|
|
|
* started. On error zero is returned and errno is set to one of the
|
|
|
|
* following values:
|
|
|
|
*
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* EAGAIN - There is already a handshake in progress for this address.
|
2013-12-20 12:37:18 +01:00
|
|
|
* EINVAL - IP or port are not valid. */
|
2016-01-21 16:57:35 +01:00
|
|
|
int clusterStartHandshake(char *ip, int port, int cport) {
|
2013-12-20 12:37:18 +01:00
|
|
|
clusterNode *n;
|
2015-07-27 09:41:48 +02:00
|
|
|
char norm_ip[NET_IP_STR_LEN];
|
2013-12-20 12:37:18 +01:00
|
|
|
struct sockaddr_storage sa;
|
|
|
|
|
|
|
|
/* IP sanity check */
|
|
|
|
if (inet_pton(AF_INET,ip,
|
|
|
|
&(((struct sockaddr_in *)&sa)->sin_addr)))
|
|
|
|
{
|
|
|
|
sa.ss_family = AF_INET;
|
|
|
|
} else if (inet_pton(AF_INET6,ip,
|
|
|
|
&(((struct sockaddr_in6 *)&sa)->sin6_addr)))
|
|
|
|
{
|
|
|
|
sa.ss_family = AF_INET6;
|
|
|
|
} else {
|
|
|
|
errno = EINVAL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Port sanity check */
|
2016-01-21 16:57:35 +01:00
|
|
|
if (port <= 0 || port > 65535 || cport <= 0 || cport > 65535) {
|
2013-12-20 12:37:18 +01:00
|
|
|
errno = EINVAL;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set norm_ip as the normalized string representation of the node
|
|
|
|
* IP address. */
|
2015-07-27 09:41:48 +02:00
|
|
|
memset(norm_ip,0,NET_IP_STR_LEN);
|
2013-12-20 12:37:18 +01:00
|
|
|
if (sa.ss_family == AF_INET)
|
|
|
|
inet_ntop(AF_INET,
|
|
|
|
(void*)&(((struct sockaddr_in *)&sa)->sin_addr),
|
2015-07-27 09:41:48 +02:00
|
|
|
norm_ip,NET_IP_STR_LEN);
|
2013-12-20 12:37:18 +01:00
|
|
|
else
|
|
|
|
inet_ntop(AF_INET6,
|
|
|
|
(void*)&(((struct sockaddr_in6 *)&sa)->sin6_addr),
|
2015-07-27 09:41:48 +02:00
|
|
|
norm_ip,NET_IP_STR_LEN);
|
2013-12-20 12:37:18 +01:00
|
|
|
|
2016-01-21 16:57:35 +01:00
|
|
|
if (clusterHandshakeInProgress(norm_ip,port,cport)) {
|
2013-12-20 12:37:18 +01:00
|
|
|
errno = EAGAIN;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add the node with a random address (NULL as first argument to
|
|
|
|
* createClusterNode()). Everything will be fixed during the
|
2014-07-31 14:51:05 -04:00
|
|
|
* handshake. */
|
2015-07-27 14:55:45 +02:00
|
|
|
n = createClusterNode(NULL,CLUSTER_NODE_HANDSHAKE|CLUSTER_NODE_MEET);
|
2013-12-20 12:37:18 +01:00
|
|
|
memcpy(n->ip,norm_ip,sizeof(n->ip));
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (server.tls_cluster) {
|
|
|
|
n->tls_port = port;
|
|
|
|
} else {
|
|
|
|
n->tcp_port = port;
|
|
|
|
}
|
2016-01-21 16:57:35 +01:00
|
|
|
n->cport = cport;
|
2013-12-20 12:37:18 +01:00
|
|
|
clusterAddNode(n);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
static void getClientPortFromClusterMsg(clusterMsg *hdr, int *tls_port, int *tcp_port) {
|
|
|
|
if (server.tls_cluster) {
|
|
|
|
*tls_port = ntohs(hdr->port);
|
|
|
|
*tcp_port = ntohs(hdr->pport);
|
|
|
|
} else {
|
|
|
|
*tls_port = ntohs(hdr->pport);
|
|
|
|
*tcp_port = ntohs(hdr->port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void getClientPortFromGossip(clusterMsgDataGossip *g, int *tls_port, int *tcp_port) {
|
|
|
|
if (server.tls_cluster) {
|
|
|
|
*tls_port = ntohs(g->port);
|
|
|
|
*tcp_port = ntohs(g->pport);
|
|
|
|
} else {
|
|
|
|
*tls_port = ntohs(g->pport);
|
|
|
|
*tcp_port = ntohs(g->port);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Process the gossip section of PING or PONG packets.
|
|
|
|
* Note that this function assumes that the packet is already sanity-checked
|
|
|
|
* by the caller, not in the content of the gossip section, but in the
|
|
|
|
* length. */
|
|
|
|
void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) {
|
|
|
|
uint16_t count = ntohs(hdr->count);
|
|
|
|
clusterMsgDataGossip *g = (clusterMsgDataGossip*) hdr->data.ping.gossip;
|
2022-04-05 13:51:51 +08:00
|
|
|
clusterNode *sender = link->node ? link->node : clusterLookupNode(hdr->sender, CLUSTER_NAMELEN);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
while(count--) {
|
|
|
|
uint16_t flags = ntohs(g->flags);
|
|
|
|
clusterNode *node;
|
2014-08-08 15:52:04 +02:00
|
|
|
sds ci;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2017-07-20 15:17:35 +02:00
|
|
|
if (server.verbosity == LL_DEBUG) {
|
|
|
|
ci = representClusterNodeFlags(sdsempty(), flags);
|
|
|
|
serverLog(LL_DEBUG,"GOSSIP %.40s %s:%d@%d %s",
|
|
|
|
g->nodename,
|
|
|
|
g->ip,
|
|
|
|
ntohs(g->port),
|
|
|
|
ntohs(g->cport),
|
|
|
|
ci);
|
|
|
|
sdsfree(ci);
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
/* Convert port and pport into TCP port and TLS port. */
|
|
|
|
int msg_tls_port, msg_tcp_port;
|
|
|
|
getClientPortFromGossip(g, &msg_tls_port, &msg_tcp_port);
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Update our state accordingly to the gossip sections */
|
2022-04-05 13:51:51 +08:00
|
|
|
node = clusterLookupNode(g->nodename, CLUSTER_NAMELEN);
|
2013-12-20 12:37:18 +01:00
|
|
|
if (node) {
|
2013-08-26 16:16:25 +02:00
|
|
|
/* We already know this node.
|
|
|
|
Handle failure reports, only when the sender is a master. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (sender && clusterNodeIsMaster(sender) && node != myself) {
|
2015-07-27 14:55:45 +02:00
|
|
|
if (flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) {
|
2013-02-26 14:58:39 +01:00
|
|
|
if (clusterNodeAddFailureReport(node,sender)) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Node %.40s (%s) reported node %.40s (%s) as not reachable.",
|
|
|
|
sender->name, sender->human_nodename, node->name, node->human_nodename);
|
2013-02-26 14:58:39 +01:00
|
|
|
}
|
|
|
|
markNodeAsFailingIfNeeded(node);
|
|
|
|
} else {
|
|
|
|
if (clusterNodeDelFailureReport(node,sender)) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Node %.40s (%s) reported node %.40s (%s) is back online.",
|
|
|
|
sender->name, sender->human_nodename, node->name, node->human_nodename);
|
2013-02-26 14:58:39 +01:00
|
|
|
}
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2013-12-20 12:37:18 +01:00
|
|
|
|
Cluster: decrease ping/pong traffic by trusting other nodes reports.
Cluster of bigger sizes tend to have a lot of traffic in the cluster bus
just for failure detection: a node will try to get a ping reply from
another node no longer than when the half the node timeout would elapsed,
in order to avoid a false positive.
However this means that if we have N nodes and the node timeout is set
to, for instance M seconds, we'll have to ping N nodes every M/2
seconds. This N*M/2 pings will receive the same number of pongs, so
a total of N*M packets per node. However given that we have a total of N
nodes doing this, the total number of messages will be N*N*M.
In a 100 nodes cluster with a timeout of 60 seconds, this translates
to a total of 100*100*30 packets per second, summing all the packets
exchanged by all the nodes.
This is, as you can guess, a lot... So this patch changes the
implementation in a very simple way in order to trust the reports of
other nodes: if a node A reports a node B as alive at least up to
a given time, we update our view accordingly.
The problem with this approach is that it could result into a subset of
nodes being able to reach a given node X, and preventing others from
detecting that is actually not reachable from the majority of nodes.
So the above algorithm is refined by trusting other nodes only if we do
not have currently a ping pending for the node X, and if there are no
failure reports for that node.
Since each node, anyway, pings 10 other nodes every second (one node
every 100 milliseconds), anyway eventually even trusting the other nodes
reports, we will detect if a given node is down from our POV.
Now to understand the number of packets that the cluster would exchange
for failure detection with the patch, we can start considering the
random PINGs that the cluster sent anyway as base line:
Each node sends 10 packets per second, so the total traffic if no
additioal packets would be sent, including PONG packets, would be:
Total messages per second = N*10*2
However by trusting other nodes gossip sections will not AWALYS prevent
pinging nodes for the "half timeout reached" rule all the times. The
math involved in computing the actual rate as N and M change is quite
complex and depends also on another parameter, which is the number of
entries in the gossip section of PING and PONG packets. However it is
possible to compare what happens in cluster of different sizes
experimentally. After applying this patch a very important reduction in
the number of packets exchanged is trivial to observe, without apparent
impacts on the failure detection performances.
Actual numbers with different cluster sizes should be published in the
Reids Cluster documentation in the future.
Related to #3929.
2017-04-14 10:14:17 +02:00
|
|
|
/* If from our POV the node is up (no failure flags are set),
|
|
|
|
* we have no pending ping for the node, nor we have failure
|
|
|
|
* reports for this node, update the last pong time with the
|
|
|
|
* one we see from the other nodes. */
|
|
|
|
if (!(flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) &&
|
|
|
|
node->ping_sent == 0 &&
|
|
|
|
clusterNodeFailureReportsCount(node) == 0)
|
|
|
|
{
|
2017-04-14 10:40:22 +02:00
|
|
|
mstime_t pongtime = ntohl(g->pong_received);
|
|
|
|
pongtime *= 1000; /* Convert back to milliseconds. */
|
2017-04-15 10:08:39 +02:00
|
|
|
|
|
|
|
/* Replace the pong time with the received one only if
|
|
|
|
* it's greater than our view but is not in the future
|
|
|
|
* (with 500 milliseconds tolerance) from the POV of our
|
|
|
|
* clock. */
|
|
|
|
if (pongtime <= (server.mstime+500) &&
|
|
|
|
pongtime > node->pong_received)
|
|
|
|
{
|
Cluster: decrease ping/pong traffic by trusting other nodes reports.
Cluster of bigger sizes tend to have a lot of traffic in the cluster bus
just for failure detection: a node will try to get a ping reply from
another node no longer than when the half the node timeout would elapsed,
in order to avoid a false positive.
However this means that if we have N nodes and the node timeout is set
to, for instance M seconds, we'll have to ping N nodes every M/2
seconds. This N*M/2 pings will receive the same number of pongs, so
a total of N*M packets per node. However given that we have a total of N
nodes doing this, the total number of messages will be N*N*M.
In a 100 nodes cluster with a timeout of 60 seconds, this translates
to a total of 100*100*30 packets per second, summing all the packets
exchanged by all the nodes.
This is, as you can guess, a lot... So this patch changes the
implementation in a very simple way in order to trust the reports of
other nodes: if a node A reports a node B as alive at least up to
a given time, we update our view accordingly.
The problem with this approach is that it could result into a subset of
nodes being able to reach a given node X, and preventing others from
detecting that is actually not reachable from the majority of nodes.
So the above algorithm is refined by trusting other nodes only if we do
not have currently a ping pending for the node X, and if there are no
failure reports for that node.
Since each node, anyway, pings 10 other nodes every second (one node
every 100 milliseconds), anyway eventually even trusting the other nodes
reports, we will detect if a given node is down from our POV.
Now to understand the number of packets that the cluster would exchange
for failure detection with the patch, we can start considering the
random PINGs that the cluster sent anyway as base line:
Each node sends 10 packets per second, so the total traffic if no
additioal packets would be sent, including PONG packets, would be:
Total messages per second = N*10*2
However by trusting other nodes gossip sections will not AWALYS prevent
pinging nodes for the "half timeout reached" rule all the times. The
math involved in computing the actual rate as N and M change is quite
complex and depends also on another parameter, which is the number of
entries in the gossip section of PING and PONG packets. However it is
possible to compare what happens in cluster of different sizes
experimentally. After applying this patch a very important reduction in
the number of packets exchanged is trivial to observe, without apparent
impacts on the failure detection performances.
Actual numbers with different cluster sizes should be published in the
Reids Cluster documentation in the future.
Related to #3929.
2017-04-14 10:14:17 +02:00
|
|
|
node->pong_received = pongtime;
|
2017-04-14 10:35:55 +02:00
|
|
|
}
|
Cluster: decrease ping/pong traffic by trusting other nodes reports.
Cluster of bigger sizes tend to have a lot of traffic in the cluster bus
just for failure detection: a node will try to get a ping reply from
another node no longer than when the half the node timeout would elapsed,
in order to avoid a false positive.
However this means that if we have N nodes and the node timeout is set
to, for instance M seconds, we'll have to ping N nodes every M/2
seconds. This N*M/2 pings will receive the same number of pongs, so
a total of N*M packets per node. However given that we have a total of N
nodes doing this, the total number of messages will be N*N*M.
In a 100 nodes cluster with a timeout of 60 seconds, this translates
to a total of 100*100*30 packets per second, summing all the packets
exchanged by all the nodes.
This is, as you can guess, a lot... So this patch changes the
implementation in a very simple way in order to trust the reports of
other nodes: if a node A reports a node B as alive at least up to
a given time, we update our view accordingly.
The problem with this approach is that it could result into a subset of
nodes being able to reach a given node X, and preventing others from
detecting that is actually not reachable from the majority of nodes.
So the above algorithm is refined by trusting other nodes only if we do
not have currently a ping pending for the node X, and if there are no
failure reports for that node.
Since each node, anyway, pings 10 other nodes every second (one node
every 100 milliseconds), anyway eventually even trusting the other nodes
reports, we will detect if a given node is down from our POV.
Now to understand the number of packets that the cluster would exchange
for failure detection with the patch, we can start considering the
random PINGs that the cluster sent anyway as base line:
Each node sends 10 packets per second, so the total traffic if no
additioal packets would be sent, including PONG packets, would be:
Total messages per second = N*10*2
However by trusting other nodes gossip sections will not AWALYS prevent
pinging nodes for the "half timeout reached" rule all the times. The
math involved in computing the actual rate as N and M change is quite
complex and depends also on another parameter, which is the number of
entries in the gossip section of PING and PONG packets. However it is
possible to compare what happens in cluster of different sizes
experimentally. After applying this patch a very important reduction in
the number of packets exchanged is trivial to observe, without apparent
impacts on the failure detection performances.
Actual numbers with different cluster sizes should be published in the
Reids Cluster documentation in the future.
Related to #3929.
2017-04-14 10:14:17 +02:00
|
|
|
}
|
|
|
|
|
2013-12-20 12:37:18 +01:00
|
|
|
/* If we already know this node, but it is not reachable, and
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
* we see a different address in the gossip section of a node that
|
|
|
|
* can talk with this other node, update the address, disconnect
|
|
|
|
* the old link if any, so that we'll attempt to connect with the
|
|
|
|
* new address. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (node->flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL) &&
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
!(flags & CLUSTER_NODE_NOADDR) &&
|
|
|
|
!(flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) &&
|
2016-01-21 16:57:35 +01:00
|
|
|
(strcasecmp(node->ip,g->ip) ||
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tls_port != (server.tls_cluster ? ntohs(g->port) : ntohs(g->pport)) ||
|
|
|
|
node->tcp_port != (server.tls_cluster ? ntohs(g->pport) : ntohs(g->port)) ||
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport != ntohs(g->cport)))
|
2013-12-20 12:37:18 +01:00
|
|
|
{
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
if (node->link) freeClusterLink(node->link);
|
|
|
|
memcpy(node->ip,g->ip,NET_IP_STR_LEN);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tcp_port = msg_tcp_port;
|
|
|
|
node->tls_port = msg_tls_port;
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport = ntohs(g->cport);
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
node->flags &= ~CLUSTER_NODE_NOADDR;
|
2013-12-20 12:37:18 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
} else {
|
|
|
|
/* If it's not in NOADDR state and we don't have it, we
|
2020-05-27 11:55:23 +08:00
|
|
|
* add it to our trusted dict with exact nodeid and flag.
|
|
|
|
* Note that we cannot simply start a handshake against
|
|
|
|
* this IP/PORT pairs, since IP/PORT can be reused already,
|
|
|
|
* otherwise we risk joining another cluster.
|
2011-03-29 17:51:15 +02:00
|
|
|
*
|
|
|
|
* Note that we require that the sender of this gossip message
|
|
|
|
* is a well known node in our cluster, otherwise we risk
|
|
|
|
* joining another cluster. */
|
2014-01-15 16:50:45 +01:00
|
|
|
if (sender &&
|
2015-07-27 14:55:45 +02:00
|
|
|
!(flags & CLUSTER_NODE_NOADDR) &&
|
2014-01-15 16:50:45 +01:00
|
|
|
!clusterBlacklistExists(g->nodename))
|
|
|
|
{
|
2020-05-27 11:55:23 +08:00
|
|
|
clusterNode *node;
|
|
|
|
node = createClusterNode(g->nodename, flags);
|
|
|
|
memcpy(node->ip,g->ip,NET_IP_STR_LEN);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tcp_port = msg_tcp_port;
|
|
|
|
node->tls_port = msg_tls_port;
|
2020-05-27 11:55:23 +08:00
|
|
|
node->cport = ntohs(g->cport);
|
|
|
|
clusterAddNode(node);
|
2014-01-15 16:50:45 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Next node */
|
|
|
|
g++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-21 16:57:35 +01:00
|
|
|
/* IP -> string conversion. 'buf' is supposed to at least be 46 bytes.
|
|
|
|
* If 'announced_ip' length is non-zero, it is used instead of extracting
|
|
|
|
* the IP from the socket peer address. */
|
2022-07-21 07:59:27 +08:00
|
|
|
int nodeIp2String(char *buf, clusterLink *link, char *announced_ip) {
|
2016-01-21 16:57:35 +01:00
|
|
|
if (announced_ip[0] != '\0') {
|
|
|
|
memcpy(buf,announced_ip,NET_IP_STR_LEN);
|
|
|
|
buf[NET_IP_STR_LEN-1] = '\0'; /* We are not sure the input is sane. */
|
2022-07-21 07:59:27 +08:00
|
|
|
return C_OK;
|
2016-01-21 16:57:35 +01:00
|
|
|
} else {
|
2022-11-02 10:27:30 +08:00
|
|
|
if (connAddrPeerName(link->conn, buf, NET_IP_STR_LEN, NULL) == -1) {
|
2022-07-21 07:59:27 +08:00
|
|
|
serverLog(LL_NOTICE, "Error converting peer IP to string: %s",
|
|
|
|
link->conn ? connGetLastError(link->conn) : "no link");
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
return C_OK;
|
2016-01-21 16:57:35 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Update the node address to the IP address that can be extracted
|
2016-01-21 16:57:35 +01:00
|
|
|
* from link->fd, or if hdr->myip is non empty, to the address the node
|
|
|
|
* is announcing us. The port is taken from the packet header as well.
|
|
|
|
*
|
|
|
|
* If the address or port changed, disconnect the node link so that we'll
|
|
|
|
* connect again to the new address.
|
2013-06-12 10:50:07 -07:00
|
|
|
*
|
|
|
|
* If the ip/port pair are already correct no operation is performed at
|
|
|
|
* all.
|
|
|
|
*
|
|
|
|
* The function returns 0 if the node address is still the same,
|
|
|
|
* otherwise 1 is returned. */
|
2016-01-21 16:57:35 +01:00
|
|
|
int nodeUpdateAddressIfNeeded(clusterNode *node, clusterLink *link,
|
|
|
|
clusterMsg *hdr)
|
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
char ip[NET_IP_STR_LEN] = {0};
|
2016-01-21 16:57:35 +01:00
|
|
|
int cport = ntohs(hdr->cport);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int tcp_port, tls_port;
|
|
|
|
getClientPortFromClusterMsg(hdr, &tls_port, &tcp_port);
|
2013-06-12 10:50:07 -07:00
|
|
|
|
|
|
|
/* We don't proceed if the link is the same as the sender link, as this
|
|
|
|
* function is designed to see if the node link is consistent with the
|
|
|
|
* symmetric link that is used to receive PINGs from the node.
|
|
|
|
*
|
|
|
|
* As a side effect this function never frees the passed 'link', so
|
|
|
|
* it is safe to call during packet processing. */
|
|
|
|
if (link == node->link) return 0;
|
|
|
|
|
2022-07-21 07:59:27 +08:00
|
|
|
/* If the peer IP is unavailable for some reasons like invalid fd or closed
|
|
|
|
* link, just give up the update this time, and the update will be retried
|
|
|
|
* in the next round of PINGs */
|
|
|
|
if (nodeIp2String(ip,link,hdr->myip) == C_ERR) return 0;
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (node->tcp_port == tcp_port && node->cport == cport && node->tls_port == tls_port &&
|
2016-01-21 16:57:35 +01:00
|
|
|
strcmp(ip,node->ip) == 0) return 0;
|
2013-06-12 10:50:07 -07:00
|
|
|
|
|
|
|
/* IP / port is different, update it. */
|
|
|
|
memcpy(node->ip,ip,sizeof(ip));
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->tcp_port = tcp_port;
|
|
|
|
node->tls_port = tls_port;
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport = cport;
|
2013-06-12 10:50:07 -07:00
|
|
|
if (node->link) freeClusterLink(node->link);
|
2015-07-27 14:55:45 +02:00
|
|
|
node->flags &= ~CLUSTER_NODE_NOADDR;
|
2023-06-18 12:16:51 +08:00
|
|
|
serverLog(LL_NOTICE,"Address updated for node %.40s (%s), now %s:%d",
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
node->name, node->human_nodename, node->ip, getNodeDefaultClientPort(node));
|
2013-12-20 12:47:13 +01:00
|
|
|
|
|
|
|
/* Check if this is our master and we have to change the
|
|
|
|
* replication target as well. */
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeIsSlave(myself) && myself->slaveof == node)
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
replicationSetMaster(node->ip, getNodeDefaultReplicationPort(node));
|
2013-06-12 10:50:07 -07:00
|
|
|
return 1;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2013-11-08 17:02:10 +01:00
|
|
|
/* Reconfigure the specified node 'n' as a master. This function is called when
|
|
|
|
* a node that we believed to be a slave is now acting as master in order to
|
|
|
|
* update the state of the node. */
|
|
|
|
void clusterSetNodeAsMaster(clusterNode *n) {
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(n)) return;
|
2013-11-08 17:02:10 +01:00
|
|
|
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
if (n->slaveof) {
|
|
|
|
clusterNodeRemoveSlave(n->slaveof,n);
|
|
|
|
if (n != myself) n->flags |= CLUSTER_NODE_MIGRATE_TO;
|
|
|
|
}
|
2015-07-27 14:55:45 +02:00
|
|
|
n->flags &= ~CLUSTER_NODE_SLAVE;
|
|
|
|
n->flags |= CLUSTER_NODE_MASTER;
|
2013-11-08 17:02:10 +01:00
|
|
|
n->slaveof = NULL;
|
|
|
|
|
|
|
|
/* Update config and state. */
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called when we receive a master configuration via a
|
|
|
|
* PING, PONG or UPDATE packet. What we receive is a node, a configEpoch of the
|
|
|
|
* node, and the set of slots claimed under this configEpoch.
|
|
|
|
*
|
|
|
|
* What we do is to rebind the slots with newer configuration compared to our
|
|
|
|
* local configuration, and if needed, we turn ourself into a replica of the
|
|
|
|
* node (see the function comments for more info).
|
|
|
|
*
|
|
|
|
* The 'sender' is the node for which we received a configuration update.
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
* Sometimes it is not actually the "Sender" of the information, like in the
|
|
|
|
* case we receive the info via an UPDATE packet. */
|
2014-03-11 11:49:47 +01:00
|
|
|
void clusterUpdateSlotsConfigWith(clusterNode *sender, uint64_t senderConfigEpoch, unsigned char *slots) {
|
2013-11-08 17:02:10 +01:00
|
|
|
int j;
|
2021-04-04 09:43:24 +03:00
|
|
|
clusterNode *curmaster = NULL, *newmaster = NULL;
|
2014-05-14 10:46:37 +02:00
|
|
|
/* The dirty slots list is a list of slots for which we lose the ownership
|
|
|
|
* while having still keys inside. This usually happens after a failover
|
|
|
|
* or after a manual cluster reconfiguration operated by the admin.
|
|
|
|
*
|
|
|
|
* If the update message is not able to demote a master to slave (in this
|
|
|
|
* case we'll resync with the master updating the whole key space), we
|
|
|
|
* need to delete all the keys in the slots we lost ownership. */
|
2015-07-27 14:55:45 +02:00
|
|
|
uint16_t dirty_slots[CLUSTER_SLOTS];
|
2014-05-14 10:46:37 +02:00
|
|
|
int dirty_slots_count = 0;
|
2013-11-08 17:02:10 +01:00
|
|
|
|
2021-04-04 09:43:24 +03:00
|
|
|
/* We should detect if sender is new master of our shard.
|
|
|
|
* We will know it if all our slots were migrated to sender, and sender
|
|
|
|
* has no slots except ours */
|
|
|
|
int sender_slots = 0;
|
|
|
|
int migrated_our_slots = 0;
|
|
|
|
|
2013-11-08 17:02:10 +01:00
|
|
|
/* Here we set curmaster to this node or the node this node
|
|
|
|
* replicates to if it's a slave. In the for loop we are
|
|
|
|
* interested to check if slots are taken away from curmaster. */
|
2023-11-09 11:04:47 +02:00
|
|
|
curmaster = clusterNodeIsMaster(myself) ? myself : myself->slaveof;
|
2013-11-08 17:02:10 +01:00
|
|
|
|
2014-03-26 12:09:38 +01:00
|
|
|
if (sender == myself) {
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,"Discarding UPDATE message about myself.");
|
2014-03-26 12:09:38 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2013-11-08 17:02:10 +01:00
|
|
|
if (bitmapTestBit(slots,j)) {
|
2021-04-04 09:43:24 +03:00
|
|
|
sender_slots++;
|
|
|
|
|
2014-03-11 11:49:47 +01:00
|
|
|
/* The slot is already bound to the sender of this message. */
|
2023-07-05 17:46:23 -07:00
|
|
|
if (server.cluster->slots[j] == sender) {
|
|
|
|
bitmapClearBit(server.cluster->owner_not_claiming_slot, j);
|
|
|
|
continue;
|
|
|
|
}
|
2014-03-11 11:49:47 +01:00
|
|
|
|
|
|
|
/* The slot is in importing state, it should be modified only
|
2021-09-21 00:30:22 +08:00
|
|
|
* manually via redis-cli (example: a resharding is in progress
|
2014-03-11 11:49:47 +01:00
|
|
|
* and the migrating side slot was already closed and is advertising
|
|
|
|
* a new config. We still want the slot to be closed manually). */
|
|
|
|
if (server.cluster->importing_slots_from[j]) continue;
|
|
|
|
|
2013-11-08 17:02:10 +01:00
|
|
|
/* We rebind the slot to the new node claiming it if:
|
2023-07-05 17:46:23 -07:00
|
|
|
* 1) The slot was unassigned or the previous owner no longer owns the slot or
|
|
|
|
* the new node claims it with a greater configEpoch.
|
2014-03-11 11:32:40 +01:00
|
|
|
* 2) We are not currently importing the slot. */
|
2023-07-05 17:46:23 -07:00
|
|
|
if (isSlotUnclaimed(j) ||
|
2014-02-10 18:01:58 +01:00
|
|
|
server.cluster->slots[j]->configEpoch < senderConfigEpoch)
|
2013-11-08 17:02:10 +01:00
|
|
|
{
|
2014-05-14 10:46:37 +02:00
|
|
|
/* Was this slot mine, and still contains keys? Mark it as
|
|
|
|
* a dirty slot. */
|
2014-03-11 11:49:47 +01:00
|
|
|
if (server.cluster->slots[j] == myself &&
|
|
|
|
countKeysInSlot(j) &&
|
|
|
|
sender != myself)
|
|
|
|
{
|
2014-05-14 10:46:37 +02:00
|
|
|
dirty_slots[dirty_slots_count] = j;
|
|
|
|
dirty_slots_count++;
|
2014-03-11 11:49:47 +01:00
|
|
|
}
|
|
|
|
|
2021-04-04 09:43:24 +03:00
|
|
|
if (server.cluster->slots[j] == curmaster) {
|
2013-11-08 17:02:10 +01:00
|
|
|
newmaster = sender;
|
2021-04-04 09:43:24 +03:00
|
|
|
migrated_our_slots++;
|
|
|
|
}
|
2013-11-08 17:02:10 +01:00
|
|
|
clusterDelSlot(j);
|
|
|
|
clusterAddSlot(sender,j);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
|
|
|
}
|
2023-07-05 17:46:23 -07:00
|
|
|
} else if (server.cluster->slots[j] == sender) {
|
|
|
|
/* The slot is currently bound to the sender but the sender is no longer
|
|
|
|
* claiming it. We don't want to unbind the slot yet as it can cause the cluster
|
|
|
|
* to move to FAIL state and also throw client error. Keeping the slot bound to
|
|
|
|
* the previous owner will cause a few client side redirects, but won't throw
|
|
|
|
* any errors. We will keep track of the uncertainty in ownership to avoid
|
|
|
|
* propagating misinformation about this slot's ownership using UPDATE
|
|
|
|
* messages. */
|
|
|
|
bitmapSetBit(server.cluster->owner_not_claiming_slot, j);
|
2013-11-08 17:02:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-09-19 11:31:22 +02:00
|
|
|
/* After updating the slots configuration, don't do any actual change
|
|
|
|
* in the state of the server if a module disabled Redis Cluster
|
|
|
|
* keys redirections. */
|
|
|
|
if (server.cluster_module_flags & CLUSTER_MODULE_FLAG_NO_REDIRECTION)
|
|
|
|
return;
|
|
|
|
|
2013-11-08 17:02:10 +01:00
|
|
|
/* If at least one slot was reassigned from a node to another node
|
|
|
|
* with a greater configEpoch, it is possible that:
|
|
|
|
* 1) We are a master left without slots. This means that we were
|
|
|
|
* failed over and we should turn into a replica of the new
|
|
|
|
* master.
|
|
|
|
* 2) We are a slave and our master is left without slots. We need
|
|
|
|
* to replicate to the new slots owner. */
|
2021-04-04 09:43:24 +03:00
|
|
|
if (newmaster && curmaster->numslots == 0 &&
|
|
|
|
(server.cluster_allow_replica_migration ||
|
|
|
|
sender_slots == migrated_our_slots)) {
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-03-25 16:07:14 +01:00
|
|
|
"Configuration change detected. Reconfiguring myself "
|
2023-06-18 12:16:51 +08:00
|
|
|
"as a replica of %.40s (%s)", sender->name, sender->human_nodename);
|
2013-11-08 17:02:10 +01:00
|
|
|
clusterSetMaster(sender);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2022-09-14 02:48:48 +02:00
|
|
|
} else if (myself->slaveof && myself->slaveof->slaveof &&
|
|
|
|
/* In some rare case when CLUSTER FAILOVER TAKEOVER is used, it
|
|
|
|
* can happen that myself is a replica of a replica of myself. If
|
|
|
|
* this happens, we do nothing to avoid a crash and wait for the
|
|
|
|
* admin to repair the cluster. */
|
|
|
|
myself->slaveof->slaveof != myself)
|
|
|
|
{
|
2022-04-02 23:58:07 +02:00
|
|
|
/* Safeguard against sub-replicas. A replica's master can turn itself
|
|
|
|
* into a replica if its last slot is removed. If no other node takes
|
|
|
|
* over the slot, there is nothing else to trigger replica migration. */
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"I'm a sub-replica! Reconfiguring myself as a replica of grandmaster %.40s (%s)",
|
|
|
|
myself->slaveof->slaveof->name, myself->slaveof->slaveof->human_nodename);
|
2022-04-02 23:58:07 +02:00
|
|
|
clusterSetMaster(myself->slaveof->slaveof);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2014-05-14 10:46:37 +02:00
|
|
|
} else if (dirty_slots_count) {
|
|
|
|
/* If we are here, we received an update message which removed
|
|
|
|
* ownership for certain slots we still have keys about, but still
|
|
|
|
* we are serving some slots, so this master node was not demoted to
|
|
|
|
* a slave.
|
|
|
|
*
|
|
|
|
* In order to maintain a consistent state between keys and slots
|
|
|
|
* we need to remove all the keys from the slots we lost. */
|
|
|
|
for (j = 0; j < dirty_slots_count; j++)
|
|
|
|
delKeysInSlot(dirty_slots[j]);
|
2013-11-08 17:02:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* Cluster ping extensions.
|
|
|
|
*
|
|
|
|
* The ping/pong/meet messages support arbitrary extensions to add additional
|
|
|
|
* metadata to the messages that are sent between the various nodes in the
|
|
|
|
* cluster. The extensions take the form:
|
|
|
|
* [ Header length + type (8 bytes) ]
|
|
|
|
* [ Extension information (Arbitrary length, but must be 8 byte padded) ]
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Returns the length of a given extension */
|
|
|
|
static uint32_t getPingExtLength(clusterMsgPingExt *ext) {
|
|
|
|
return ntohl(ext->length);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Returns the initial position of ping extensions. May return an invalid
|
|
|
|
* address if there are no ping extensions. */
|
2022-11-16 19:24:18 -08:00
|
|
|
static clusterMsgPingExt *getInitialPingExt(clusterMsg *hdr, int count) {
|
2022-01-02 19:48:29 -08:00
|
|
|
clusterMsgPingExt *initial = (clusterMsgPingExt*) &(hdr->data.ping.gossip[count]);
|
|
|
|
return initial;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Given a current ping extension, returns the start of the next extension. May return
|
|
|
|
* an invalid address if there are no further ping extensions. */
|
|
|
|
static clusterMsgPingExt *getNextPingExt(clusterMsgPingExt *ext) {
|
|
|
|
clusterMsgPingExt *next = (clusterMsgPingExt *) (((char *) ext) + getPingExtLength(ext));
|
|
|
|
return next;
|
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* All PING extensions must be 8-byte aligned */
|
|
|
|
uint32_t getAlignedPingExtSize(uint32_t dataSize) {
|
2022-01-02 19:48:29 -08:00
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
return sizeof(clusterMsgPingExt) + EIGHT_BYTE_ALIGN(dataSize);
|
|
|
|
}
|
|
|
|
|
2023-05-02 17:31:32 -07:00
|
|
|
uint32_t getHostnamePingExtSize(void) {
|
2022-11-16 19:24:18 -08:00
|
|
|
if (sdslen(myself->hostname) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return getAlignedPingExtSize(sdslen(myself->hostname) + 1);
|
|
|
|
}
|
|
|
|
|
2023-06-18 12:16:51 +08:00
|
|
|
uint32_t getHumanNodenamePingExtSize(void) {
|
|
|
|
if (sdslen(myself->human_nodename) == 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return getAlignedPingExtSize(sdslen(myself->human_nodename) + 1);
|
|
|
|
}
|
|
|
|
|
2023-05-02 17:31:32 -07:00
|
|
|
uint32_t getShardIdPingExtSize(void) {
|
2022-11-16 19:24:18 -08:00
|
|
|
return getAlignedPingExtSize(sizeof(clusterMsgPingExtShardId));
|
|
|
|
}
|
|
|
|
|
2023-05-02 17:31:32 -07:00
|
|
|
uint32_t getForgottenNodeExtSize(void) {
|
2022-11-16 19:24:18 -08:00
|
|
|
return getAlignedPingExtSize(sizeof(clusterMsgPingExtForgottenNode));
|
2022-01-02 19:48:29 -08:00
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
void *preparePingExt(clusterMsgPingExt *ext, uint16_t type, uint32_t length) {
|
|
|
|
ext->type = htons(type);
|
|
|
|
ext->length = htonl(length);
|
|
|
|
return &ext->ext[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
clusterMsgPingExt *nextPingExt(clusterMsgPingExt *ext) {
|
|
|
|
return (clusterMsgPingExt *)((char*)ext + ntohl(ext->length));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 1. If a NULL hdr is provided, compute the extension size;
|
|
|
|
* 2. If a non-NULL hdr is provided, write the hostname ping
|
|
|
|
* extension at the start of the cursor. This function
|
|
|
|
* will update the cursor to point to the end of the
|
|
|
|
* written extension and will return the amount of bytes
|
|
|
|
* written. */
|
|
|
|
uint32_t writePingExt(clusterMsg *hdr, int gossipcount) {
|
|
|
|
uint16_t extensions = 0;
|
|
|
|
uint32_t totlen = 0;
|
|
|
|
clusterMsgPingExt *cursor = NULL;
|
|
|
|
/* Set the initial extension position */
|
|
|
|
if (hdr != NULL) {
|
|
|
|
cursor = getInitialPingExt(hdr, gossipcount);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* hostname is optional */
|
|
|
|
if (sdslen(myself->hostname) != 0) {
|
|
|
|
if (cursor != NULL) {
|
|
|
|
/* Populate hostname */
|
|
|
|
clusterMsgPingExtHostname *ext = preparePingExt(cursor, CLUSTERMSG_EXT_TYPE_HOSTNAME, getHostnamePingExtSize());
|
|
|
|
memcpy(ext->hostname, myself->hostname, sdslen(myself->hostname));
|
|
|
|
|
|
|
|
/* Move the write cursor */
|
|
|
|
cursor = nextPingExt(cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
totlen += getHostnamePingExtSize();
|
|
|
|
extensions++;
|
|
|
|
}
|
|
|
|
|
2023-06-18 12:16:51 +08:00
|
|
|
if (sdslen(myself->human_nodename) != 0) {
|
|
|
|
if (cursor != NULL) {
|
|
|
|
/* Populate human_nodename */
|
|
|
|
clusterMsgPingExtHumanNodename *ext = preparePingExt(cursor, CLUSTERMSG_EXT_TYPE_HUMAN_NODENAME, getHumanNodenamePingExtSize());
|
|
|
|
memcpy(ext->human_nodename, myself->human_nodename, sdslen(myself->human_nodename));
|
|
|
|
|
2023-10-02 16:44:09 -07:00
|
|
|
/* Move the write cursor */
|
2023-06-18 12:16:51 +08:00
|
|
|
cursor = nextPingExt(cursor);
|
|
|
|
}
|
|
|
|
|
|
|
|
totlen += getHumanNodenamePingExtSize();
|
|
|
|
extensions++;
|
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
/* Gossip forgotten nodes */
|
|
|
|
if (dictSize(server.cluster->nodes_black_list) > 0) {
|
|
|
|
dictIterator *di = dictGetIterator(server.cluster->nodes_black_list);
|
|
|
|
dictEntry *de;
|
|
|
|
while ((de = dictNext(di)) != NULL) {
|
|
|
|
if (cursor != NULL) {
|
|
|
|
uint64_t expire = dictGetUnsignedIntegerVal(de);
|
|
|
|
if ((time_t)expire < server.unixtime) continue; /* already expired */
|
|
|
|
uint64_t ttl = expire - server.unixtime;
|
|
|
|
clusterMsgPingExtForgottenNode *ext = preparePingExt(cursor, CLUSTERMSG_EXT_TYPE_FORGOTTEN_NODE, getForgottenNodeExtSize());
|
|
|
|
memcpy(ext->name, dictGetKey(de), CLUSTER_NAMELEN);
|
|
|
|
ext->ttl = htonu64(ttl);
|
|
|
|
|
|
|
|
/* Move the write cursor */
|
|
|
|
cursor = nextPingExt(cursor);
|
|
|
|
}
|
|
|
|
totlen += getForgottenNodeExtSize();
|
|
|
|
extensions++;
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Populate shard_id */
|
|
|
|
if (cursor != NULL) {
|
|
|
|
clusterMsgPingExtShardId *ext = preparePingExt(cursor, CLUSTERMSG_EXT_TYPE_SHARDID, getShardIdPingExtSize());
|
|
|
|
memcpy(ext->shard_id, myself->shard_id, CLUSTER_NAMELEN);
|
|
|
|
|
|
|
|
/* Move the write cursor */
|
|
|
|
cursor = nextPingExt(cursor);
|
|
|
|
}
|
|
|
|
totlen += getShardIdPingExtSize();
|
|
|
|
extensions++;
|
|
|
|
|
|
|
|
if (hdr != NULL) {
|
|
|
|
if (extensions != 0) {
|
|
|
|
hdr->mflags[0] |= CLUSTERMSG_FLAG0_EXT_DATA;
|
|
|
|
}
|
|
|
|
hdr->extensions = htons(extensions);
|
|
|
|
}
|
|
|
|
|
|
|
|
return totlen;
|
2022-07-26 09:28:13 +02:00
|
|
|
}
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* We previously validated the extensions, so this function just needs to
|
|
|
|
* handle the extensions. */
|
|
|
|
void clusterProcessPingExtensions(clusterMsg *hdr, clusterLink *link) {
|
2022-04-05 13:51:51 +08:00
|
|
|
clusterNode *sender = link->node ? link->node : clusterLookupNode(hdr->sender, CLUSTER_NAMELEN);
|
2022-01-02 19:48:29 -08:00
|
|
|
char *ext_hostname = NULL;
|
2023-06-18 12:16:51 +08:00
|
|
|
char *ext_humannodename = NULL;
|
2022-11-16 19:24:18 -08:00
|
|
|
char *ext_shardid = NULL;
|
2022-01-02 19:48:29 -08:00
|
|
|
uint16_t extensions = ntohs(hdr->extensions);
|
|
|
|
/* Loop through all the extensions and process them */
|
|
|
|
clusterMsgPingExt *ext = getInitialPingExt(hdr, ntohs(hdr->count));
|
|
|
|
while (extensions--) {
|
|
|
|
uint16_t type = ntohs(ext->type);
|
|
|
|
if (type == CLUSTERMSG_EXT_TYPE_HOSTNAME) {
|
|
|
|
clusterMsgPingExtHostname *hostname_ext = (clusterMsgPingExtHostname *) &(ext->ext[0].hostname);
|
|
|
|
ext_hostname = hostname_ext->hostname;
|
2023-10-02 16:44:09 -07:00
|
|
|
} else if (type == CLUSTERMSG_EXT_TYPE_HUMAN_NODENAME) {
|
2023-06-18 12:16:51 +08:00
|
|
|
clusterMsgPingExtHumanNodename *humannodename_ext = (clusterMsgPingExtHumanNodename *) &(ext->ext[0].human_nodename);
|
|
|
|
ext_humannodename = humannodename_ext->human_nodename;
|
2022-07-26 09:28:13 +02:00
|
|
|
} else if (type == CLUSTERMSG_EXT_TYPE_FORGOTTEN_NODE) {
|
|
|
|
clusterMsgPingExtForgottenNode *forgotten_node_ext = &(ext->ext[0].forgotten_node);
|
|
|
|
clusterNode *n = clusterLookupNode(forgotten_node_ext->name, CLUSTER_NAMELEN);
|
|
|
|
if (n && n != myself && !(nodeIsSlave(myself) && myself->slaveof == n)) {
|
|
|
|
sds id = sdsnewlen(forgotten_node_ext->name, CLUSTER_NAMELEN);
|
2023-10-31 15:20:06 +01:00
|
|
|
dictEntry *de = dictAddOrFind(server.cluster->nodes_black_list, id);
|
2022-07-26 09:28:13 +02:00
|
|
|
uint64_t expire = server.unixtime + ntohu64(forgotten_node_ext->ttl);
|
|
|
|
dictSetUnsignedIntegerVal(de, expire);
|
|
|
|
clusterDelNode(n);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
}
|
2022-11-16 19:24:18 -08:00
|
|
|
} else if (type == CLUSTERMSG_EXT_TYPE_SHARDID) {
|
|
|
|
clusterMsgPingExtShardId *shardid_ext = (clusterMsgPingExtShardId *) &(ext->ext[0].shard_id);
|
|
|
|
ext_shardid = shardid_ext->shard_id;
|
2022-01-02 19:48:29 -08:00
|
|
|
} else {
|
|
|
|
/* Unknown type, we will ignore it but log what happened. */
|
|
|
|
serverLog(LL_WARNING, "Received unknown extension type %d", type);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We know this will be valid since we validated it ahead of time */
|
|
|
|
ext = getNextPingExt(ext);
|
|
|
|
}
|
|
|
|
/* If the node did not send us a hostname extension, assume
|
|
|
|
* they don't have an announced hostname. Otherwise, we'll
|
|
|
|
* set it now. */
|
|
|
|
updateAnnouncedHostname(sender, ext_hostname);
|
2023-06-18 12:16:51 +08:00
|
|
|
updateAnnouncedHumanNodename(sender, ext_humannodename);
|
2022-11-16 19:24:18 -08:00
|
|
|
updateShardId(sender, ext_shardid);
|
2022-01-02 19:48:29 -08:00
|
|
|
}
|
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
static clusterNode *getNodeFromLinkAndMsg(clusterLink *link, clusterMsg *hdr) {
|
|
|
|
clusterNode *sender;
|
|
|
|
if (link->node && !nodeInHandshake(link->node)) {
|
|
|
|
/* If the link has an associated node, use that so that we don't have to look it
|
|
|
|
* up every time, except when the node is still in handshake, the node still has
|
|
|
|
* a random name thus not truly "known". */
|
|
|
|
sender = link->node;
|
|
|
|
} else {
|
|
|
|
/* Otherwise, fetch sender based on the message */
|
2022-04-05 13:51:51 +08:00
|
|
|
sender = clusterLookupNode(hdr->sender, CLUSTER_NAMELEN);
|
2021-12-16 21:56:59 -08:00
|
|
|
/* We know the sender node but haven't associate it with the link. This must
|
|
|
|
* be an inbound link because only for inbound links we didn't know which node
|
|
|
|
* to associate when they were created. */
|
|
|
|
if (sender && !link->node) {
|
|
|
|
setClusterNodeToInboundClusterLink(sender, link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sender;
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* When this function is called, there is a packet to process starting
|
2021-04-25 20:50:15 +08:00
|
|
|
* at link->rcvbuf. Releasing the buffer is up to the caller, so this
|
2011-03-29 17:51:15 +02:00
|
|
|
* function should just handle the higher level stuff of processing the
|
|
|
|
* packet, modifying the cluster state if needed.
|
|
|
|
*
|
|
|
|
* The function returns 1 if the link is still valid after the packet
|
|
|
|
* was processed, otherwise 0 if the link was freed since the packet
|
|
|
|
* processing lead to some inconsistency error (for instance a PONG
|
|
|
|
* received from the wrong sender ID). */
|
|
|
|
int clusterProcessPacket(clusterLink *link) {
|
|
|
|
clusterMsg *hdr = (clusterMsg*) link->rcvbuf;
|
|
|
|
uint32_t totlen = ntohl(hdr->totlen);
|
|
|
|
uint16_t type = ntohs(hdr->type);
|
2020-05-08 11:38:07 +02:00
|
|
|
mstime_t now = mstime();
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2017-04-13 19:22:35 +02:00
|
|
|
if (type < CLUSTERMSG_TYPE_COUNT)
|
|
|
|
server.cluster->stats_bus_messages_received[type]++;
|
2021-08-12 14:50:09 -07:00
|
|
|
serverLog(LL_DEBUG,"--- Processing packet of type %s, %lu bytes",
|
|
|
|
clusterGetMessageTypeString(type), (unsigned long) totlen);
|
2011-10-07 16:34:16 +02:00
|
|
|
|
|
|
|
/* Perform sanity checks */
|
2014-02-10 15:54:19 +01:00
|
|
|
if (totlen < 16) return 1; /* At least signature, version, totlen, count. */
|
2020-10-27 16:36:00 +02:00
|
|
|
if (totlen > link->rcvbuf_len) return 1;
|
2016-01-19 13:16:24 +01:00
|
|
|
|
|
|
|
if (ntohs(hdr->ver) != CLUSTER_PROTO_VER) {
|
|
|
|
/* Can't handle messages of different versions. */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
if (type == server.cluster_drop_packet_filter) {
|
|
|
|
serverLog(LL_WARNING, "Dropping packet that matches debug drop filter");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2016-01-19 13:16:24 +01:00
|
|
|
uint16_t flags = ntohs(hdr->flags);
|
2022-01-02 19:48:29 -08:00
|
|
|
uint16_t extensions = ntohs(hdr->extensions);
|
2016-01-19 13:16:24 +01:00
|
|
|
uint64_t senderCurrentEpoch = 0, senderConfigEpoch = 0;
|
2022-01-02 19:48:29 -08:00
|
|
|
uint32_t explen; /* expected length of this packet */
|
2016-01-19 13:16:24 +01:00
|
|
|
clusterNode *sender;
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
|
|
|
type == CLUSTERMSG_TYPE_MEET)
|
|
|
|
{
|
|
|
|
uint16_t count = ntohs(hdr->count);
|
|
|
|
|
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
explen += (sizeof(clusterMsgDataGossip)*count);
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* If there is extension data, which doesn't have a fixed length,
|
|
|
|
* loop through them and validate the length of it now. */
|
|
|
|
if (hdr->mflags[0] & CLUSTERMSG_FLAG0_EXT_DATA) {
|
|
|
|
clusterMsgPingExt *ext = getInitialPingExt(hdr, count);
|
|
|
|
while (extensions--) {
|
|
|
|
uint16_t extlen = getPingExtLength(ext);
|
|
|
|
if (extlen % 8 != 0) {
|
2022-11-16 19:24:18 -08:00
|
|
|
serverLog(LL_WARNING, "Received a %s packet without proper padding (%d bytes)",
|
2022-01-02 19:48:29 -08:00
|
|
|
clusterGetMessageTypeString(type), (int) extlen);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if ((totlen - explen) < extlen) {
|
|
|
|
serverLog(LL_WARNING, "Received invalid %s packet with extension data that exceeds "
|
|
|
|
"total packet length (%lld)", clusterGetMessageTypeString(type),
|
|
|
|
(unsigned long long) totlen);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
explen += extlen;
|
|
|
|
ext = getNextPingExt(ext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (type == CLUSTERMSG_TYPE_FAIL) {
|
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2011-03-29 17:51:15 +02:00
|
|
|
explen += sizeof(clusterMsgDataFail);
|
2022-01-03 01:54:47 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_PUBLISH || type == CLUSTERMSG_TYPE_PUBLISHSHARD) {
|
2022-01-02 19:48:29 -08:00
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2014-11-28 10:03:07 +01:00
|
|
|
explen += sizeof(clusterMsgDataPublish) -
|
|
|
|
8 +
|
2011-10-07 16:34:16 +02:00
|
|
|
ntohl(hdr->data.publish.msg.channel_len) +
|
|
|
|
ntohl(hdr->data.publish.msg.message_len);
|
2013-03-14 16:42:56 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST ||
|
2014-02-05 13:01:24 +01:00
|
|
|
type == CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK ||
|
|
|
|
type == CLUSTERMSG_TYPE_MFSTART)
|
|
|
|
{
|
2022-01-02 19:48:29 -08:00
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2013-11-08 17:02:10 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_UPDATE) {
|
2022-01-02 19:48:29 -08:00
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2013-11-08 17:02:10 +01:00
|
|
|
explen += sizeof(clusterMsgDataUpdate);
|
2018-03-29 15:13:31 +02:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_MODULE) {
|
2022-01-02 19:48:29 -08:00
|
|
|
explen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2020-08-19 19:13:32 -07:00
|
|
|
explen += sizeof(clusterMsgModule) -
|
2018-03-29 15:13:31 +02:00
|
|
|
3 + ntohl(hdr->data.module.msg.len);
|
2022-01-02 19:48:29 -08:00
|
|
|
} else {
|
|
|
|
/* We don't know this type of packet, so we assume it's well formed. */
|
|
|
|
explen = totlen;
|
2011-10-07 16:34:16 +02:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
if (totlen != explen) {
|
2022-11-16 19:24:18 -08:00
|
|
|
serverLog(LL_WARNING, "Received invalid %s packet of length %lld but expected length %lld",
|
2022-01-02 19:48:29 -08:00
|
|
|
clusterGetMessageTypeString(type), (unsigned long long) totlen, (unsigned long long) explen);
|
|
|
|
return 1;
|
2022-11-16 19:24:18 -08:00
|
|
|
}
|
2022-01-02 19:48:29 -08:00
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
sender = getNodeFromLinkAndMsg(link, hdr);
|
2020-05-08 11:38:07 +02:00
|
|
|
|
|
|
|
/* Update the last time we saw any data from this node. We
|
|
|
|
* use this in order to avoid detecting a timeout from a node that
|
|
|
|
* is just sending a lot of data in the cluster bus, for instance
|
|
|
|
* because of Pub/Sub. */
|
|
|
|
if (sender) sender->data_received = now;
|
|
|
|
|
2014-01-29 12:17:16 +01:00
|
|
|
if (sender && !nodeInHandshake(sender)) {
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
/* Update our currentEpoch if we see a newer epoch in the cluster. */
|
2013-09-25 12:36:29 +02:00
|
|
|
senderCurrentEpoch = ntohu64(hdr->currentEpoch);
|
|
|
|
senderConfigEpoch = ntohu64(hdr->configEpoch);
|
|
|
|
if (senderCurrentEpoch > server.cluster->currentEpoch)
|
|
|
|
server.cluster->currentEpoch = senderCurrentEpoch;
|
2013-09-27 09:55:41 +02:00
|
|
|
/* Update the sender configEpoch if it is publishing a newer one. */
|
2013-09-30 10:13:33 +02:00
|
|
|
if (senderConfigEpoch > sender->configEpoch) {
|
2013-09-27 09:55:41 +02:00
|
|
|
sender->configEpoch = senderConfigEpoch;
|
2014-03-25 16:07:14 +01:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2013-09-30 10:13:33 +02:00
|
|
|
}
|
2014-01-29 16:01:00 +01:00
|
|
|
/* Update the replication offset info for this node. */
|
|
|
|
sender->repl_offset = ntohu64(hdr->offset);
|
2020-05-08 11:38:07 +02:00
|
|
|
sender->repl_offset_time = now;
|
2014-02-05 13:01:24 +01:00
|
|
|
/* If we are a slave performing a manual failover and our master
|
|
|
|
* sent its offset while already paused, populate the MF state. */
|
|
|
|
if (server.cluster->mf_end &&
|
|
|
|
nodeIsSlave(myself) &&
|
|
|
|
myself->slaveof == sender &&
|
|
|
|
hdr->mflags[0] & CLUSTERMSG_FLAG0_PAUSED &&
|
2021-03-23 11:00:33 +08:00
|
|
|
server.cluster->mf_master_offset == -1)
|
2014-02-05 13:01:24 +01:00
|
|
|
{
|
|
|
|
server.cluster->mf_master_offset = sender->repl_offset;
|
2020-10-27 14:13:59 +08:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_MANUALFAILOVER);
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-03-25 16:07:14 +01:00
|
|
|
"Received replication offset for paused "
|
|
|
|
"master manual failover: %lld",
|
|
|
|
server.cluster->mf_master_offset);
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
2013-09-25 12:36:29 +02:00
|
|
|
}
|
2013-04-11 18:19:48 +02:00
|
|
|
|
2014-10-08 16:58:12 +02:00
|
|
|
/* Initial processing of PING and MEET requests replying with a PONG. */
|
2011-03-29 17:51:15 +02:00
|
|
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_MEET) {
|
2014-06-25 11:28:57 +02:00
|
|
|
/* We use incoming MEET messages in order to set the address
|
|
|
|
* for 'myself', since only other cluster nodes will send us
|
2016-01-22 13:26:43 +01:00
|
|
|
* MEET messages on handshakes, when the cluster joins, or
|
2014-06-25 11:28:57 +02:00
|
|
|
* later if we changed address, and those nodes will use our
|
|
|
|
* official address to connect to us. So by obtaining this address
|
|
|
|
* from the socket is a simple way to discover / update our own
|
2015-01-13 10:48:49 +01:00
|
|
|
* address in the cluster without it being hardcoded in the config.
|
|
|
|
*
|
|
|
|
* However if we don't have an address at all, we update the address
|
|
|
|
* even with a normal PING packet. If it's wrong it will be fixed
|
|
|
|
* by MEET later. */
|
2016-01-22 13:26:43 +01:00
|
|
|
if ((type == CLUSTERMSG_TYPE_MEET || myself->ip[0] == '\0') &&
|
|
|
|
server.cluster_announce_ip == NULL)
|
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
char ip[NET_IP_STR_LEN];
|
2014-06-25 11:28:57 +02:00
|
|
|
|
Introduce connAddr
Originally, connPeerToString is designed to get the address info from
socket only(for both TCP & TLS), and the API 'connPeerToString' is
oriented to operate a FD like:
int connPeerToString(connection *conn, char *ip, size_t ip_len, int *port) {
return anetFdToString(conn ? conn->fd : -1, ip, ip_len, port, FD_TO_PEER_NAME);
}
Introduce connAddr and implement .addr method for socket and TLS,
thus the API 'connAddr' and 'connFormatAddr' become oriented to a
connection like:
static inline int connAddr(connection *conn, char *ip, size_t ip_len, int *port, int remote) {
if (conn && conn->type->addr) {
return conn->type->addr(conn, ip, ip_len, port, remote);
}
return -1;
}
Also remove 'FD_TO_PEER_NAME' & 'FD_TO_SOCK_NAME', use a boolean type
'remote' to get local/remote address of a connection.
With these changes, it's possible to support the other connection
types which does not use socket(Ex, RDMA).
Thanks to Oran for suggestions!
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-07-27 10:08:32 +08:00
|
|
|
if (connAddrSockName(link->conn,ip,sizeof(ip),NULL) != -1 &&
|
2014-06-25 11:28:57 +02:00
|
|
|
strcmp(ip,myself->ip))
|
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
memcpy(myself->ip,ip,NET_IP_STR_LEN);
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,"IP address for this node updated to %s",
|
2015-01-13 10:48:49 +01:00
|
|
|
myself->ip);
|
2014-06-25 11:28:57 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Add this node if it is new for us and the msg type is MEET.
|
|
|
|
* In this stage we don't try to add the node with the right
|
|
|
|
* flags, slaveof pointer, and so forth, as this details will be
|
2013-06-11 21:33:00 +02:00
|
|
|
* resolved when we'll receive PONGs from the node. */
|
2011-03-29 17:51:15 +02:00
|
|
|
if (!sender && type == CLUSTERMSG_TYPE_MEET) {
|
|
|
|
clusterNode *node;
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
node = createClusterNode(NULL,CLUSTER_NODE_HANDSHAKE);
|
2022-07-21 07:59:27 +08:00
|
|
|
serverAssert(nodeIp2String(node->ip,link,hdr->myip) == C_OK);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
getClientPortFromClusterMsg(hdr, &node->tls_port, &node->tcp_port);
|
2016-01-21 16:57:35 +01:00
|
|
|
node->cport = ntohs(hdr->cport);
|
2011-03-29 17:51:15 +02:00
|
|
|
clusterAddNode(node);
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2014-10-08 16:58:12 +02:00
|
|
|
/* If this is a MEET packet from an unknown node, we still process
|
|
|
|
* the gossip section here since we have to trust the sender because
|
|
|
|
* of the message type. */
|
|
|
|
if (!sender && type == CLUSTERMSG_TYPE_MEET)
|
|
|
|
clusterProcessGossipSection(hdr,link);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
/* Anyway reply with a PONG */
|
|
|
|
clusterSendPing(link,CLUSTERMSG_TYPE_PONG);
|
2013-04-11 18:19:48 +02:00
|
|
|
}
|
|
|
|
|
2014-10-08 16:58:12 +02:00
|
|
|
/* PING, PONG, MEET: process config information. */
|
2013-08-22 11:53:28 +02:00
|
|
|
if (type == CLUSTERMSG_TYPE_PING || type == CLUSTERMSG_TYPE_PONG ||
|
|
|
|
type == CLUSTERMSG_TYPE_MEET)
|
|
|
|
{
|
2022-03-03 14:41:31 +08:00
|
|
|
serverLog(LL_DEBUG,"%s packet received: %.40s",
|
2021-04-26 10:58:54 +08:00
|
|
|
clusterGetMessageTypeString(type),
|
|
|
|
link->node ? link->node->name : "NULL");
|
2021-12-16 21:56:59 -08:00
|
|
|
if (!link->inbound) {
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeInHandshake(link->node)) {
|
2011-03-29 17:51:15 +02:00
|
|
|
/* If we already have this node, try to change the
|
|
|
|
* IP/port of the node with the new one. */
|
|
|
|
if (sender) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Handshake: we already know node %.40s (%s), "
|
|
|
|
"updating the address if needed.", sender->name, sender->human_nodename);
|
2016-01-21 16:57:35 +01:00
|
|
|
if (nodeUpdateAddressIfNeeded(sender,link,hdr))
|
2013-06-12 10:50:07 -07:00
|
|
|
{
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
2013-06-12 10:50:07 -07:00
|
|
|
}
|
2014-07-31 14:51:05 -04:00
|
|
|
/* Free this node as we already have it. This will
|
2013-06-12 10:50:07 -07:00
|
|
|
* cause the link to be freed as well. */
|
2015-01-21 16:03:43 +01:00
|
|
|
clusterDelNode(link->node);
|
2011-03-29 17:51:15 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* First thing to do is replacing the random name with the
|
2013-12-05 16:35:32 +01:00
|
|
|
* right node name if this was a handshake stage. */
|
2011-03-29 17:51:15 +02:00
|
|
|
clusterRenameNode(link->node, hdr->sender);
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_DEBUG,"Handshake with node %.40s completed.",
|
2011-03-29 17:51:15 +02:00
|
|
|
link->node->name);
|
2015-07-27 14:55:45 +02:00
|
|
|
link->node->flags &= ~CLUSTER_NODE_HANDSHAKE;
|
|
|
|
link->node->flags |= flags&(CLUSTER_NODE_MASTER|CLUSTER_NODE_SLAVE);
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
2011-03-29 17:51:15 +02:00
|
|
|
} else if (memcmp(link->node->name,hdr->sender,
|
2015-07-27 14:55:45 +02:00
|
|
|
CLUSTER_NAMELEN) != 0)
|
2011-03-29 17:51:15 +02:00
|
|
|
{
|
|
|
|
/* If the reply has a non matching node ID we
|
|
|
|
* disconnect this node and set it as not having an associated
|
|
|
|
* address. */
|
2016-01-26 14:21:18 +01:00
|
|
|
serverLog(LL_DEBUG,"PONG contains mismatching sender ID. About node %.40s added %d ms ago, having flags %d",
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
link->node->name,
|
2020-05-08 11:38:07 +02:00
|
|
|
(int)(now-(link->node->ctime)),
|
Better address udpate strategy when processing gossip sections.
The change covers the case where:
1. There is a node we can't reach (in fail or pfail state).
2. We see a different address for this node, in the gossip section sent
to us by a node that, instead, is able to talk with the node we cannot
talk to.
In this case it's a good bet to switch to the address reported by this
node, since there was an address switch and it is able to talk with the
node and we are not.
However previosuly this was done in a dangerous way, by initiating an
handshake. The handshake, using the MEET packet, forces the receiver to
join our cluster, and this is not a good idea. If the node in question
really just switched address, but is the same node, it already knows about
us, so we just need to perform an address update and a reconnection.
So with this commit instead we just update the address of the node,
release the node link if any, and attempt to reconnect in the next
clusterCron() cycle.
The commit also improves debugging messages printed by Cluster during
address or ID switches.
2016-01-26 12:32:53 +01:00
|
|
|
link->node->flags);
|
2015-07-27 14:55:45 +02:00
|
|
|
link->node->flags |= CLUSTER_NODE_NOADDR;
|
2013-02-27 17:09:33 +01:00
|
|
|
link->node->ip[0] = '\0';
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
link->node->tcp_port = 0;
|
|
|
|
link->node->tls_port = 0;
|
2016-01-21 16:57:35 +01:00
|
|
|
link->node->cport = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
freeClusterLink(link);
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
2011-03-29 17:51:15 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2013-03-13 18:38:08 +01:00
|
|
|
|
2018-03-14 13:46:36 +01:00
|
|
|
/* Copy the CLUSTER_NODE_NOFAILOVER flag from what the sender
|
|
|
|
* announced. This is a dynamic flag that we receive from the
|
|
|
|
* sender, and the latest status must be trusted. We need it to
|
|
|
|
* be propagated because the slave ranking used to understand the
|
|
|
|
* delay of each slave in the voting process, needs to know
|
|
|
|
* what are the instances really competing. */
|
|
|
|
if (sender) {
|
|
|
|
int nofailover = flags & CLUSTER_NODE_NOFAILOVER;
|
|
|
|
sender->flags &= ~CLUSTER_NODE_NOFAILOVER;
|
|
|
|
sender->flags |= nofailover;
|
|
|
|
}
|
|
|
|
|
2013-06-12 10:50:07 -07:00
|
|
|
/* Update the node address if it changed. */
|
|
|
|
if (sender && type == CLUSTERMSG_TYPE_PING &&
|
2014-01-29 12:17:16 +01:00
|
|
|
!nodeInHandshake(sender) &&
|
2016-01-21 16:57:35 +01:00
|
|
|
nodeUpdateAddressIfNeeded(sender,link,hdr))
|
2013-06-12 10:50:07 -07:00
|
|
|
{
|
2014-03-25 16:07:14 +01:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
2013-06-12 10:50:07 -07:00
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Update our info about the node */
|
2021-12-16 21:56:59 -08:00
|
|
|
if (!link->inbound && type == CLUSTERMSG_TYPE_PONG) {
|
2020-05-08 11:38:07 +02:00
|
|
|
link->node->pong_received = now;
|
2013-04-11 18:55:58 +02:00
|
|
|
link->node->ping_sent = 0;
|
|
|
|
|
|
|
|
/* The PFAIL condition can be reversed without external
|
2013-06-11 21:33:00 +02:00
|
|
|
* help if it is momentary (that is, if it does not
|
2013-04-11 18:55:58 +02:00
|
|
|
* turn into a FAIL state).
|
|
|
|
*
|
|
|
|
* The FAIL condition is also reversible under specific
|
|
|
|
* conditions detected by clearNodeFailureIfNeeded(). */
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeTimedOut(link->node)) {
|
2015-07-27 14:55:45 +02:00
|
|
|
link->node->flags &= ~CLUSTER_NODE_PFAIL;
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
2014-01-29 12:17:16 +01:00
|
|
|
} else if (nodeFailed(link->node)) {
|
2013-04-11 18:55:58 +02:00
|
|
|
clearNodeFailureIfNeeded(link->node);
|
|
|
|
}
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-11-08 10:32:16 +01:00
|
|
|
/* Check for role switch: slave -> master or master -> slave. */
|
2011-03-29 17:51:15 +02:00
|
|
|
if (sender) {
|
2015-07-27 14:55:45 +02:00
|
|
|
if (!memcmp(hdr->slaveof,CLUSTER_NODE_NULL_NAME,
|
2011-03-29 17:51:15 +02:00
|
|
|
sizeof(hdr->slaveof)))
|
|
|
|
{
|
2013-03-15 16:35:16 +01:00
|
|
|
/* Node is a master. */
|
2013-11-08 17:02:10 +01:00
|
|
|
clusterSetNodeAsMaster(sender);
|
2011-03-29 17:51:15 +02:00
|
|
|
} else {
|
2013-03-15 16:35:16 +01:00
|
|
|
/* Node is a slave. */
|
2022-04-05 13:51:51 +08:00
|
|
|
clusterNode *master = clusterLookupNode(hdr->slaveof, CLUSTER_NAMELEN);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(sender)) {
|
2013-03-20 00:30:47 +01:00
|
|
|
/* Master turned into a slave! Reconfigure the node. */
|
2013-03-15 16:35:16 +01:00
|
|
|
clusterDelNodeSlots(sender);
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
sender->flags &= ~(CLUSTER_NODE_MASTER|
|
|
|
|
CLUSTER_NODE_MIGRATE_TO);
|
2015-07-27 14:55:45 +02:00
|
|
|
sender->flags |= CLUSTER_NODE_SLAVE;
|
2013-03-20 00:30:47 +01:00
|
|
|
|
|
|
|
/* Update config and state. */
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
2013-03-15 16:35:16 +01:00
|
|
|
}
|
|
|
|
|
2013-03-19 16:01:30 +01:00
|
|
|
/* Master node changed for this slave? */
|
2014-02-10 18:33:34 +01:00
|
|
|
if (master && sender->slaveof != master) {
|
2013-03-25 15:01:25 +01:00
|
|
|
if (sender->slaveof)
|
|
|
|
clusterNodeRemoveSlave(sender->slaveof,sender);
|
2013-03-05 11:50:11 +01:00
|
|
|
clusterNodeAddSlave(master,sender);
|
|
|
|
sender->slaveof = master;
|
2013-10-02 12:27:12 +02:00
|
|
|
|
|
|
|
/* Update config. */
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG);
|
2013-03-05 11:50:11 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-15 16:15:40 +01:00
|
|
|
/* Update our info about served slots.
|
2013-11-08 10:32:16 +01:00
|
|
|
*
|
2013-03-15 16:15:40 +01:00
|
|
|
* Note: this MUST happen after we update the master/slave state
|
2015-07-27 14:55:45 +02:00
|
|
|
* so that CLUSTER_NODE_MASTER flag will be set. */
|
2013-11-08 10:32:16 +01:00
|
|
|
|
|
|
|
/* Many checks are only needed if the set of served slots this
|
2013-12-25 17:57:36 +01:00
|
|
|
* instance claims is different compared to the set of slots we have
|
|
|
|
* for it. Check this ASAP to avoid other computational expansive
|
|
|
|
* checks later. */
|
|
|
|
clusterNode *sender_master = NULL; /* Sender or its master if slave. */
|
2013-11-08 10:32:16 +01:00
|
|
|
int dirty_slots = 0; /* Sender claimed slots don't match my view? */
|
|
|
|
|
|
|
|
if (sender) {
|
2023-11-09 11:04:47 +02:00
|
|
|
sender_master = clusterNodeIsMaster(sender) ? sender : sender->slaveof;
|
2013-11-08 10:32:16 +01:00
|
|
|
if (sender_master) {
|
|
|
|
dirty_slots = memcmp(sender_master->slots,
|
|
|
|
hdr->myslots,sizeof(hdr->myslots)) != 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-25 17:57:36 +01:00
|
|
|
/* 1) If the sender of the message is a master, and we detected that
|
|
|
|
* the set of slots it claims changed, scan the slots to see if we
|
|
|
|
* need to update our configuration. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (sender && clusterNodeIsMaster(sender) && dirty_slots)
|
2013-11-08 17:02:10 +01:00
|
|
|
clusterUpdateSlotsConfigWith(sender,senderConfigEpoch,hdr->myslots);
|
2013-11-08 10:32:16 +01:00
|
|
|
|
2013-12-25 17:57:36 +01:00
|
|
|
/* 2) We also check for the reverse condition, that is, the sender
|
|
|
|
* claims to serve slots we know are served by a master with a
|
|
|
|
* greater configEpoch. If this happens we inform the sender.
|
2013-11-08 10:32:16 +01:00
|
|
|
*
|
2013-12-25 17:57:36 +01:00
|
|
|
* This is useful because sometimes after a partition heals, a
|
|
|
|
* reappearing master may be the last one to claim a given set of
|
|
|
|
* hash slots, but with a configuration that other instances know to
|
|
|
|
* be deprecated. Example:
|
2013-11-08 10:32:16 +01:00
|
|
|
*
|
|
|
|
* A and B are master and slave for slots 1,2,3.
|
|
|
|
* A is partitioned away, B gets promoted.
|
|
|
|
* B is partitioned away, and A returns available.
|
|
|
|
*
|
|
|
|
* Usually B would PING A publishing its set of served slots and its
|
2013-12-25 17:57:36 +01:00
|
|
|
* configEpoch, but because of the partition B can't inform A of the
|
|
|
|
* new configuration, so other nodes that have an updated table must
|
|
|
|
* do it. In this way A will stop to act as a master (or can try to
|
|
|
|
* failover if there are the conditions to win the election). */
|
2013-11-08 10:32:16 +01:00
|
|
|
if (sender && dirty_slots) {
|
|
|
|
int j;
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2013-11-08 10:32:16 +01:00
|
|
|
if (bitmapTestBit(hdr->myslots,j)) {
|
|
|
|
if (server.cluster->slots[j] == sender ||
|
2023-07-05 17:46:23 -07:00
|
|
|
isSlotUnclaimed(j)) continue;
|
2013-11-08 10:32:16 +01:00
|
|
|
if (server.cluster->slots[j]->configEpoch >
|
|
|
|
senderConfigEpoch)
|
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_VERBOSE,
|
2013-11-08 16:26:50 +01:00
|
|
|
"Node %.40s has old slots configuration, sending "
|
2013-11-08 17:27:59 +01:00
|
|
|
"an UPDATE message about %.40s",
|
2013-11-08 16:26:50 +01:00
|
|
|
sender->name, server.cluster->slots[j]->name);
|
2014-03-25 16:07:14 +01:00
|
|
|
clusterSendUpdate(sender->link,
|
|
|
|
server.cluster->slots[j]);
|
2013-11-08 17:25:49 +01:00
|
|
|
|
|
|
|
/* TODO: instead of exiting the loop send every other
|
|
|
|
* UPDATE packet for other nodes that are the new owner
|
|
|
|
* of sender's slots. */
|
|
|
|
break;
|
2013-11-08 10:32:16 +01:00
|
|
|
}
|
2013-09-30 11:44:23 +02:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-25 16:45:37 +01:00
|
|
|
/* If our config epoch collides with the sender's try to fix
|
|
|
|
* the problem. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (sender && clusterNodeIsMaster(myself) && clusterNodeIsMaster(sender) &&
|
2014-03-25 16:45:37 +01:00
|
|
|
senderConfigEpoch == myself->configEpoch)
|
|
|
|
{
|
|
|
|
clusterHandleConfigEpochCollision(sender);
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Get info from the gossip section */
|
2022-01-02 19:48:29 -08:00
|
|
|
if (sender) {
|
|
|
|
clusterProcessGossipSection(hdr,link);
|
|
|
|
clusterProcessPingExtensions(hdr,link);
|
|
|
|
}
|
2013-10-02 09:42:35 +02:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_FAIL) {
|
2011-03-29 17:51:15 +02:00
|
|
|
clusterNode *failing;
|
|
|
|
|
2013-10-02 09:42:35 +02:00
|
|
|
if (sender) {
|
2022-04-05 13:51:51 +08:00
|
|
|
failing = clusterLookupNode(hdr->data.fail.about.nodename, CLUSTER_NAMELEN);
|
2013-12-25 17:57:36 +01:00
|
|
|
if (failing &&
|
2015-07-27 14:55:45 +02:00
|
|
|
!(failing->flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_MYSELF)))
|
2013-10-02 09:42:35 +02:00
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,
|
2023-06-18 12:16:51 +08:00
|
|
|
"FAIL message received from %.40s (%s) about %.40s (%s)",
|
|
|
|
hdr->sender, sender->human_nodename, hdr->data.fail.about.nodename, failing->human_nodename);
|
2015-07-27 14:55:45 +02:00
|
|
|
failing->flags |= CLUSTER_NODE_FAIL;
|
2020-05-08 11:38:07 +02:00
|
|
|
failing->fail_time = now;
|
2015-07-27 14:55:45 +02:00
|
|
|
failing->flags &= ~CLUSTER_NODE_PFAIL;
|
2014-03-25 16:07:14 +01:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE);
|
2013-10-02 09:42:35 +02:00
|
|
|
}
|
|
|
|
} else {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_NOTICE,
|
2014-07-31 14:51:05 -04:00
|
|
|
"Ignoring FAIL message from unknown node %.40s about %.40s",
|
2011-03-29 17:51:15 +02:00
|
|
|
hdr->sender, hdr->data.fail.about.nodename);
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_PUBLISH || type == CLUSTERMSG_TYPE_PUBLISHSHARD) {
|
2021-05-10 23:29:11 +08:00
|
|
|
if (!sender) return 1; /* We don't know that node. */
|
|
|
|
|
2011-10-07 16:34:16 +02:00
|
|
|
robj *channel, *message;
|
|
|
|
uint32_t channel_len, message_len;
|
|
|
|
|
2013-10-03 09:55:20 +02:00
|
|
|
/* Don't bother creating useless objects if there are no
|
|
|
|
* Pub/Sub subscribers. */
|
2022-01-03 01:54:47 +01:00
|
|
|
if ((type == CLUSTERMSG_TYPE_PUBLISH
|
|
|
|
&& serverPubsubSubscriptionCount() > 0)
|
|
|
|
|| (type == CLUSTERMSG_TYPE_PUBLISHSHARD
|
|
|
|
&& serverPubsubShardSubscriptionCount() > 0))
|
2013-12-25 17:57:36 +01:00
|
|
|
{
|
2011-10-07 16:34:16 +02:00
|
|
|
channel_len = ntohl(hdr->data.publish.msg.channel_len);
|
|
|
|
message_len = ntohl(hdr->data.publish.msg.message_len);
|
|
|
|
channel = createStringObject(
|
|
|
|
(char*)hdr->data.publish.msg.bulk_data,channel_len);
|
|
|
|
message = createStringObject(
|
2013-12-25 17:57:36 +01:00
|
|
|
(char*)hdr->data.publish.msg.bulk_data+channel_len,
|
|
|
|
message_len);
|
2022-04-17 14:43:22 +02:00
|
|
|
pubsubPublishMessage(channel, message, type == CLUSTERMSG_TYPE_PUBLISHSHARD);
|
2011-10-07 16:34:16 +02:00
|
|
|
decrRefCount(channel);
|
|
|
|
decrRefCount(message);
|
|
|
|
}
|
2013-03-14 21:21:58 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST) {
|
2013-06-12 10:50:07 -07:00
|
|
|
if (!sender) return 1; /* We don't know that node. */
|
2013-09-20 09:22:21 +02:00
|
|
|
clusterSendFailoverAuthIfNeeded(sender,hdr);
|
2013-03-14 21:21:58 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK) {
|
2013-06-12 10:50:07 -07:00
|
|
|
if (!sender) return 1; /* We don't know that node. */
|
2013-10-01 15:40:20 +02:00
|
|
|
/* We consider this vote only if the sender is a master serving
|
2013-10-01 17:21:28 +02:00
|
|
|
* a non zero number of slots, and its currentEpoch is greater or
|
|
|
|
* equal to epoch where this node started the election. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(sender) && sender->numslots > 0 &&
|
2013-10-01 17:21:28 +02:00
|
|
|
senderCurrentEpoch >= server.cluster->failover_auth_epoch)
|
2013-09-26 13:00:41 +02:00
|
|
|
{
|
2013-03-14 21:21:58 +01:00
|
|
|
server.cluster->failover_auth_count++;
|
2013-09-26 16:54:43 +02:00
|
|
|
/* Maybe we reached a quorum here, set a flag to make sure
|
|
|
|
* we check ASAP. */
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_FAILOVER);
|
2013-09-26 13:00:41 +02:00
|
|
|
}
|
2014-02-05 13:01:24 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_MFSTART) {
|
|
|
|
/* This message is acceptable only if I'm a master and the sender
|
|
|
|
* is one of my slaves. */
|
|
|
|
if (!sender || sender->slaveof != myself) return 1;
|
|
|
|
/* Manual failover requested from slaves. Initialize the state
|
|
|
|
* accordingly. */
|
|
|
|
resetManualFailover();
|
2020-05-08 11:38:07 +02:00
|
|
|
server.cluster->mf_end = now + CLUSTER_MF_TIMEOUT;
|
2014-02-05 13:01:24 +01:00
|
|
|
server.cluster->mf_slave = sender;
|
2022-10-27 11:57:04 +03:00
|
|
|
pauseActions(PAUSE_DURING_FAILOVER,
|
2022-01-02 08:50:15 +01:00
|
|
|
now + (CLUSTER_MF_TIMEOUT * CLUSTER_MF_PAUSE_MULT),
|
2022-10-27 11:57:04 +03:00
|
|
|
PAUSE_ACTIONS_CLIENT_WRITE_SET);
|
2023-06-18 12:16:51 +08:00
|
|
|
serverLog(LL_NOTICE,"Manual failover requested by replica %.40s (%s).",
|
|
|
|
sender->name, sender->human_nodename);
|
2020-10-27 14:13:59 +08:00
|
|
|
/* We need to send a ping message to the replica, as it would carry
|
|
|
|
* `server.cluster->mf_master_offset`, which means the master paused clients
|
|
|
|
* at offset `server.cluster->mf_master_offset`, so that the replica would
|
|
|
|
* know that it is safe to set its `server.cluster->mf_can_start` to 1 so as
|
|
|
|
* to complete failover as quickly as possible. */
|
|
|
|
clusterSendPing(link, CLUSTERMSG_TYPE_PING);
|
2013-11-08 17:02:10 +01:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_UPDATE) {
|
|
|
|
clusterNode *n; /* The node the update is about. */
|
2014-03-25 16:07:14 +01:00
|
|
|
uint64_t reportedConfigEpoch =
|
|
|
|
ntohu64(hdr->data.update.nodecfg.configEpoch);
|
2013-11-08 17:02:10 +01:00
|
|
|
|
|
|
|
if (!sender) return 1; /* We don't know the sender. */
|
2022-04-05 13:51:51 +08:00
|
|
|
n = clusterLookupNode(hdr->data.update.nodecfg.nodename, CLUSTER_NAMELEN);
|
2013-11-08 17:02:10 +01:00
|
|
|
if (!n) return 1; /* We don't know the reported node. */
|
|
|
|
if (n->configEpoch >= reportedConfigEpoch) return 1; /* Nothing new. */
|
|
|
|
|
|
|
|
/* If in our current config the node is a slave, set it as a master. */
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeIsSlave(n)) clusterSetNodeAsMaster(n);
|
2013-11-08 17:02:10 +01:00
|
|
|
|
2014-03-11 11:53:09 +01:00
|
|
|
/* Update the node's configEpoch. */
|
|
|
|
n->configEpoch = reportedConfigEpoch;
|
2014-03-25 16:07:14 +01:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2014-03-11 11:53:09 +01:00
|
|
|
|
2014-07-31 14:51:05 -04:00
|
|
|
/* Check the bitmap of served slots and update our
|
2013-12-25 17:57:36 +01:00
|
|
|
* config accordingly. */
|
2013-11-08 17:02:10 +01:00
|
|
|
clusterUpdateSlotsConfigWith(n,reportedConfigEpoch,
|
|
|
|
hdr->data.update.nodecfg.slots);
|
2018-03-29 15:13:31 +02:00
|
|
|
} else if (type == CLUSTERMSG_TYPE_MODULE) {
|
|
|
|
if (!sender) return 1; /* Protect the module from unknown nodes. */
|
|
|
|
/* We need to route this message back to the right module subscribed
|
|
|
|
* for the right message type. */
|
|
|
|
uint64_t module_id = hdr->data.module.msg.module_id; /* Endian-safe ID */
|
|
|
|
uint32_t len = ntohl(hdr->data.module.msg.len);
|
|
|
|
uint8_t type = hdr->data.module.msg.type;
|
|
|
|
unsigned char *payload = hdr->data.module.msg.bulk_data;
|
|
|
|
moduleCallClusterReceivers(sender->name,module_id,type,payload,len);
|
2011-03-29 17:51:15 +02:00
|
|
|
} else {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,"Received unknown packet type: %d", type);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called when we detect the link with this node is lost.
|
|
|
|
We set the node as no longer connected. The Cluster Cron will detect
|
|
|
|
this connection and will try to get it connected again.
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
Instead if the node is a temporary node used to accept a query, we
|
|
|
|
completely free the node on error. */
|
|
|
|
void handleLinkIOError(clusterLink *link) {
|
|
|
|
freeClusterLink(link);
|
|
|
|
}
|
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
/* Send the messages queued for the link. */
|
2019-09-12 10:56:54 +03:00
|
|
|
void clusterWriteHandler(connection *conn) {
|
|
|
|
clusterLink *link = connGetPrivateData(conn);
|
2011-03-29 17:51:15 +02:00
|
|
|
ssize_t nwritten;
|
2022-11-01 22:26:44 -04:00
|
|
|
size_t totwritten = 0;
|
|
|
|
|
|
|
|
while (totwritten < NET_MAX_WRITES_PER_EVENT && listLength(link->send_msg_queue) > 0) {
|
|
|
|
listNode *head = listFirst(link->send_msg_queue);
|
|
|
|
clusterMsgSendBlock *msgblock = (clusterMsgSendBlock*)head->value;
|
|
|
|
clusterMsg *msg = &msgblock->msg;
|
|
|
|
size_t msg_offset = link->head_msg_send_offset;
|
|
|
|
size_t msg_len = ntohl(msg->totlen);
|
|
|
|
|
|
|
|
nwritten = connWrite(conn, (char*)msg + msg_offset, msg_len - msg_offset);
|
|
|
|
if (nwritten <= 0) {
|
|
|
|
serverLog(LL_DEBUG,"I/O error writing to node link: %s",
|
|
|
|
(nwritten == -1) ? connGetLastError(conn) : "short write");
|
|
|
|
handleLinkIOError(link);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (msg_offset + nwritten < msg_len) {
|
|
|
|
/* If full message wasn't written, record the offset
|
|
|
|
* and continue sending from this point next time */
|
|
|
|
link->head_msg_send_offset += nwritten;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
serverAssert((msg_offset + nwritten) == msg_len);
|
|
|
|
link->head_msg_send_offset = 0;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
/* Delete the node and update our memory tracking */
|
|
|
|
uint32_t blocklen = msgblock->totlen;
|
|
|
|
listDelNode(link->send_msg_queue, head);
|
|
|
|
server.stat_cluster_links_memory -= sizeof(listNode);
|
|
|
|
link->send_msg_queue_mem -= sizeof(listNode) + blocklen;
|
|
|
|
|
|
|
|
totwritten += nwritten;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
if (listLength(link->send_msg_queue) == 0)
|
2019-09-12 10:56:54 +03:00
|
|
|
connSetWriteHandler(link->conn, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* A connect handler that gets called when a connection to another node
|
|
|
|
* gets established.
|
|
|
|
*/
|
|
|
|
void clusterLinkConnectHandler(connection *conn) {
|
|
|
|
clusterLink *link = connGetPrivateData(conn);
|
|
|
|
clusterNode *node = link->node;
|
|
|
|
|
|
|
|
/* Check if connection succeeded */
|
|
|
|
if (connGetState(conn) != CONN_STATE_CONNECTED) {
|
|
|
|
serverLog(LL_VERBOSE, "Connection with Node %.40s at %s:%d failed: %s",
|
|
|
|
node->name, node->ip, node->cport,
|
|
|
|
connGetLastError(conn));
|
|
|
|
freeClusterLink(link);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Register a read handler from now on */
|
|
|
|
connSetReadHandler(conn, clusterReadHandler);
|
|
|
|
|
|
|
|
/* Queue a PING in the new connection ASAP: this is crucial
|
|
|
|
* to avoid false positives in failure detection.
|
|
|
|
*
|
|
|
|
* If the node is flagged as MEET, we send a MEET message instead
|
|
|
|
* of a PING one, to force the receiver to add us in its node
|
|
|
|
* table. */
|
|
|
|
mstime_t old_ping_sent = node->ping_sent;
|
|
|
|
clusterSendPing(link, node->flags & CLUSTER_NODE_MEET ?
|
|
|
|
CLUSTERMSG_TYPE_MEET : CLUSTERMSG_TYPE_PING);
|
|
|
|
if (old_ping_sent) {
|
|
|
|
/* If there was an active ping before the link was
|
|
|
|
* disconnected, we want to restore the ping time, otherwise
|
|
|
|
* replaced by the clusterSendPing() call. */
|
|
|
|
node->ping_sent = old_ping_sent;
|
|
|
|
}
|
|
|
|
/* We can clear the flag after the first packet is sent.
|
|
|
|
* If we'll never receive a PONG, we'll never send new packets
|
|
|
|
* to this node. Instead after the PONG is received and we
|
|
|
|
* are no longer in meet/handshake status, we want to send
|
|
|
|
* normal PING packets. */
|
|
|
|
node->flags &= ~CLUSTER_NODE_MEET;
|
|
|
|
|
|
|
|
serverLog(LL_DEBUG,"Connecting with Node %.40s at %s:%d",
|
|
|
|
node->name, node->ip, node->cport);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Read data. Try to read the first field of the header first to check the
|
|
|
|
* full length of the packet. When a whole packet is in memory this function
|
|
|
|
* will call the function to process the packet. And so forth. */
|
2019-09-12 10:56:54 +03:00
|
|
|
void clusterReadHandler(connection *conn) {
|
2019-10-06 13:55:21 +03:00
|
|
|
clusterMsg buf[1];
|
2011-03-29 17:51:15 +02:00
|
|
|
ssize_t nread;
|
|
|
|
clusterMsg *hdr;
|
2019-09-12 10:56:54 +03:00
|
|
|
clusterLink *link = connGetPrivateData(conn);
|
2014-08-13 11:44:38 +02:00
|
|
|
unsigned int readlen, rcvbuflen;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-09-03 11:43:07 +02:00
|
|
|
while(1) { /* Read as long as there is data to read. */
|
2020-10-27 16:36:00 +02:00
|
|
|
rcvbuflen = link->rcvbuf_len;
|
2014-02-10 16:27:33 +01:00
|
|
|
if (rcvbuflen < 8) {
|
|
|
|
/* First, obtain the first 8 bytes to get the full message
|
2013-09-03 11:43:07 +02:00
|
|
|
* length. */
|
2014-02-10 16:27:33 +01:00
|
|
|
readlen = 8 - rcvbuflen;
|
2013-09-03 11:43:07 +02:00
|
|
|
} else {
|
|
|
|
/* Finally read the full message. */
|
|
|
|
hdr = (clusterMsg*) link->rcvbuf;
|
2014-02-10 16:27:33 +01:00
|
|
|
if (rcvbuflen == 8) {
|
|
|
|
/* Perform some sanity check on the message signature
|
|
|
|
* and length. */
|
|
|
|
if (memcmp(hdr->sig,"RCmb",4) != 0 ||
|
|
|
|
ntohl(hdr->totlen) < CLUSTERMSG_MIN_LEN)
|
|
|
|
{
|
2022-11-02 10:27:30 +08:00
|
|
|
char ip[NET_IP_STR_LEN];
|
|
|
|
int port;
|
|
|
|
if (connAddrPeerName(conn, ip, sizeof(ip), &port) == -1) {
|
|
|
|
serverLog(LL_WARNING,
|
|
|
|
"Bad message length or signature received "
|
|
|
|
"on the Cluster bus.");
|
|
|
|
} else {
|
|
|
|
serverLog(LL_WARNING,
|
|
|
|
"Bad message length or signature received "
|
|
|
|
"on the Cluster bus from %s:%d", ip, port);
|
|
|
|
}
|
2013-09-03 11:43:07 +02:00
|
|
|
handleLinkIOError(link);
|
|
|
|
return;
|
|
|
|
}
|
2013-02-15 16:44:39 +01:00
|
|
|
}
|
2013-09-03 11:43:07 +02:00
|
|
|
readlen = ntohl(hdr->totlen) - rcvbuflen;
|
|
|
|
if (readlen > sizeof(buf)) readlen = sizeof(buf);
|
2013-02-15 16:44:39 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2019-09-12 10:56:54 +03:00
|
|
|
nread = connRead(conn,buf,readlen);
|
|
|
|
if (nread == -1 && (connGetState(conn) == CONN_STATE_CONNECTED)) return; /* No more data ready. */
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-09-03 11:43:07 +02:00
|
|
|
if (nread <= 0) {
|
|
|
|
/* I/O error... */
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_DEBUG,"I/O error reading from node link: %s",
|
2019-09-12 10:56:54 +03:00
|
|
|
(nread == 0) ? "connection closed" : connGetLastError(conn));
|
2013-09-03 11:43:07 +02:00
|
|
|
handleLinkIOError(link);
|
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
/* Read data and recast the pointer to the new buffer. */
|
2020-10-27 16:36:00 +02:00
|
|
|
size_t unused = link->rcvbuf_alloc - link->rcvbuf_len;
|
|
|
|
if ((size_t)nread > unused) {
|
|
|
|
size_t required = link->rcvbuf_len + nread;
|
2022-11-01 22:26:44 -04:00
|
|
|
size_t prev_rcvbuf_alloc = link->rcvbuf_alloc;
|
2020-10-27 16:36:00 +02:00
|
|
|
/* If less than 1mb, grow to twice the needed size, if larger grow by 1mb. */
|
|
|
|
link->rcvbuf_alloc = required < RCVBUF_MAX_PREALLOC ? required * 2: required + RCVBUF_MAX_PREALLOC;
|
|
|
|
link->rcvbuf = zrealloc(link->rcvbuf, link->rcvbuf_alloc);
|
2022-11-01 22:26:44 -04:00
|
|
|
server.stat_cluster_links_memory += link->rcvbuf_alloc - prev_rcvbuf_alloc;
|
2020-10-27 16:36:00 +02:00
|
|
|
}
|
|
|
|
memcpy(link->rcvbuf + link->rcvbuf_len, buf, nread);
|
|
|
|
link->rcvbuf_len += nread;
|
2013-09-03 11:43:07 +02:00
|
|
|
hdr = (clusterMsg*) link->rcvbuf;
|
|
|
|
rcvbuflen += nread;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-09-03 11:43:07 +02:00
|
|
|
/* Total length obtained? Process this packet. */
|
2014-02-10 16:27:33 +01:00
|
|
|
if (rcvbuflen >= 8 && rcvbuflen == ntohl(hdr->totlen)) {
|
2013-09-03 11:43:07 +02:00
|
|
|
if (clusterProcessPacket(link)) {
|
2020-10-27 16:36:00 +02:00
|
|
|
if (link->rcvbuf_alloc > RCVBUF_INIT_LEN) {
|
2022-11-01 22:26:44 -04:00
|
|
|
size_t prev_rcvbuf_alloc = link->rcvbuf_alloc;
|
2020-10-27 16:36:00 +02:00
|
|
|
zfree(link->rcvbuf);
|
|
|
|
link->rcvbuf = zmalloc(link->rcvbuf_alloc = RCVBUF_INIT_LEN);
|
2022-11-01 22:26:44 -04:00
|
|
|
server.stat_cluster_links_memory += link->rcvbuf_alloc - prev_rcvbuf_alloc;
|
2020-10-27 16:36:00 +02:00
|
|
|
}
|
|
|
|
link->rcvbuf_len = 0;
|
2013-09-03 11:43:07 +02:00
|
|
|
} else {
|
|
|
|
return; /* Link no longer valid. */
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
/* Put the message block into the link's send queue.
|
2013-09-26 16:54:43 +02:00
|
|
|
*
|
|
|
|
* It is guaranteed that this function will never have as a side effect
|
|
|
|
* the link to be invalidated, so it is safe to call this function
|
|
|
|
* from event handlers that will do stuff with the same link later. */
|
2022-11-01 22:26:44 -04:00
|
|
|
void clusterSendMessage(clusterLink *link, clusterMsgSendBlock *msgblock) {
|
2023-02-02 09:06:24 -08:00
|
|
|
if (!link) {
|
|
|
|
return;
|
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
if (listLength(link->send_msg_queue) == 0 && msgblock->msg.totlen != 0)
|
2019-08-19 12:18:25 +03:00
|
|
|
connSetWriteHandlerWithBarrier(link->conn, clusterWriteHandler, 1);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
listAddNodeTail(link->send_msg_queue, msgblock);
|
|
|
|
msgblock->refcount++;
|
|
|
|
|
|
|
|
/* Update memory tracking */
|
|
|
|
link->send_msg_queue_mem += sizeof(listNode) + msgblock->totlen;
|
|
|
|
server.stat_cluster_links_memory += sizeof(listNode);
|
2017-04-13 19:22:35 +02:00
|
|
|
|
|
|
|
/* Populate sent messages stats. */
|
2022-11-01 22:26:44 -04:00
|
|
|
uint16_t type = ntohs(msgblock->msg.type);
|
2017-04-13 19:22:35 +02:00
|
|
|
if (type < CLUSTERMSG_TYPE_COUNT)
|
|
|
|
server.cluster->stats_bus_messages_sent[type]++;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2013-03-15 15:36:36 +01:00
|
|
|
/* Send a message to all the nodes that are part of the cluster having
|
2013-09-26 16:54:43 +02:00
|
|
|
* a connected link.
|
2014-05-15 10:18:16 +02:00
|
|
|
*
|
2013-09-26 16:54:43 +02:00
|
|
|
* It is guaranteed that this function will never have as a side effect
|
|
|
|
* some node->link to be invalidated, so it is safe to call this function
|
|
|
|
* from event handlers that will do stuff with node links later. */
|
2022-11-01 22:26:44 -04:00
|
|
|
void clusterBroadcastMessage(clusterMsgSendBlock *msgblock) {
|
2011-10-07 15:37:34 +02:00
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2011-10-07 15:37:34 +02:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
2011-11-08 17:07:55 +01:00
|
|
|
clusterNode *node = dictGetVal(de);
|
2011-10-07 15:37:34 +02:00
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
if (node->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_HANDSHAKE))
|
2013-03-15 15:36:36 +01:00
|
|
|
continue;
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterSendMessage(node->link,msgblock);
|
2011-10-07 15:37:34 +02:00
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
2015-01-29 14:17:45 +01:00
|
|
|
/* Build the message header. hdr must point to a buffer at least
|
|
|
|
* sizeof(clusterMsg) in bytes. */
|
2022-11-01 22:26:44 -04:00
|
|
|
static void clusterBuildMessageHdr(clusterMsg *hdr, int type, size_t msglen) {
|
2014-01-28 16:51:50 +01:00
|
|
|
uint64_t offset;
|
2014-01-29 11:22:22 +01:00
|
|
|
clusterNode *master;
|
2013-10-07 11:30:58 +02:00
|
|
|
|
|
|
|
/* If this node is a master, we send its slots bitmap and configEpoch.
|
|
|
|
* If this node is a slave we send the master's information instead (the
|
|
|
|
* node is flagged as slave so the receiver knows that it is NOT really
|
|
|
|
* in charge for this slots. */
|
2014-01-29 12:17:16 +01:00
|
|
|
master = (nodeIsSlave(myself) && myself->slaveof) ?
|
2014-01-28 16:51:50 +01:00
|
|
|
myself->slaveof : myself;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2015-01-13 10:20:49 +01:00
|
|
|
hdr->ver = htons(CLUSTER_PROTO_VER);
|
2014-02-10 15:53:09 +01:00
|
|
|
hdr->sig[0] = 'R';
|
|
|
|
hdr->sig[1] = 'C';
|
2014-02-10 15:55:21 +01:00
|
|
|
hdr->sig[2] = 'm';
|
2014-02-10 15:53:09 +01:00
|
|
|
hdr->sig[3] = 'b';
|
2011-03-29 17:51:15 +02:00
|
|
|
hdr->type = htons(type);
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(hdr->sender,myself->name,CLUSTER_NAMELEN);
|
2013-10-07 11:30:58 +02:00
|
|
|
|
2016-01-21 16:57:35 +01:00
|
|
|
/* If cluster-announce-ip option is enabled, force the receivers of our
|
|
|
|
* packets to use the specified address for this node. Otherwise if the
|
|
|
|
* first byte is zero, they'll do auto discovery. */
|
|
|
|
memset(hdr->myip,0,NET_IP_STR_LEN);
|
|
|
|
if (server.cluster_announce_ip) {
|
2022-07-18 10:56:26 +03:00
|
|
|
redis_strlcpy(hdr->myip,server.cluster_announce_ip,NET_IP_STR_LEN);
|
2016-01-21 16:57:35 +01:00
|
|
|
}
|
|
|
|
|
2021-03-30 22:11:32 +02:00
|
|
|
/* Handle cluster-announce-[tls-|bus-]port. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
int announced_tcp_port, announced_tls_port, announced_cport;
|
|
|
|
deriveAnnouncedPorts(&announced_tcp_port, &announced_tls_port, &announced_cport);
|
2016-01-21 16:57:35 +01:00
|
|
|
|
2013-10-07 11:30:58 +02:00
|
|
|
memcpy(hdr->myslots,master->slots,sizeof(hdr->myslots));
|
2015-07-27 14:55:45 +02:00
|
|
|
memset(hdr->slaveof,0,CLUSTER_NAMELEN);
|
2014-01-28 16:51:50 +01:00
|
|
|
if (myself->slaveof != NULL)
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(hdr->slaveof,myself->slaveof->name, CLUSTER_NAMELEN);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (server.tls_cluster) {
|
|
|
|
hdr->port = htons(announced_tls_port);
|
|
|
|
hdr->pport = htons(announced_tcp_port);
|
|
|
|
} else {
|
|
|
|
hdr->port = htons(announced_tcp_port);
|
|
|
|
hdr->pport = htons(announced_tls_port);
|
|
|
|
}
|
2016-01-21 16:57:35 +01:00
|
|
|
hdr->cport = htons(announced_cport);
|
2014-01-28 16:51:50 +01:00
|
|
|
hdr->flags = htons(myself->flags);
|
2013-02-14 13:20:56 +01:00
|
|
|
hdr->state = server.cluster->state;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-10-07 11:30:58 +02:00
|
|
|
/* Set the currentEpoch and configEpochs. */
|
2013-09-25 11:53:35 +02:00
|
|
|
hdr->currentEpoch = htonu64(server.cluster->currentEpoch);
|
2013-10-07 11:30:58 +02:00
|
|
|
hdr->configEpoch = htonu64(master->configEpoch);
|
2013-09-25 11:53:35 +02:00
|
|
|
|
2014-01-28 16:51:50 +01:00
|
|
|
/* Set the replication offset. */
|
2014-01-29 16:39:04 +01:00
|
|
|
if (nodeIsSlave(myself))
|
|
|
|
offset = replicationGetSlaveOffset();
|
|
|
|
else
|
2014-01-28 16:51:50 +01:00
|
|
|
offset = server.master_repl_offset;
|
|
|
|
hdr->offset = htonu64(offset);
|
|
|
|
|
2014-02-05 13:01:24 +01:00
|
|
|
/* Set the message flags. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) && server.cluster->mf_end)
|
2014-02-05 13:01:24 +01:00
|
|
|
hdr->mflags[0] |= CLUSTERMSG_FLAG0_PAUSED;
|
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
hdr->totlen = htonl(msglen);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2017-04-14 13:39:49 +02:00
|
|
|
/* Set the i-th entry of the gossip section in the message pointed by 'hdr'
|
|
|
|
* to the info of the specified node 'n'. */
|
|
|
|
void clusterSetGossipEntry(clusterMsg *hdr, int i, clusterNode *n) {
|
|
|
|
clusterMsgDataGossip *gossip;
|
|
|
|
gossip = &(hdr->data.ping.gossip[i]);
|
|
|
|
memcpy(gossip->nodename,n->name,CLUSTER_NAMELEN);
|
|
|
|
gossip->ping_sent = htonl(n->ping_sent/1000);
|
|
|
|
gossip->pong_received = htonl(n->pong_received/1000);
|
|
|
|
memcpy(gossip->ip,n->ip,sizeof(n->ip));
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (server.tls_cluster) {
|
|
|
|
gossip->port = htons(n->tls_port);
|
|
|
|
gossip->pport = htons(n->tcp_port);
|
|
|
|
} else {
|
|
|
|
gossip->port = htons(n->tcp_port);
|
|
|
|
gossip->pport = htons(n->tls_port);
|
|
|
|
}
|
2017-04-14 13:39:49 +02:00
|
|
|
gossip->cport = htons(n->cport);
|
|
|
|
gossip->flags = htons(n->flags);
|
|
|
|
gossip->notused1 = 0;
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Send a PING or PONG packet to the specified node, making sure to add enough
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* gossip information. */
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterSendPing(clusterLink *link, int type) {
|
2022-06-21 12:02:22 +08:00
|
|
|
static unsigned long long cluster_pings_sent = 0;
|
|
|
|
cluster_pings_sent++;
|
2015-01-29 14:17:45 +01:00
|
|
|
int gossipcount = 0; /* Number of gossip sections added so far. */
|
|
|
|
int wanted; /* Number of gossip sections we want to append if possible. */
|
2022-01-02 19:48:29 -08:00
|
|
|
int estlen; /* Upper bound on estimated packet length */
|
2015-01-29 14:17:45 +01:00
|
|
|
/* freshnodes is the max number of nodes we can hope to append at all:
|
|
|
|
* nodes available minus two (ourself and the node we are sending the
|
|
|
|
* message to). However practically there may be less valid nodes since
|
|
|
|
* nodes in handshake state, disconnected, are not considered. */
|
2013-02-14 13:20:56 +01:00
|
|
|
int freshnodes = dictSize(server.cluster->nodes)-2;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2015-01-29 15:40:08 +01:00
|
|
|
/* How many gossip sections we want to add? 1/10 of the number of nodes
|
|
|
|
* and anyway at least 3. Why 1/10?
|
|
|
|
*
|
|
|
|
* If we have N masters, with N/10 entries, and we consider that in
|
|
|
|
* node_timeout we exchange with each other node at least 4 packets
|
|
|
|
* (we ping in the worst case in node_timeout/2 time, and we also
|
|
|
|
* receive two pings from the host), we have a total of 8 packets
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* in the node_timeout*2 failure reports validity time. So we have
|
2015-01-29 15:40:08 +01:00
|
|
|
* that, for a single PFAIL node, we can expect to receive the following
|
|
|
|
* number of failure reports (in the specified window of time):
|
|
|
|
*
|
|
|
|
* PROB * GOSSIP_ENTRIES_PER_PACKET * TOTAL_PACKETS:
|
|
|
|
*
|
|
|
|
* PROB = probability of being featured in a single gossip entry,
|
|
|
|
* which is 1 / NUM_OF_NODES.
|
|
|
|
* ENTRIES = 10.
|
|
|
|
* TOTAL_PACKETS = 2 * 4 * NUM_OF_MASTERS.
|
|
|
|
*
|
|
|
|
* If we assume we have just masters (so num of nodes and num of masters
|
|
|
|
* is the same), with 1/10 we always get over the majority, and specifically
|
|
|
|
* 80% of the number of nodes, to account for many masters failing at the
|
|
|
|
* same time.
|
|
|
|
*
|
|
|
|
* Since we have non-voting slaves that lower the probability of an entry
|
2018-06-07 14:36:56 +02:00
|
|
|
* to feature our node, we set the number of entries per packet as
|
2015-01-29 15:40:08 +01:00
|
|
|
* 10% of the total nodes we have. */
|
2015-01-30 11:23:27 +01:00
|
|
|
wanted = floor(dictSize(server.cluster->nodes)/10);
|
2015-01-29 14:17:45 +01:00
|
|
|
if (wanted < 3) wanted = 3;
|
2015-01-30 11:23:27 +01:00
|
|
|
if (wanted > freshnodes) wanted = freshnodes;
|
2015-01-29 14:17:45 +01:00
|
|
|
|
2017-04-14 13:39:49 +02:00
|
|
|
/* Include all the nodes in PFAIL state, so that failure reports are
|
|
|
|
* faster to propagate to go from PFAIL to FAIL state. */
|
|
|
|
int pfail_wanted = server.cluster->stats_pfail_nodes;
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* Compute the maximum estlen to allocate our buffer. We'll fix the estlen
|
2015-01-29 14:17:45 +01:00
|
|
|
* later according to the number of gossip sections we really were able
|
|
|
|
* to put inside the packet. */
|
2022-01-02 19:48:29 -08:00
|
|
|
estlen = sizeof(clusterMsg) - sizeof(union clusterMsgData);
|
|
|
|
estlen += (sizeof(clusterMsgDataGossip)*(wanted + pfail_wanted));
|
2022-11-16 19:24:18 -08:00
|
|
|
estlen += writePingExt(NULL, 0);
|
2015-01-29 14:17:45 +01:00
|
|
|
/* Note: clusterBuildMessageHdr() expects the buffer to be always at least
|
|
|
|
* sizeof(clusterMsg) or more. */
|
2022-01-02 19:48:29 -08:00
|
|
|
if (estlen < (int)sizeof(clusterMsg)) estlen = sizeof(clusterMsg);
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(type, estlen);
|
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2015-01-29 14:17:45 +01:00
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
if (!link->inbound && type == CLUSTERMSG_TYPE_PING)
|
2013-10-09 16:18:33 +02:00
|
|
|
link->node->ping_sent = mstime();
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Populate the gossip fields */
|
2015-01-30 11:54:18 +01:00
|
|
|
int maxiterations = wanted*3;
|
2015-01-29 14:17:45 +01:00
|
|
|
while(freshnodes > 0 && gossipcount < wanted && maxiterations--) {
|
2014-03-20 16:20:37 +01:00
|
|
|
dictEntry *de = dictGetRandomKey(server.cluster->nodes);
|
2011-11-08 17:07:55 +01:00
|
|
|
clusterNode *this = dictGetVal(de);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2015-01-29 14:17:45 +01:00
|
|
|
/* Don't include this node: the whole packet header is about us
|
|
|
|
* already, so we just gossip about other nodes. */
|
|
|
|
if (this == myself) continue;
|
|
|
|
|
2017-04-14 13:39:49 +02:00
|
|
|
/* PFAIL nodes will be added later. */
|
|
|
|
if (this->flags & CLUSTER_NODE_PFAIL) continue;
|
2015-01-30 11:54:18 +01:00
|
|
|
|
2013-02-28 15:00:09 +01:00
|
|
|
/* In the gossip section don't include:
|
2015-01-29 14:17:45 +01:00
|
|
|
* 1) Nodes in HANDSHAKE state.
|
2013-02-28 15:00:09 +01:00
|
|
|
* 3) Nodes with the NOADDR flag set.
|
|
|
|
* 4) Disconnected nodes if they don't have configured slots.
|
|
|
|
*/
|
2015-07-27 14:55:45 +02:00
|
|
|
if (this->flags & (CLUSTER_NODE_HANDSHAKE|CLUSTER_NODE_NOADDR) ||
|
2013-02-28 15:13:32 +01:00
|
|
|
(this->link == NULL && this->numslots == 0))
|
2013-02-28 15:00:09 +01:00
|
|
|
{
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
freshnodes--; /* Technically not correct, but saves CPU. */
|
2015-01-29 14:17:45 +01:00
|
|
|
continue;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2017-04-14 13:39:49 +02:00
|
|
|
/* Do not add a node we already have. */
|
2022-06-21 12:02:22 +08:00
|
|
|
if (this->last_in_ping_gossip == cluster_pings_sent) continue;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
/* Add it */
|
2017-04-14 13:39:49 +02:00
|
|
|
clusterSetGossipEntry(hdr,gossipcount,this);
|
2022-06-21 12:02:22 +08:00
|
|
|
this->last_in_ping_gossip = cluster_pings_sent;
|
2011-03-29 17:51:15 +02:00
|
|
|
freshnodes--;
|
|
|
|
gossipcount++;
|
|
|
|
}
|
2015-01-29 14:17:45 +01:00
|
|
|
|
2017-04-14 13:39:49 +02:00
|
|
|
/* If there are PFAIL nodes, add them at the end. */
|
|
|
|
if (pfail_wanted) {
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL && pfail_wanted > 0) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
if (node->flags & CLUSTER_NODE_HANDSHAKE) continue;
|
|
|
|
if (node->flags & CLUSTER_NODE_NOADDR) continue;
|
|
|
|
if (!(node->flags & CLUSTER_NODE_PFAIL)) continue;
|
|
|
|
clusterSetGossipEntry(hdr,gossipcount,node);
|
|
|
|
gossipcount++;
|
|
|
|
/* We take the count of the slots we allocated, since the
|
|
|
|
* PFAIL stats may not match perfectly with the current number
|
|
|
|
* of PFAIL nodes. */
|
|
|
|
pfail_wanted--;
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
2022-01-02 19:48:29 -08:00
|
|
|
/* Compute the actual total length and send! */
|
2022-11-16 19:24:18 -08:00
|
|
|
uint32_t totlen = 0;
|
|
|
|
totlen += writePingExt(hdr, gossipcount);
|
2022-01-02 19:48:29 -08:00
|
|
|
totlen += sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
2011-03-29 17:51:15 +02:00
|
|
|
totlen += (sizeof(clusterMsgDataGossip)*gossipcount);
|
2022-11-16 19:24:18 -08:00
|
|
|
serverAssert(gossipcount < USHRT_MAX);
|
2011-03-29 17:51:15 +02:00
|
|
|
hdr->count = htons(gossipcount);
|
|
|
|
hdr->totlen = htonl(totlen);
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
clusterSendMessage(link,msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2013-09-26 16:54:43 +02:00
|
|
|
/* Send a PONG packet to every connected node that's not in handshake state
|
|
|
|
* and for which we have a valid link.
|
2013-03-15 15:43:53 +01:00
|
|
|
*
|
2013-09-26 16:54:43 +02:00
|
|
|
* In Redis Cluster pongs are not used just for failure detection, but also
|
|
|
|
* to carry important configuration information. So broadcasting a pong is
|
2013-03-15 15:43:53 +01:00
|
|
|
* useful when something changes in the configuration and we want to make
|
2014-01-29 11:08:52 +01:00
|
|
|
* the cluster aware ASAP (for instance after a slave promotion).
|
|
|
|
*
|
|
|
|
* The 'target' argument specifies the receiving instances using the
|
|
|
|
* defines below:
|
|
|
|
*
|
|
|
|
* CLUSTER_BROADCAST_ALL -> All known instances.
|
|
|
|
* CLUSTER_BROADCAST_LOCAL_SLAVES -> All slaves in my master-slaves ring.
|
|
|
|
*/
|
|
|
|
#define CLUSTER_BROADCAST_ALL 0
|
|
|
|
#define CLUSTER_BROADCAST_LOCAL_SLAVES 1
|
|
|
|
void clusterBroadcastPong(int target) {
|
2013-03-15 15:43:53 +01:00
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2013-03-15 15:43:53 +01:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
2013-09-26 16:54:43 +02:00
|
|
|
if (!node->link) continue;
|
2014-01-29 12:17:16 +01:00
|
|
|
if (node == myself || nodeInHandshake(node)) continue;
|
2014-01-29 11:08:52 +01:00
|
|
|
if (target == CLUSTER_BROADCAST_LOCAL_SLAVES) {
|
|
|
|
int local_slave =
|
2014-01-29 12:17:16 +01:00
|
|
|
nodeIsSlave(node) && node->slaveof &&
|
2014-01-29 11:08:52 +01:00
|
|
|
(node->slaveof == myself || node->slaveof == myself->slaveof);
|
|
|
|
if (!local_slave) continue;
|
|
|
|
}
|
2013-03-15 15:43:53 +01:00
|
|
|
clusterSendPing(node->link,CLUSTERMSG_TYPE_PONG);
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
/* Create a PUBLISH message block.
|
2021-11-11 14:51:33 +03:00
|
|
|
*
|
|
|
|
* Sanitizer suppression: In clusterMsgDataPublish, sizeof(bulk_data) is 8.
|
|
|
|
* As all the struct is used as a buffer, when more than 8 bytes are copied into
|
|
|
|
* the 'bulk_data', sanitizer generates an out-of-bounds error which is a false
|
|
|
|
* positive in this context. */
|
|
|
|
REDIS_NO_SANITIZE("bounds")
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsgSendBlock *clusterCreatePublishMsgBlock(robj *channel, robj *message, uint16_t type) {
|
|
|
|
|
2011-10-07 15:37:34 +02:00
|
|
|
uint32_t channel_len, message_len;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2011-10-07 15:37:34 +02:00
|
|
|
channel = getDecodedObject(channel);
|
|
|
|
message = getDecodedObject(message);
|
|
|
|
channel_len = sdslen(channel->ptr);
|
|
|
|
message_len = sdslen(message->ptr);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
size_t msglen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
msglen += sizeof(clusterMsgDataPublish) - 8 + channel_len + message_len;
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(type, msglen);
|
2011-10-07 15:37:34 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2011-10-07 15:37:34 +02:00
|
|
|
hdr->data.publish.msg.channel_len = htonl(channel_len);
|
|
|
|
hdr->data.publish.msg.message_len = htonl(message_len);
|
|
|
|
memcpy(hdr->data.publish.msg.bulk_data,channel->ptr,sdslen(channel->ptr));
|
|
|
|
memcpy(hdr->data.publish.msg.bulk_data+sdslen(channel->ptr),
|
|
|
|
message->ptr,sdslen(message->ptr));
|
|
|
|
|
|
|
|
decrRefCount(channel);
|
|
|
|
decrRefCount(message);
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
return msgblock;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Send a FAIL message to all the nodes we are able to contact.
|
|
|
|
* The FAIL message is sent when we detect that a node is failing
|
2015-07-27 14:55:45 +02:00
|
|
|
* (CLUSTER_NODE_PFAIL) and we also receive a gossip confirmation of this:
|
|
|
|
* we switch the node state to CLUSTER_NODE_FAIL and ask all the other
|
2011-03-29 17:51:15 +02:00
|
|
|
* nodes to do the same ASAP. */
|
|
|
|
void clusterSendFail(char *nodename) {
|
2022-11-01 22:26:44 -04:00
|
|
|
uint32_t msglen = sizeof(clusterMsg) - sizeof(union clusterMsgData)
|
|
|
|
+ sizeof(clusterMsgDataFail);
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_FAIL, msglen);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(hdr->data.fail.about.nodename,nodename,CLUSTER_NAMELEN);
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
clusterBroadcastMessage(msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2013-11-08 16:26:50 +01:00
|
|
|
/* Send an UPDATE message to the specified link carrying the specified 'node'
|
|
|
|
* slots configuration. The node name, slots bitmap, and configEpoch info
|
|
|
|
* are included. */
|
|
|
|
void clusterSendUpdate(clusterLink *link, clusterNode *node) {
|
2013-12-17 12:28:37 +01:00
|
|
|
if (link == NULL) return;
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
uint32_t msglen = sizeof(clusterMsg) - sizeof(union clusterMsgData)
|
|
|
|
+ sizeof(clusterMsgDataUpdate);
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_UPDATE, msglen);
|
|
|
|
|
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2015-07-27 14:55:45 +02:00
|
|
|
memcpy(hdr->data.update.nodecfg.nodename,node->name,CLUSTER_NAMELEN);
|
2013-11-08 16:26:50 +01:00
|
|
|
hdr->data.update.nodecfg.configEpoch = htonu64(node->configEpoch);
|
|
|
|
memcpy(hdr->data.update.nodecfg.slots,node->slots,sizeof(node->slots));
|
2023-07-05 17:46:23 -07:00
|
|
|
for (unsigned int i = 0; i < sizeof(node->slots); i++) {
|
|
|
|
/* Don't advertise slots that the node stopped claiming */
|
|
|
|
hdr->data.update.nodecfg.slots[i] = hdr->data.update.nodecfg.slots[i] & (~server.cluster->owner_not_claiming_slot[i]);
|
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
clusterSendMessage(link,msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2013-11-08 16:26:50 +01:00
|
|
|
}
|
|
|
|
|
2018-03-29 15:13:31 +02:00
|
|
|
/* Send a MODULE message.
|
|
|
|
*
|
|
|
|
* If link is NULL, then the message is broadcasted to the whole cluster. */
|
|
|
|
void clusterSendModule(clusterLink *link, uint64_t module_id, uint8_t type,
|
2022-01-18 21:55:20 +08:00
|
|
|
const char *payload, uint32_t len) {
|
2022-11-01 22:26:44 -04:00
|
|
|
uint32_t msglen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
msglen += sizeof(clusterMsgModule) - 3 + len;
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_MODULE, msglen);
|
2018-03-29 15:13:31 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2018-03-29 15:13:31 +02:00
|
|
|
hdr->data.module.msg.module_id = module_id; /* Already endian adjusted. */
|
|
|
|
hdr->data.module.msg.type = type;
|
|
|
|
hdr->data.module.msg.len = htonl(len);
|
|
|
|
memcpy(hdr->data.module.msg.bulk_data,payload,len);
|
|
|
|
|
|
|
|
if (link)
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterSendMessage(link,msgblock);
|
2018-03-29 15:13:31 +02:00
|
|
|
else
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterBroadcastMessage(msgblock);
|
2018-03-29 15:13:31 +02:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2018-03-29 15:13:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This function gets a cluster node ID string as target, the same way the nodes
|
|
|
|
* addresses are represented in the modules side, resolves the node, and sends
|
|
|
|
* the message. If the target is NULL the message is broadcasted.
|
|
|
|
*
|
|
|
|
* The function returns C_OK if the target is valid, otherwise C_ERR is
|
|
|
|
* returned. */
|
2022-01-18 21:55:20 +08:00
|
|
|
int clusterSendModuleMessageToTarget(const char *target, uint64_t module_id, uint8_t type, const char *payload, uint32_t len) {
|
2018-03-29 15:13:31 +02:00
|
|
|
clusterNode *node = NULL;
|
|
|
|
|
|
|
|
if (target != NULL) {
|
2022-04-05 13:51:51 +08:00
|
|
|
node = clusterLookupNode(target, strlen(target));
|
2018-03-29 15:13:31 +02:00
|
|
|
if (node == NULL || node->link == NULL) return C_ERR;
|
|
|
|
}
|
|
|
|
|
|
|
|
clusterSendModule(target ? node->link : NULL,
|
|
|
|
module_id, type, payload, len);
|
|
|
|
return C_OK;
|
|
|
|
}
|
|
|
|
|
2011-10-07 15:37:34 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER Pub/Sub support
|
|
|
|
*
|
2022-04-17 14:43:22 +02:00
|
|
|
* If `sharded` is 0:
|
|
|
|
* For now we do very little, just propagating [S]PUBLISH messages across the whole
|
2011-10-07 15:37:34 +02:00
|
|
|
* cluster. In the future we'll try to get smarter and avoiding propagating those
|
|
|
|
* messages to hosts without receives for a given channel.
|
2022-04-17 14:43:22 +02:00
|
|
|
* Otherwise:
|
2022-01-03 01:54:47 +01:00
|
|
|
* Publish this message across the slot (primary/replica).
|
|
|
|
* -------------------------------------------------------------------------- */
|
2022-04-17 14:43:22 +02:00
|
|
|
void clusterPropagatePublish(robj *channel, robj *message, int sharded) {
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsgSendBlock *msgblock;
|
|
|
|
|
2022-04-17 14:43:22 +02:00
|
|
|
if (!sharded) {
|
2022-11-01 22:26:44 -04:00
|
|
|
msgblock = clusterCreatePublishMsgBlock(channel, message, CLUSTERMSG_TYPE_PUBLISH);
|
|
|
|
clusterBroadcastMessage(msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2022-04-17 14:43:22 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-11-16 19:24:18 -08:00
|
|
|
listIter li;
|
|
|
|
listNode *ln;
|
|
|
|
list *nodes_for_slot = clusterGetNodesInMyShard(server.cluster->myself);
|
|
|
|
serverAssert(nodes_for_slot != NULL);
|
|
|
|
listRewind(nodes_for_slot, &li);
|
2022-11-01 22:26:44 -04:00
|
|
|
msgblock = clusterCreatePublishMsgBlock(channel, message, CLUSTERMSG_TYPE_PUBLISHSHARD);
|
2022-11-16 19:24:18 -08:00
|
|
|
while((ln = listNext(&li))) {
|
|
|
|
clusterNode *node = listNodeValue(ln);
|
2023-02-02 09:06:24 -08:00
|
|
|
if (node->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_HANDSHAKE))
|
|
|
|
continue;
|
|
|
|
clusterSendMessage(node->link,msgblock);
|
2022-01-03 01:54:47 +01:00
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2011-10-07 15:37:34 +02:00
|
|
|
}
|
|
|
|
|
2013-03-13 12:44:02 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* SLAVE node specific functions
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2021-02-08 18:09:39 +08:00
|
|
|
/* This function sends a FAILOVER_AUTH_REQUEST message to every node in order to
|
2013-03-13 17:21:20 +01:00
|
|
|
* see if there is the quorum for this slave instance to failover its failing
|
|
|
|
* master.
|
|
|
|
*
|
|
|
|
* Note that we send the failover request to everybody, master and slave nodes,
|
|
|
|
* but only the masters are supposed to reply to our query. */
|
|
|
|
void clusterRequestFailoverAuth(void) {
|
2022-11-01 22:26:44 -04:00
|
|
|
uint32_t msglen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST, msglen);
|
2013-03-13 17:21:20 +01:00
|
|
|
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterMsg *hdr = &msgblock->msg;
|
2014-02-05 13:10:03 +01:00
|
|
|
/* If this is a manual failover, set the CLUSTERMSG_FLAG0_FORCEACK bit
|
|
|
|
* in the header to communicate the nodes receiving the message that
|
|
|
|
* they should authorized the failover even if the master is working. */
|
|
|
|
if (server.cluster->mf_end) hdr->mflags[0] |= CLUSTERMSG_FLAG0_FORCEACK;
|
2022-11-01 22:26:44 -04:00
|
|
|
clusterBroadcastMessage(msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2013-03-13 17:21:20 +01:00
|
|
|
}
|
|
|
|
|
2013-09-30 16:19:44 +02:00
|
|
|
/* Send a FAILOVER_AUTH_ACK message to the specified node. */
|
|
|
|
void clusterSendFailoverAuth(clusterNode *node) {
|
2013-03-14 16:31:57 +01:00
|
|
|
if (!node->link) return;
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
uint32_t msglen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK, msglen);
|
|
|
|
|
|
|
|
clusterSendMessage(node->link,msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2013-03-14 16:31:57 +01:00
|
|
|
}
|
|
|
|
|
2014-02-05 13:01:24 +01:00
|
|
|
/* Send a MFSTART message to the specified node. */
|
|
|
|
void clusterSendMFStart(clusterNode *node) {
|
|
|
|
if (!node->link) return;
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
uint32_t msglen = sizeof(clusterMsg)-sizeof(union clusterMsgData);
|
|
|
|
clusterMsgSendBlock *msgblock = createClusterMsgSendBlock(CLUSTERMSG_TYPE_MFSTART, msglen);
|
|
|
|
|
|
|
|
clusterSendMessage(node->link,msgblock);
|
|
|
|
clusterMsgSendBlockDecrRefCount(msgblock);
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
|
|
|
|
2013-09-26 13:00:41 +02:00
|
|
|
/* Vote for the node asking for our vote if there are the conditions. */
|
2013-09-20 09:22:21 +02:00
|
|
|
void clusterSendFailoverAuthIfNeeded(clusterNode *node, clusterMsg *request) {
|
2013-03-13 19:08:03 +01:00
|
|
|
clusterNode *master = node->slaveof;
|
2013-10-08 12:45:35 +02:00
|
|
|
uint64_t requestCurrentEpoch = ntohu64(request->currentEpoch);
|
|
|
|
uint64_t requestConfigEpoch = ntohu64(request->configEpoch);
|
|
|
|
unsigned char *claimed_slots = request->myslots;
|
2014-02-05 13:10:03 +01:00
|
|
|
int force_ack = request->mflags[0] & CLUSTERMSG_FLAG0_FORCEACK;
|
2013-10-08 12:45:35 +02:00
|
|
|
int j;
|
2013-09-26 13:00:41 +02:00
|
|
|
|
|
|
|
/* IF we are not a master serving at least 1 slot, we don't have the
|
|
|
|
* right to vote, as the cluster size in Redis Cluster is the number
|
2013-11-29 16:17:05 +01:00
|
|
|
* of masters serving at least one slot, and quorum is the cluster
|
|
|
|
* size + 1 */
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeIsSlave(myself) || myself->numslots == 0) return;
|
2013-09-26 13:00:41 +02:00
|
|
|
|
2014-06-10 17:20:16 +02:00
|
|
|
/* Request epoch must be >= our currentEpoch.
|
|
|
|
* Note that it is impossible for it to actually be greater since
|
|
|
|
* our currentEpoch was updated as a side effect of receiving this
|
|
|
|
* request, if the request epoch was greater. */
|
2014-06-10 16:07:26 +02:00
|
|
|
if (requestCurrentEpoch < server.cluster->currentEpoch) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): reqEpoch (%llu) < curEpoch(%llu)",
|
|
|
|
node->name, node->human_nodename,
|
2014-06-10 16:07:26 +02:00
|
|
|
(unsigned long long) requestCurrentEpoch,
|
|
|
|
(unsigned long long) server.cluster->currentEpoch);
|
|
|
|
return;
|
|
|
|
}
|
2013-03-13 19:08:03 +01:00
|
|
|
|
2013-09-26 13:00:41 +02:00
|
|
|
/* I already voted for this epoch? Return ASAP. */
|
2014-06-10 16:07:26 +02:00
|
|
|
if (server.cluster->lastVoteEpoch == server.cluster->currentEpoch) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): already voted for epoch %llu",
|
|
|
|
node->name, node->human_nodename,
|
2014-06-10 16:07:26 +02:00
|
|
|
(unsigned long long) server.cluster->currentEpoch);
|
|
|
|
return;
|
|
|
|
}
|
2013-09-26 13:00:41 +02:00
|
|
|
|
2014-02-05 13:10:03 +01:00
|
|
|
/* Node must be a slave and its master down.
|
|
|
|
* The master can be non failing if the request is flagged
|
|
|
|
* with CLUSTERMSG_FLAG0_FORCEACK (manual failover). */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(node) || master == NULL ||
|
2014-06-10 16:07:26 +02:00
|
|
|
(!nodeFailed(master) && !force_ack))
|
|
|
|
{
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(node)) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): it is a master node",
|
|
|
|
node->name, node->human_nodename);
|
2014-06-10 16:07:26 +02:00
|
|
|
} else if (master == NULL) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): I don't know its master",
|
|
|
|
node->name, node->human_nodename);
|
2014-06-10 16:07:26 +02:00
|
|
|
} else if (!nodeFailed(master)) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): its master is up",
|
|
|
|
node->name, node->human_nodename);
|
2014-06-10 16:07:26 +02:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2013-03-13 19:08:03 +01:00
|
|
|
|
2013-09-26 13:00:41 +02:00
|
|
|
/* We did not voted for a slave about this master for two
|
|
|
|
* times the node timeout. This is not strictly needed for correctness
|
|
|
|
* of the algorithm but makes the base case more linear. */
|
2013-10-09 16:18:33 +02:00
|
|
|
if (mstime() - node->slaveof->voted_time < server.cluster_node_timeout * 2)
|
2014-06-10 16:07:26 +02:00
|
|
|
{
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s %s: "
|
2014-06-10 17:39:42 +02:00
|
|
|
"can't vote about this master before %lld milliseconds",
|
2023-06-18 12:16:51 +08:00
|
|
|
node->name, node->human_nodename,
|
2014-06-10 17:39:42 +02:00
|
|
|
(long long) ((server.cluster_node_timeout*2)-
|
|
|
|
(mstime() - node->slaveof->voted_time)));
|
2013-10-09 16:18:33 +02:00
|
|
|
return;
|
2014-06-10 16:07:26 +02:00
|
|
|
}
|
2013-03-13 19:08:03 +01:00
|
|
|
|
2013-11-29 16:17:05 +01:00
|
|
|
/* The slave requesting the vote must have a configEpoch for the claimed
|
|
|
|
* slots that is >= the one of the masters currently serving the same
|
|
|
|
* slots in the current configuration. */
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2013-10-08 12:45:35 +02:00
|
|
|
if (bitmapTestBit(claimed_slots, j) == 0) continue;
|
2023-07-05 17:46:23 -07:00
|
|
|
if (isSlotUnclaimed(j) ||
|
2014-03-25 16:07:14 +01:00
|
|
|
server.cluster->slots[j]->configEpoch <= requestConfigEpoch)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2013-10-08 12:45:35 +02:00
|
|
|
/* If we reached this point we found a slot that in our current slots
|
|
|
|
* is served by a master with a greater configEpoch than the one claimed
|
|
|
|
* by the slave requesting our vote. Refuse to vote for this slave. */
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,
|
2023-06-18 12:16:51 +08:00
|
|
|
"Failover auth denied to %.40s (%s): "
|
2014-06-10 16:07:26 +02:00
|
|
|
"slot %d epoch (%llu) > reqEpoch (%llu)",
|
2023-06-18 12:16:51 +08:00
|
|
|
node->name, node->human_nodename, j,
|
2014-06-10 16:07:26 +02:00
|
|
|
(unsigned long long) server.cluster->slots[j]->configEpoch,
|
|
|
|
(unsigned long long) requestConfigEpoch);
|
2013-10-08 12:45:35 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2013-09-26 13:00:41 +02:00
|
|
|
/* We can vote for this slave. */
|
2014-03-27 15:01:24 +01:00
|
|
|
server.cluster->lastVoteEpoch = server.cluster->currentEpoch;
|
2013-10-09 16:18:33 +02:00
|
|
|
node->slaveof->voted_time = mstime();
|
2018-02-27 10:25:08 +01:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_FSYNC_CONFIG);
|
|
|
|
clusterSendFailoverAuth(node);
|
2023-06-18 12:16:51 +08:00
|
|
|
serverLog(LL_NOTICE, "Failover auth granted to %.40s (%s) for epoch %llu",
|
|
|
|
node->name, node->human_nodename, (unsigned long long) server.cluster->currentEpoch);
|
2013-03-13 18:38:08 +01:00
|
|
|
}
|
|
|
|
|
2014-01-29 16:39:04 +01:00
|
|
|
/* This function returns the "rank" of this instance, a slave, in the context
|
|
|
|
* of its master-slaves ring. The rank of the slave is given by the number of
|
|
|
|
* other slaves for the same master that have a better replication offset
|
|
|
|
* compared to the local one (better means, greater, so they claim more data).
|
|
|
|
*
|
|
|
|
* A slave with rank 0 is the one with the greatest (most up to date)
|
|
|
|
* replication offset, and so forth. Note that because how the rank is computed
|
|
|
|
* multiple slaves may have the same rank, in case they have the same offset.
|
|
|
|
*
|
|
|
|
* The slave rank is used to add a delay to start an election in order to
|
|
|
|
* get voted and replace a failing master. Slaves with better replication
|
|
|
|
* offsets are more likely to win. */
|
|
|
|
int clusterGetSlaveRank(void) {
|
|
|
|
long long myoffset;
|
|
|
|
int j, rank = 0;
|
|
|
|
clusterNode *master;
|
|
|
|
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(nodeIsSlave(myself));
|
2014-01-29 16:39:04 +01:00
|
|
|
master = myself->slaveof;
|
|
|
|
if (master == NULL) return 0; /* Never called by slaves without master. */
|
|
|
|
|
|
|
|
myoffset = replicationGetSlaveOffset();
|
|
|
|
for (j = 0; j < master->numslaves; j++)
|
|
|
|
if (master->slaves[j] != myself &&
|
2018-03-14 13:46:36 +01:00
|
|
|
!nodeCantFailover(master->slaves[j]) &&
|
2014-01-29 16:39:04 +01:00
|
|
|
master->slaves[j]->repl_offset > myoffset) rank++;
|
|
|
|
return rank;
|
|
|
|
}
|
|
|
|
|
2014-10-07 09:51:55 +02:00
|
|
|
/* This function is called by clusterHandleSlaveFailover() in order to
|
|
|
|
* let the slave log why it is not able to failover. Sometimes there are
|
|
|
|
* not the conditions, but since the failover function is called again and
|
|
|
|
* again, we can't log the same things continuously.
|
|
|
|
*
|
|
|
|
* This function works by logging only if a given set of conditions are
|
|
|
|
* true:
|
|
|
|
*
|
|
|
|
* 1) The reason for which the failover can't be initiated changed.
|
|
|
|
* The reasons also include a NONE reason we reset the state to
|
|
|
|
* when the slave finds that its master is fine (no FAIL flag).
|
|
|
|
* 2) Also, the log is emitted again if the master is still down and
|
|
|
|
* the reason for not failing over is still the same, but more than
|
2015-07-27 14:55:45 +02:00
|
|
|
* CLUSTER_CANT_FAILOVER_RELOG_PERIOD seconds elapsed.
|
2014-10-07 09:51:55 +02:00
|
|
|
* 3) Finally, the function only logs if the slave is down for more than
|
|
|
|
* five seconds + NODE_TIMEOUT. This way nothing is logged when a
|
|
|
|
* failover starts in a reasonable time.
|
|
|
|
*
|
|
|
|
* The function is called with the reason why the slave can't failover
|
2015-07-27 14:55:45 +02:00
|
|
|
* which is one of the integer macros CLUSTER_CANT_FAILOVER_*.
|
2014-10-07 09:51:55 +02:00
|
|
|
*
|
|
|
|
* The function is guaranteed to be called only if 'myself' is a slave. */
|
|
|
|
void clusterLogCantFailover(int reason) {
|
|
|
|
char *msg;
|
|
|
|
static time_t lastlog_time = 0;
|
|
|
|
mstime_t nolog_fail_time = server.cluster_node_timeout + 5000;
|
|
|
|
|
|
|
|
/* Don't log if we have the same reason for some time. */
|
|
|
|
if (reason == server.cluster->cant_failover_reason &&
|
2015-07-27 14:55:45 +02:00
|
|
|
time(NULL)-lastlog_time < CLUSTER_CANT_FAILOVER_RELOG_PERIOD)
|
2014-10-07 09:51:55 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
server.cluster->cant_failover_reason = reason;
|
|
|
|
|
|
|
|
/* We also don't emit any log if the master failed no long ago, the
|
|
|
|
* goal of this function is to log slaves in a stalled condition for
|
|
|
|
* a long time. */
|
|
|
|
if (myself->slaveof &&
|
|
|
|
nodeFailed(myself->slaveof) &&
|
|
|
|
(mstime() - myself->slaveof->fail_time) < nolog_fail_time) return;
|
|
|
|
|
|
|
|
switch(reason) {
|
2015-07-27 14:55:45 +02:00
|
|
|
case CLUSTER_CANT_FAILOVER_DATA_AGE:
|
2015-11-27 08:59:17 +01:00
|
|
|
msg = "Disconnected from master for longer than allowed. "
|
2018-09-10 10:49:03 +02:00
|
|
|
"Please check the 'cluster-replica-validity-factor' configuration "
|
2015-11-27 08:59:17 +01:00
|
|
|
"option.";
|
2014-10-07 09:51:55 +02:00
|
|
|
break;
|
2015-07-27 14:55:45 +02:00
|
|
|
case CLUSTER_CANT_FAILOVER_WAITING_DELAY:
|
2014-10-07 09:51:55 +02:00
|
|
|
msg = "Waiting the delay before I can start a new failover.";
|
|
|
|
break;
|
2015-07-27 14:55:45 +02:00
|
|
|
case CLUSTER_CANT_FAILOVER_EXPIRED:
|
2014-10-07 09:51:55 +02:00
|
|
|
msg = "Failover attempt expired.";
|
|
|
|
break;
|
2015-07-27 14:55:45 +02:00
|
|
|
case CLUSTER_CANT_FAILOVER_WAITING_VOTES:
|
2014-10-07 09:51:55 +02:00
|
|
|
msg = "Waiting for votes, but majority still not reached.";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
msg = "Unknown reason code.";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
lastlog_time = time(NULL);
|
2023-01-11 16:42:23 -08:00
|
|
|
serverLog(LL_NOTICE,"Currently unable to failover: %s", msg);
|
|
|
|
|
|
|
|
int cur_vote = server.cluster->failover_auth_count;
|
|
|
|
int cur_quorum = (server.cluster->size / 2) + 1;
|
|
|
|
/* Emits a log when an election is in progress and waiting for votes or when the failover attempt expired. */
|
|
|
|
if (reason == CLUSTER_CANT_FAILOVER_WAITING_VOTES || reason == CLUSTER_CANT_FAILOVER_EXPIRED) {
|
|
|
|
serverLog(LL_NOTICE, "Needed quorum: %d. Number of votes received so far: %d", cur_quorum, cur_vote);
|
|
|
|
}
|
2014-10-07 09:51:55 +02:00
|
|
|
}
|
|
|
|
|
2015-03-20 17:55:22 +01:00
|
|
|
/* This function implements the final part of automatic and manual failovers,
|
|
|
|
* where the slave grabs its master's hash slots, and propagates the new
|
|
|
|
* configuration.
|
|
|
|
*
|
|
|
|
* Note that it's up to the caller to be sure that the node got a new
|
|
|
|
* configuration epoch already. */
|
|
|
|
void clusterFailoverReplaceYourMaster(void) {
|
|
|
|
int j;
|
|
|
|
clusterNode *oldmaster = myself->slaveof;
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) || oldmaster == NULL) return;
|
2015-03-20 17:55:22 +01:00
|
|
|
|
|
|
|
/* 1) Turn this node into a master. */
|
|
|
|
clusterSetNodeAsMaster(myself);
|
|
|
|
replicationUnsetMaster();
|
|
|
|
|
|
|
|
/* 2) Claim all the slots assigned to our master. */
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2023-11-01 12:37:00 +02:00
|
|
|
if (clusterNodeCoversSlot(oldmaster, j)) {
|
2015-03-20 17:55:22 +01:00
|
|
|
clusterDelSlot(j);
|
|
|
|
clusterAddSlot(myself,j);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* 3) Update state and save config. */
|
|
|
|
clusterUpdateState();
|
|
|
|
clusterSaveConfigOrDie(1);
|
|
|
|
|
|
|
|
/* 4) Pong all the other nodes so that they can update the state
|
|
|
|
* accordingly and detect that we switched to master role. */
|
|
|
|
clusterBroadcastPong(CLUSTER_BROADCAST_ALL);
|
|
|
|
|
|
|
|
/* 5) If there was a manual failover in progress, clear the state. */
|
|
|
|
resetManualFailover();
|
|
|
|
}
|
|
|
|
|
2013-03-13 12:44:02 +01:00
|
|
|
/* This function is called if we are a slave node and our master serving
|
2013-03-14 16:39:02 +01:00
|
|
|
* a non-zero amount of hash slots is in FAIL state.
|
2013-03-13 12:44:02 +01:00
|
|
|
*
|
2021-03-17 09:41:13 -04:00
|
|
|
* The goal of this function is:
|
2013-03-13 12:44:02 +01:00
|
|
|
* 1) To check if we are able to perform a failover, is our data updated?
|
2013-09-26 11:13:17 +02:00
|
|
|
* 2) Try to get elected by masters.
|
2013-09-26 13:00:41 +02:00
|
|
|
* 3) Perform the failover informing all the other nodes.
|
2013-03-13 12:44:02 +01:00
|
|
|
*/
|
|
|
|
void clusterHandleSlaveFailover(void) {
|
2013-10-09 16:18:33 +02:00
|
|
|
mstime_t data_age;
|
2013-09-26 11:13:17 +02:00
|
|
|
mstime_t auth_age = mstime() - server.cluster->failover_auth_time;
|
2013-03-13 13:10:49 +01:00
|
|
|
int needed_quorum = (server.cluster->size / 2) + 1;
|
2014-02-05 16:01:52 +01:00
|
|
|
int manual_failover = server.cluster->mf_end != 0 &&
|
|
|
|
server.cluster->mf_can_start;
|
2014-03-10 09:57:52 +01:00
|
|
|
mstime_t auth_timeout, auth_retry_time;
|
|
|
|
|
2014-05-15 16:33:13 +02:00
|
|
|
server.cluster->todo_before_sleep &= ~CLUSTER_TODO_HANDLE_FAILOVER;
|
|
|
|
|
2014-03-10 09:57:52 +01:00
|
|
|
/* Compute the failover timeout (the max time we have to send votes
|
|
|
|
* and wait for replies), and the failover retry time (the time to wait
|
2014-12-16 15:03:12 +01:00
|
|
|
* before trying to get voted again).
|
2014-03-10 09:57:52 +01:00
|
|
|
*
|
2016-11-29 16:34:41 +08:00
|
|
|
* Timeout is MAX(NODE_TIMEOUT*2,2000) milliseconds.
|
2014-03-10 09:57:52 +01:00
|
|
|
* Retry is two times the Timeout.
|
|
|
|
*/
|
|
|
|
auth_timeout = server.cluster_node_timeout*2;
|
|
|
|
if (auth_timeout < 2000) auth_timeout = 2000;
|
|
|
|
auth_retry_time = auth_timeout*2;
|
2013-03-13 13:10:49 +01:00
|
|
|
|
2014-05-12 16:12:12 +02:00
|
|
|
/* Pre conditions to run the function, that must be met both in case
|
|
|
|
* of an automatic or manual failover:
|
2013-09-26 16:54:43 +02:00
|
|
|
* 1) We are a slave.
|
2014-02-05 13:01:24 +01:00
|
|
|
* 2) Our master is flagged as FAIL, or this is a manual failover.
|
2018-03-14 13:46:36 +01:00
|
|
|
* 3) We don't have the no failover configuration set, and this is
|
|
|
|
* not a manual failover.
|
|
|
|
* 4) It is serving slots. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) ||
|
2014-01-29 11:38:14 +01:00
|
|
|
myself->slaveof == NULL ||
|
2014-02-05 16:01:52 +01:00
|
|
|
(!nodeFailed(myself->slaveof) && !manual_failover) ||
|
2018-03-14 13:46:36 +01:00
|
|
|
(server.cluster_slave_no_failover && !manual_failover) ||
|
2014-10-07 09:51:55 +02:00
|
|
|
myself->slaveof->numslots == 0)
|
|
|
|
{
|
|
|
|
/* There are no reasons to failover, so we set the reason why we
|
|
|
|
* are returning without failing over to NONE. */
|
2015-07-27 14:55:45 +02:00
|
|
|
server.cluster->cant_failover_reason = CLUSTER_CANT_FAILOVER_NONE;
|
2014-10-07 09:51:55 +02:00
|
|
|
return;
|
|
|
|
}
|
2013-09-26 16:54:43 +02:00
|
|
|
|
2021-03-17 09:41:13 -04:00
|
|
|
/* Set data_age to the number of milliseconds we are disconnected from
|
2014-01-30 16:34:23 +01:00
|
|
|
* the master. */
|
2015-07-27 09:41:48 +02:00
|
|
|
if (server.repl_state == REPL_STATE_CONNECTED) {
|
2014-05-12 17:43:36 +02:00
|
|
|
data_age = (mstime_t)(server.unixtime - server.master->lastinteraction)
|
|
|
|
* 1000;
|
2014-01-30 16:34:23 +01:00
|
|
|
} else {
|
2014-05-12 17:43:36 +02:00
|
|
|
data_age = (mstime_t)(server.unixtime - server.repl_down_since) * 1000;
|
2014-01-30 16:34:23 +01:00
|
|
|
}
|
|
|
|
|
2013-09-26 11:13:17 +02:00
|
|
|
/* Remove the node timeout from the data age as it is fine that we are
|
|
|
|
* disconnected from our master at least for the time it was down to be
|
|
|
|
* flagged as FAIL, that's the baseline. */
|
|
|
|
if (data_age > server.cluster_node_timeout)
|
|
|
|
data_age -= server.cluster_node_timeout;
|
|
|
|
|
2014-05-22 16:57:47 +02:00
|
|
|
/* Check if our data is recent enough according to the slave validity
|
|
|
|
* factor configured by the user.
|
2014-05-12 16:12:12 +02:00
|
|
|
*
|
|
|
|
* Check bypassed for manual failovers. */
|
2014-05-22 16:57:47 +02:00
|
|
|
if (server.cluster_slave_validity_factor &&
|
|
|
|
data_age >
|
|
|
|
(((mstime_t)server.repl_ping_slave_period * 1000) +
|
|
|
|
(server.cluster_node_timeout * server.cluster_slave_validity_factor)))
|
2014-05-12 16:12:12 +02:00
|
|
|
{
|
2014-10-07 09:51:55 +02:00
|
|
|
if (!manual_failover) {
|
2015-07-27 14:55:45 +02:00
|
|
|
clusterLogCantFailover(CLUSTER_CANT_FAILOVER_DATA_AGE);
|
2014-10-07 09:51:55 +02:00
|
|
|
return;
|
|
|
|
}
|
2014-05-12 16:12:12 +02:00
|
|
|
}
|
2013-03-13 13:10:49 +01:00
|
|
|
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
/* If the previous failover attempt timeout and the retry time has
|
2014-03-10 09:57:52 +01:00
|
|
|
* elapsed, we can setup a new one. */
|
|
|
|
if (auth_age > auth_retry_time) {
|
2013-09-26 11:13:17 +02:00
|
|
|
server.cluster->failover_auth_time = mstime() +
|
|
|
|
500 + /* Fixed delay of 500 milliseconds, let FAIL msg propagate. */
|
|
|
|
random() % 500; /* Random delay between 0 and 500 milliseconds. */
|
2013-03-13 13:10:49 +01:00
|
|
|
server.cluster->failover_auth_count = 0;
|
2013-09-26 11:13:17 +02:00
|
|
|
server.cluster->failover_auth_sent = 0;
|
2014-01-29 16:51:11 +01:00
|
|
|
server.cluster->failover_auth_rank = clusterGetSlaveRank();
|
|
|
|
/* We add another delay that is proportional to the slave rank.
|
|
|
|
* Specifically 1 second * rank. This way slaves that have a probably
|
|
|
|
* less updated replication offset, are penalized. */
|
|
|
|
server.cluster->failover_auth_time +=
|
|
|
|
server.cluster->failover_auth_rank * 1000;
|
2014-02-05 13:01:24 +01:00
|
|
|
/* However if this is a manual failover, no delay is needed. */
|
|
|
|
if (server.cluster->mf_end) {
|
|
|
|
server.cluster->failover_auth_time = mstime();
|
|
|
|
server.cluster->failover_auth_rank = 0;
|
2023-10-02 16:44:09 -07:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_FAILOVER);
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-01-29 17:16:10 +01:00
|
|
|
"Start of election delayed for %lld milliseconds "
|
|
|
|
"(rank #%d, offset %lld).",
|
2014-01-29 16:51:11 +01:00
|
|
|
server.cluster->failover_auth_time - mstime(),
|
2014-01-29 17:16:10 +01:00
|
|
|
server.cluster->failover_auth_rank,
|
|
|
|
replicationGetSlaveOffset());
|
2014-01-29 17:19:55 +01:00
|
|
|
/* Now that we have a scheduled election, broadcast our offset
|
|
|
|
* to all the other slaves so that they'll updated their offsets
|
|
|
|
* if our offset is better. */
|
|
|
|
clusterBroadcastPong(CLUSTER_BROADCAST_LOCAL_SLAVES);
|
2014-01-29 16:51:11 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* It is possible that we received more updated offsets from other
|
|
|
|
* slaves for the same master since we computed our election delay.
|
2014-05-12 16:12:12 +02:00
|
|
|
* Update the delay if our rank changed.
|
|
|
|
*
|
|
|
|
* Not performed if this is a manual failover. */
|
2014-02-05 13:01:24 +01:00
|
|
|
if (server.cluster->failover_auth_sent == 0 &&
|
|
|
|
server.cluster->mf_end == 0)
|
|
|
|
{
|
2014-01-29 16:51:11 +01:00
|
|
|
int newrank = clusterGetSlaveRank();
|
|
|
|
if (newrank > server.cluster->failover_auth_rank) {
|
|
|
|
long long added_delay =
|
|
|
|
(newrank - server.cluster->failover_auth_rank) * 1000;
|
|
|
|
server.cluster->failover_auth_time += added_delay;
|
|
|
|
server.cluster->failover_auth_rank = newrank;
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2018-09-10 10:49:03 +02:00
|
|
|
"Replica rank updated to #%d, added %lld milliseconds of delay.",
|
2014-01-29 16:51:11 +01:00
|
|
|
newrank, added_delay);
|
|
|
|
}
|
2013-09-26 11:13:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Return ASAP if we can't still start the election. */
|
2014-10-07 09:51:55 +02:00
|
|
|
if (mstime() < server.cluster->failover_auth_time) {
|
2015-07-27 14:55:45 +02:00
|
|
|
clusterLogCantFailover(CLUSTER_CANT_FAILOVER_WAITING_DELAY);
|
2014-10-07 09:51:55 +02:00
|
|
|
return;
|
|
|
|
}
|
2013-09-26 11:13:17 +02:00
|
|
|
|
|
|
|
/* Return ASAP if the election is too old to be valid. */
|
2014-10-07 09:51:55 +02:00
|
|
|
if (auth_age > auth_timeout) {
|
2015-07-27 14:55:45 +02:00
|
|
|
clusterLogCantFailover(CLUSTER_CANT_FAILOVER_EXPIRED);
|
2014-10-07 09:51:55 +02:00
|
|
|
return;
|
|
|
|
}
|
2013-09-26 11:13:17 +02:00
|
|
|
|
|
|
|
/* Ask for votes if needed. */
|
|
|
|
if (server.cluster->failover_auth_sent == 0) {
|
|
|
|
server.cluster->currentEpoch++;
|
|
|
|
server.cluster->failover_auth_epoch = server.cluster->currentEpoch;
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,"Starting a failover election for epoch %llu.",
|
2013-11-05 12:01:07 +01:00
|
|
|
(unsigned long long) server.cluster->currentEpoch);
|
2013-03-14 16:39:02 +01:00
|
|
|
clusterRequestFailoverAuth();
|
2013-09-26 11:13:17 +02:00
|
|
|
server.cluster->failover_auth_sent = 1;
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|
|
|
|
|
CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
2013-03-13 13:10:49 +01:00
|
|
|
return; /* Wait for replies. */
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if we reached the quorum. */
|
2013-03-15 13:20:23 +01:00
|
|
|
if (server.cluster->failover_auth_count >= needed_quorum) {
|
2015-03-20 17:55:22 +01:00
|
|
|
/* We have the quorum, we can finally failover the master. */
|
2013-03-15 16:53:41 +01:00
|
|
|
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2013-09-30 11:51:58 +02:00
|
|
|
"Failover election won: I'm the new master.");
|
2013-03-15 16:11:34 +01:00
|
|
|
|
2015-03-20 17:55:22 +01:00
|
|
|
/* Update my configEpoch to the epoch of the election. */
|
2014-06-10 16:38:36 +02:00
|
|
|
if (myself->configEpoch < server.cluster->failover_auth_epoch) {
|
2014-06-07 14:37:09 +02:00
|
|
|
myself->configEpoch = server.cluster->failover_auth_epoch;
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-06-10 16:38:36 +02:00
|
|
|
"configEpoch set to %llu after successful failover",
|
|
|
|
(unsigned long long) myself->configEpoch);
|
|
|
|
}
|
2013-09-26 11:13:17 +02:00
|
|
|
|
2018-07-01 13:24:50 +08:00
|
|
|
/* Take responsibility for the cluster slots. */
|
2015-03-20 17:55:22 +01:00
|
|
|
clusterFailoverReplaceYourMaster();
|
2014-10-07 09:51:55 +02:00
|
|
|
} else {
|
2015-07-27 14:55:45 +02:00
|
|
|
clusterLogCantFailover(CLUSTER_CANT_FAILOVER_WAITING_VOTES);
|
2013-03-13 13:10:49 +01:00
|
|
|
}
|
2013-03-13 12:44:02 +01:00
|
|
|
}
|
|
|
|
|
2014-01-30 18:05:11 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER slave migration
|
|
|
|
*
|
|
|
|
* Slave migration is the process that allows a slave of a master that is
|
|
|
|
* already covered by at least another slave, to "migrate" to a master that
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* is orphaned, that is, left with no working slaves.
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
* ------------------------------------------------------------------------- */
|
2014-01-30 18:05:11 +01:00
|
|
|
|
|
|
|
/* This function is responsible to decide if this replica should be migrated
|
|
|
|
* to a different (orphaned) master. It is called by the clusterCron() function
|
|
|
|
* only if:
|
|
|
|
*
|
|
|
|
* 1) We are a slave node.
|
|
|
|
* 2) It was detected that there is at least one orphaned master in
|
|
|
|
* the cluster.
|
|
|
|
* 3) We are a slave of one of the masters with the greatest number of
|
|
|
|
* slaves.
|
|
|
|
*
|
|
|
|
* This checks are performed by the caller since it requires to iterate
|
|
|
|
* the nodes anyway, so we spend time into clusterHandleSlaveMigration()
|
|
|
|
* if definitely needed.
|
|
|
|
*
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* The function is called with a pre-computed max_slaves, that is the max
|
2014-01-30 18:05:11 +01:00
|
|
|
* number of working (not in FAIL state) slaves for a single master.
|
|
|
|
*
|
|
|
|
* Additional conditions for migration are examined inside the function.
|
|
|
|
*/
|
|
|
|
void clusterHandleSlaveMigration(int max_slaves) {
|
|
|
|
int j, okslaves = 0;
|
|
|
|
clusterNode *mymaster = myself->slaveof, *target = NULL, *candidate = NULL;
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
/* Step 1: Don't migrate if the cluster state is not ok. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (server.cluster->state != CLUSTER_OK) return;
|
2014-01-30 18:05:11 +01:00
|
|
|
|
2014-01-31 11:12:34 +01:00
|
|
|
/* Step 2: Don't migrate if my master will not be left with at least
|
|
|
|
* 'migration-barrier' slaves after my migration. */
|
2014-01-30 18:05:11 +01:00
|
|
|
if (mymaster == NULL) return;
|
|
|
|
for (j = 0; j < mymaster->numslaves; j++)
|
|
|
|
if (!nodeFailed(mymaster->slaves[j]) &&
|
|
|
|
!nodeTimedOut(mymaster->slaves[j])) okslaves++;
|
2014-01-31 11:12:34 +01:00
|
|
|
if (okslaves <= server.cluster_migration_barrier) return;
|
2014-01-30 18:05:11 +01:00
|
|
|
|
2018-07-01 13:24:50 +08:00
|
|
|
/* Step 3: Identify a candidate for migration, and check if among the
|
2014-01-30 18:05:11 +01:00
|
|
|
* masters with the greatest number of ok slaves, I'm the one with the
|
2015-12-11 09:19:06 +01:00
|
|
|
* smallest node ID (the "candidate slave").
|
2014-01-30 18:05:11 +01:00
|
|
|
*
|
2018-07-01 13:24:50 +08:00
|
|
|
* Note: this means that eventually a replica migration will occur
|
2014-01-30 18:05:11 +01:00
|
|
|
* since slaves that are reachable again always have their FAIL flag
|
2021-05-03 15:18:52 +03:00
|
|
|
* cleared, so eventually there must be a candidate.
|
|
|
|
* There is a possible race condition causing multiple
|
|
|
|
* slaves to migrate at the same time, but this is unlikely to
|
|
|
|
* happen and relatively harmless when it does. */
|
2014-01-30 18:05:11 +01:00
|
|
|
candidate = myself;
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
2015-12-11 09:19:06 +01:00
|
|
|
int okslaves = 0, is_orphaned = 1;
|
2014-01-30 18:05:11 +01:00
|
|
|
|
2015-12-11 09:19:06 +01:00
|
|
|
/* We want to migrate only if this master is working, orphaned, and
|
|
|
|
* used to have slaves or if failed over a master that had slaves
|
|
|
|
* (MIGRATE_TO flag). This way we only migrate to instances that were
|
|
|
|
* supposed to have replicas. */
|
|
|
|
if (nodeIsSlave(node) || nodeFailed(node)) is_orphaned = 0;
|
|
|
|
if (!(node->flags & CLUSTER_NODE_MIGRATE_TO)) is_orphaned = 0;
|
2014-01-30 18:05:11 +01:00
|
|
|
|
2015-12-11 09:19:06 +01:00
|
|
|
/* Check number of working slaves. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(node)) okslaves = clusterCountNonFailingSlaves(node);
|
2015-12-11 09:19:06 +01:00
|
|
|
if (okslaves > 0) is_orphaned = 0;
|
2014-03-25 16:07:14 +01:00
|
|
|
|
2015-12-11 09:19:06 +01:00
|
|
|
if (is_orphaned) {
|
|
|
|
if (!target && node->numslots > 0) target = node;
|
|
|
|
|
|
|
|
/* Track the starting time of the orphaned condition for this
|
|
|
|
* master. */
|
|
|
|
if (!node->orphaned_time) node->orphaned_time = mstime();
|
|
|
|
} else {
|
|
|
|
node->orphaned_time = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Check if I'm the slave candidate for the migration: attached
|
|
|
|
* to a master with the maximum number of slaves and with the smallest
|
|
|
|
* node ID. */
|
2014-01-30 18:05:11 +01:00
|
|
|
if (okslaves == max_slaves) {
|
|
|
|
for (j = 0; j < node->numslaves; j++) {
|
|
|
|
if (memcmp(node->slaves[j]->name,
|
|
|
|
candidate->name,
|
2015-07-27 14:55:45 +02:00
|
|
|
CLUSTER_NAMELEN) < 0)
|
2014-01-30 18:05:11 +01:00
|
|
|
{
|
|
|
|
candidate = node->slaves[j];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2015-01-15 14:20:59 -05:00
|
|
|
dictReleaseIterator(di);
|
2014-01-30 18:05:11 +01:00
|
|
|
|
|
|
|
/* Step 4: perform the migration if there is a target, and if I'm the
|
2015-12-11 09:19:06 +01:00
|
|
|
* candidate, but only if the master is continuously orphaned for a
|
|
|
|
* couple of seconds, so that during failovers, we give some time to
|
|
|
|
* the natural slaves of this instance to advertise their switch from
|
|
|
|
* the old master to the new one. */
|
|
|
|
if (target && candidate == myself &&
|
2018-09-19 11:43:37 +02:00
|
|
|
(mstime()-target->orphaned_time) > CLUSTER_SLAVE_MIGRATION_DELAY &&
|
|
|
|
!(server.cluster_module_flags & CLUSTER_MODULE_FLAG_NO_FAILOVER))
|
2015-12-11 09:19:06 +01:00
|
|
|
{
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,"Migrating to orphaned master %.40s",
|
2014-01-30 18:05:11 +01:00
|
|
|
target->name);
|
|
|
|
clusterSetMaster(target);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-05 13:01:24 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER manual failover
|
|
|
|
*
|
|
|
|
* This are the important steps performed by slaves during a manual failover:
|
|
|
|
* 1) User send CLUSTER FAILOVER command. The failover state is initialized
|
|
|
|
* setting mf_end to the millisecond unix time at which we'll abort the
|
|
|
|
* attempt.
|
|
|
|
* 2) Slave sends a MFSTART message to the master requesting to pause clients
|
2015-07-27 14:55:45 +02:00
|
|
|
* for two times the manual failover timeout CLUSTER_MF_TIMEOUT.
|
2014-02-05 13:01:24 +01:00
|
|
|
* When master is paused for manual failover, it also starts to flag
|
|
|
|
* packets with CLUSTERMSG_FLAG0_PAUSED.
|
|
|
|
* 3) Slave waits for master to send its replication offset flagged as PAUSED.
|
|
|
|
* 4) If slave received the offset from the master, and its offset matches,
|
|
|
|
* mf_can_start is set to 1, and clusterHandleSlaveFailover() will perform
|
|
|
|
* the failover as usually, with the difference that the vote request
|
|
|
|
* will be modified to force masters to vote for a slave that has a
|
|
|
|
* working master.
|
|
|
|
*
|
|
|
|
* From the point of view of the master things are simpler: when a
|
|
|
|
* PAUSE_CLIENTS packet is received the master sets mf_end as well and
|
|
|
|
* the sender in mf_slave. During the time limit for the manual failover
|
|
|
|
* the master will just send PINGs more often to this slave, flagged with
|
|
|
|
* the PAUSED flag, so that the slave will set mf_master_offset when receiving
|
|
|
|
* a packet from the master with this flag set.
|
|
|
|
*
|
2021-04-25 20:50:15 +08:00
|
|
|
* The goal of the manual failover is to perform a fast failover without
|
2014-02-05 13:01:24 +01:00
|
|
|
* data loss due to the asynchronous master-slave replication.
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
/* Reset the manual failover state. This works for both masters and slaves
|
2014-02-05 13:01:24 +01:00
|
|
|
* as all the state about manual failover is cleared.
|
|
|
|
*
|
|
|
|
* The function can be used both to initialize the manual failover state at
|
|
|
|
* startup or to abort a manual failover in progress. */
|
|
|
|
void resetManualFailover(void) {
|
2021-11-17 21:28:13 -08:00
|
|
|
if (server.cluster->mf_slave) {
|
2022-10-27 11:57:04 +03:00
|
|
|
/* We were a master failing over, so we paused clients and related actions.
|
|
|
|
* Regardless of the outcome we unpause now to allow traffic again. */
|
|
|
|
unpauseActions(PAUSE_DURING_FAILOVER);
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
|
|
|
server.cluster->mf_end = 0; /* No manual failover in progress. */
|
|
|
|
server.cluster->mf_can_start = 0;
|
|
|
|
server.cluster->mf_slave = NULL;
|
2021-03-23 11:00:33 +08:00
|
|
|
server.cluster->mf_master_offset = -1;
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* If a manual failover timed out, abort it. */
|
|
|
|
void manualFailoverCheckTimeout(void) {
|
2014-02-05 15:45:15 +01:00
|
|
|
if (server.cluster->mf_end && server.cluster->mf_end < mstime()) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_WARNING,"Manual failover timed out.");
|
2014-02-05 13:01:24 +01:00
|
|
|
resetManualFailover();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called from the cluster cron function in order to go
|
|
|
|
* forward with a manual failover state machine. */
|
|
|
|
void clusterHandleManualFailover(void) {
|
|
|
|
/* Return ASAP if no manual failover is in progress. */
|
|
|
|
if (server.cluster->mf_end == 0) return;
|
|
|
|
|
2014-07-31 14:51:05 -04:00
|
|
|
/* If mf_can_start is non-zero, the failover was already triggered so the
|
2014-02-05 13:01:24 +01:00
|
|
|
* next steps are performed by clusterHandleSlaveFailover(). */
|
|
|
|
if (server.cluster->mf_can_start) return;
|
|
|
|
|
2021-03-23 11:00:33 +08:00
|
|
|
if (server.cluster->mf_master_offset == -1) return; /* Wait for offset... */
|
2014-02-05 13:01:24 +01:00
|
|
|
|
|
|
|
if (server.cluster->mf_master_offset == replicationGetSlaveOffset()) {
|
|
|
|
/* Our replication offset matches the master replication offset
|
|
|
|
* announced after clients were paused. We can start the failover. */
|
|
|
|
server.cluster->mf_can_start = 1;
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE,
|
2014-03-25 16:07:14 +01:00
|
|
|
"All master replication stream processed, "
|
|
|
|
"manual failover can start.");
|
2020-10-27 14:13:59 +08:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_FAILOVER);
|
|
|
|
return;
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
2020-10-27 14:13:59 +08:00
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_MANUALFAILOVER);
|
2014-02-05 13:01:24 +01:00
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER cron job
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2021-07-29 17:31:51 -07:00
|
|
|
/* Check if the node is disconnected and re-establish the connection.
|
|
|
|
* Also update a few stats while we are here, that can be used to make
|
|
|
|
* better decisions in other part of the code. */
|
2021-12-16 21:56:59 -08:00
|
|
|
static int clusterNodeCronHandleReconnect(clusterNode *node, mstime_t handshake_timeout, mstime_t now) {
|
2021-07-29 17:31:51 -07:00
|
|
|
/* Not interested in reconnecting the link with myself or nodes
|
|
|
|
* for which we have no address. */
|
|
|
|
if (node->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_NOADDR)) return 1;
|
|
|
|
|
|
|
|
if (node->flags & CLUSTER_NODE_PFAIL)
|
|
|
|
server.cluster->stats_pfail_nodes++;
|
|
|
|
|
|
|
|
/* A Node in HANDSHAKE state has a limited lifespan equal to the
|
|
|
|
* configured node timeout. */
|
|
|
|
if (nodeInHandshake(node) && now - node->ctime > handshake_timeout) {
|
|
|
|
clusterDelNode(node);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (node->link == NULL) {
|
|
|
|
clusterLink *link = createClusterLink(node);
|
2022-07-27 10:46:31 +08:00
|
|
|
link->conn = connCreate(connTypeOfCluster());
|
2021-07-29 17:31:51 -07:00
|
|
|
connSetPrivateData(link->conn, link);
|
|
|
|
if (connConnect(link->conn, node->ip, node->cport, server.bind_source_addr,
|
2022-11-26 03:58:19 +08:00
|
|
|
clusterLinkConnectHandler) == C_ERR) {
|
2021-07-29 17:31:51 -07:00
|
|
|
/* We got a synchronous error from connect before
|
|
|
|
* clusterSendPing() had a chance to be called.
|
|
|
|
* If node->ping_sent is zero, failure detection can't work,
|
|
|
|
* so we claim we actually sent a ping now (that will
|
|
|
|
* be really sent as soon as the link is obtained). */
|
|
|
|
if (node->ping_sent == 0) node->ping_sent = mstime();
|
|
|
|
serverLog(LL_DEBUG, "Unable to connect to "
|
|
|
|
"Cluster Node [%s]:%d -> %s", node->ip,
|
|
|
|
node->cport, server.neterr);
|
|
|
|
|
|
|
|
freeClusterLink(link);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
static void freeClusterLinkOnBufferLimitReached(clusterLink *link) {
|
2022-11-01 22:26:44 -04:00
|
|
|
if (link == NULL || server.cluster_link_msg_queue_limit_bytes == 0) {
|
2021-12-16 21:56:59 -08:00
|
|
|
return;
|
|
|
|
}
|
2022-11-01 22:26:44 -04:00
|
|
|
|
|
|
|
unsigned long long mem_link = link->send_msg_queue_mem;
|
|
|
|
if (mem_link > server.cluster_link_msg_queue_limit_bytes) {
|
2021-12-31 09:32:33 -08:00
|
|
|
serverLog(LL_WARNING, "Freeing cluster link(%s node %.40s, used memory: %llu) due to "
|
2021-12-16 21:56:59 -08:00
|
|
|
"exceeding send buffer memory limit.", link->inbound ? "from" : "to",
|
|
|
|
link->node ? link->node->name : "", mem_link);
|
|
|
|
freeClusterLink(link);
|
|
|
|
server.cluster->stat_cluster_links_buffer_limit_exceeded++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Free outbound link to a node if its send buffer size exceeded limit. */
|
|
|
|
static void clusterNodeCronFreeLinkOnBufferLimitReached(clusterNode *node) {
|
|
|
|
freeClusterLinkOnBufferLimitReached(node->link);
|
|
|
|
freeClusterLinkOnBufferLimitReached(node->inbound_link);
|
|
|
|
}
|
|
|
|
|
2013-10-09 16:18:33 +02:00
|
|
|
/* This is executed 10 times every second */
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterCron(void) {
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
2014-01-30 18:05:11 +01:00
|
|
|
int update_state = 0;
|
|
|
|
int orphaned_masters; /* How many masters there are without ok slaves. */
|
|
|
|
int max_slaves; /* Max number of ok slaves for a single master. */
|
|
|
|
int this_slaves; /* Number of ok slaves for our master (if we are slave). */
|
2013-10-09 16:18:33 +02:00
|
|
|
mstime_t min_pong = 0, now = mstime();
|
2013-04-11 18:55:58 +02:00
|
|
|
clusterNode *min_pong_node = NULL;
|
2013-10-09 16:29:14 +02:00
|
|
|
static unsigned long long iteration = 0;
|
2013-10-11 10:34:32 +02:00
|
|
|
mstime_t handshake_timeout;
|
2013-10-09 16:29:14 +02:00
|
|
|
|
|
|
|
iteration++; /* Number of times this function was called so far. */
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2022-02-16 13:35:49 -08:00
|
|
|
clusterUpdateMyselfHostname();
|
|
|
|
|
2013-12-05 16:35:32 +01:00
|
|
|
/* The handshake timeout is the time after which a handshake node that was
|
2013-10-11 10:34:32 +02:00
|
|
|
* not turned into a normal node is removed from the nodes. Usually it is
|
|
|
|
* just the NODE_TIMEOUT value, but when NODE_TIMEOUT is too small we use
|
|
|
|
* the value of 1 second. */
|
|
|
|
handshake_timeout = server.cluster_node_timeout;
|
|
|
|
if (handshake_timeout < 1000) handshake_timeout = 1000;
|
|
|
|
|
2021-07-29 17:31:51 -07:00
|
|
|
/* Clear so clusterNodeCronHandleReconnect can count the number of nodes in PFAIL. */
|
2017-04-14 13:39:49 +02:00
|
|
|
server.cluster->stats_pfail_nodes = 0;
|
2021-07-29 17:31:51 -07:00
|
|
|
/* Run through some of the operations we want to do on each cluster node. */
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2011-03-29 17:51:15 +02:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
2011-11-08 17:07:55 +01:00
|
|
|
clusterNode *node = dictGetVal(de);
|
2022-11-01 22:26:44 -04:00
|
|
|
/* We free the inbound or outboud link to the node if the link has an
|
|
|
|
* oversized message send queue and immediately try reconnecting. */
|
2021-12-16 21:56:59 -08:00
|
|
|
clusterNodeCronFreeLinkOnBufferLimitReached(node);
|
|
|
|
/* The protocol is that function(s) below return non-zero if the node was
|
|
|
|
* terminated.
|
|
|
|
*/
|
2021-07-29 17:31:51 -07:00
|
|
|
if(clusterNodeCronHandleReconnect(node, handshake_timeout, now)) continue;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2021-07-29 17:31:51 -07:00
|
|
|
dictReleaseIterator(di);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-10-09 16:29:14 +02:00
|
|
|
/* Ping some random node 1 time every 10 iterations, so that we usually ping
|
|
|
|
* one random node every second. */
|
|
|
|
if (!(iteration % 10)) {
|
2014-01-30 18:05:11 +01:00
|
|
|
int j;
|
|
|
|
|
2013-10-09 16:29:14 +02:00
|
|
|
/* Check a few random nodes and ping the one with the oldest
|
|
|
|
* pong_received time. */
|
|
|
|
for (j = 0; j < 5; j++) {
|
|
|
|
de = dictGetRandomKey(server.cluster->nodes);
|
|
|
|
clusterNode *this = dictGetVal(de);
|
|
|
|
|
|
|
|
/* Don't ping nodes disconnected or with a ping currently active. */
|
|
|
|
if (this->link == NULL || this->ping_sent != 0) continue;
|
2015-07-27 14:55:45 +02:00
|
|
|
if (this->flags & (CLUSTER_NODE_MYSELF|CLUSTER_NODE_HANDSHAKE))
|
2014-03-25 16:07:14 +01:00
|
|
|
continue;
|
2013-10-09 16:29:14 +02:00
|
|
|
if (min_pong_node == NULL || min_pong > this->pong_received) {
|
|
|
|
min_pong_node = this;
|
|
|
|
min_pong = this->pong_received;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (min_pong_node) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_DEBUG,"Pinging node %.40s", min_pong_node->name);
|
2013-10-09 16:29:14 +02:00
|
|
|
clusterSendPing(min_pong_node->link, CLUSTERMSG_TYPE_PING);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-01-30 18:05:11 +01:00
|
|
|
/* Iterate nodes to check if we need to flag something as failing.
|
|
|
|
* This loop is also responsible to:
|
|
|
|
* 1) Check if there are orphaned masters (masters without non failing
|
|
|
|
* slaves).
|
|
|
|
* 2) Count the max number of non failing slaves for a single master.
|
|
|
|
* 3) Count the number of slaves for our master, if we are a slave. */
|
|
|
|
orphaned_masters = 0;
|
|
|
|
max_slaves = 0;
|
|
|
|
this_slaves = 0;
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2011-03-29 17:51:15 +02:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
2011-11-08 17:07:55 +01:00
|
|
|
clusterNode *node = dictGetVal(de);
|
2013-10-09 16:18:33 +02:00
|
|
|
now = mstime(); /* Use an updated time at every iteration. */
|
2011-03-29 17:51:15 +02:00
|
|
|
|
|
|
|
if (node->flags &
|
2015-07-27 14:55:45 +02:00
|
|
|
(CLUSTER_NODE_MYSELF|CLUSTER_NODE_NOADDR|CLUSTER_NODE_HANDSHAKE))
|
2011-04-07 23:10:32 +02:00
|
|
|
continue;
|
2013-03-05 12:13:39 +01:00
|
|
|
|
2014-01-30 18:23:31 +01:00
|
|
|
/* Orphaned master check, useful only if the current instance
|
|
|
|
* is a slave that may migrate to another master. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (nodeIsSlave(myself) && clusterNodeIsMaster(node) && !nodeFailed(node)) {
|
2014-01-30 18:23:31 +01:00
|
|
|
int okslaves = clusterCountNonFailingSlaves(node);
|
|
|
|
|
2014-07-25 11:02:09 +02:00
|
|
|
/* A master is orphaned if it is serving a non-zero number of
|
|
|
|
* slots, have no working slaves, but used to have at least one
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
* slave, or failed over a master that used to have slaves. */
|
|
|
|
if (okslaves == 0 && node->numslots > 0 &&
|
|
|
|
node->flags & CLUSTER_NODE_MIGRATE_TO)
|
|
|
|
{
|
2014-07-25 11:02:09 +02:00
|
|
|
orphaned_masters++;
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
}
|
2014-01-30 18:23:31 +01:00
|
|
|
if (okslaves > max_slaves) max_slaves = okslaves;
|
2022-06-06 13:17:18 +08:00
|
|
|
if (myself->slaveof == node)
|
2014-01-30 18:23:31 +01:00
|
|
|
this_slaves = okslaves;
|
|
|
|
}
|
|
|
|
|
2020-05-08 11:38:07 +02:00
|
|
|
/* If we are not receiving any data for more than half the cluster
|
2013-04-11 18:55:58 +02:00
|
|
|
* timeout, reconnect the link: maybe there is a connection
|
|
|
|
* issue even if the node is alive. */
|
2020-05-08 18:10:16 +02:00
|
|
|
mstime_t ping_delay = now - node->ping_sent;
|
|
|
|
mstime_t data_delay = now - node->data_received;
|
2013-04-11 18:55:58 +02:00
|
|
|
if (node->link && /* is connected */
|
2013-10-09 16:18:33 +02:00
|
|
|
now - node->link->ctime >
|
2013-05-03 12:37:45 +02:00
|
|
|
server.cluster_node_timeout && /* was not already reconnected */
|
2013-04-11 18:55:58 +02:00
|
|
|
node->ping_sent && /* we already sent a ping */
|
|
|
|
/* and we are waiting for the pong more than timeout/2 */
|
2020-05-08 18:10:16 +02:00
|
|
|
ping_delay > server.cluster_node_timeout/2 &&
|
2020-05-08 11:38:07 +02:00
|
|
|
/* and in such interval we are not seeing any traffic at all. */
|
2020-05-08 18:10:16 +02:00
|
|
|
data_delay > server.cluster_node_timeout/2)
|
2013-04-11 18:55:58 +02:00
|
|
|
{
|
|
|
|
/* Disconnect the link, it will be reconnected automatically. */
|
|
|
|
freeClusterLink(node->link);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If we have currently no active ping in this instance, and the
|
|
|
|
* received PONG is older than half the cluster timeout, send
|
|
|
|
* a new ping now, to ensure all the nodes are pinged without
|
|
|
|
* a too big delay. */
|
2022-10-02 23:25:16 -07:00
|
|
|
mstime_t ping_interval = server.cluster_ping_interval ?
|
|
|
|
server.cluster_ping_interval : server.cluster_node_timeout/2;
|
2013-03-05 12:13:39 +01:00
|
|
|
if (node->link &&
|
2013-04-11 18:55:58 +02:00
|
|
|
node->ping_sent == 0 &&
|
2022-10-02 23:25:16 -07:00
|
|
|
(now - node->pong_received) > ping_interval)
|
2013-03-05 12:13:39 +01:00
|
|
|
{
|
|
|
|
clusterSendPing(node->link, CLUSTERMSG_TYPE_PING);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-02-05 13:01:24 +01:00
|
|
|
/* If we are a master and one of the slaves requested a manual
|
|
|
|
* failover, ping it continuously. */
|
|
|
|
if (server.cluster->mf_end &&
|
2023-11-09 11:04:47 +02:00
|
|
|
clusterNodeIsMaster(myself) &&
|
2014-02-05 13:01:24 +01:00
|
|
|
server.cluster->mf_slave == node &&
|
|
|
|
node->link)
|
|
|
|
{
|
|
|
|
clusterSendPing(node->link, CLUSTERMSG_TYPE_PING);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2013-04-11 18:55:58 +02:00
|
|
|
/* Check only if we have an active ping for this instance. */
|
|
|
|
if (node->ping_sent == 0) continue;
|
2013-04-08 19:40:20 +02:00
|
|
|
|
2020-05-08 18:10:16 +02:00
|
|
|
/* Check if this node looks unreachable.
|
|
|
|
* Note that if we already received the PONG, then node->ping_sent
|
|
|
|
* is zero, so can't reach this code at all, so we don't risk of
|
|
|
|
* checking for a PONG delay if we didn't sent the PING.
|
|
|
|
*
|
|
|
|
* We also consider every incoming data as proof of liveness, since
|
2020-05-08 11:38:07 +02:00
|
|
|
* our cluster bus link is also used for data: under heavy data
|
|
|
|
* load pong delays are possible. */
|
2020-05-08 18:10:16 +02:00
|
|
|
mstime_t node_delay = (ping_delay < data_delay) ? ping_delay :
|
|
|
|
data_delay;
|
2013-02-26 15:15:44 +01:00
|
|
|
|
2020-05-08 18:10:16 +02:00
|
|
|
if (node_delay > server.cluster_node_timeout) {
|
2013-01-17 01:00:20 +08:00
|
|
|
/* Timeout reached. Set the node as possibly failing if it is
|
2011-04-07 23:06:01 +02:00
|
|
|
* not already in this state. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (!(node->flags & (CLUSTER_NODE_PFAIL|CLUSTER_NODE_FAIL))) {
|
2015-07-27 09:41:48 +02:00
|
|
|
serverLog(LL_DEBUG,"*** NODE %.40s possibly failing",
|
2011-03-29 17:51:15 +02:00
|
|
|
node->name);
|
2015-07-27 14:55:45 +02:00
|
|
|
node->flags |= CLUSTER_NODE_PFAIL;
|
2013-03-07 15:40:53 +01:00
|
|
|
update_state = 1;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
2013-03-05 16:12:08 +01:00
|
|
|
|
|
|
|
/* If we are a slave node but the replication is still turned off,
|
|
|
|
* enable it if we know the address of our master and it appears to
|
|
|
|
* be up. */
|
2014-01-29 12:17:16 +01:00
|
|
|
if (nodeIsSlave(myself) &&
|
2013-03-05 16:12:08 +01:00
|
|
|
server.masterhost == NULL &&
|
2014-01-29 11:38:14 +01:00
|
|
|
myself->slaveof &&
|
2014-01-29 12:17:16 +01:00
|
|
|
nodeHasAddr(myself->slaveof))
|
2013-03-05 16:12:08 +01:00
|
|
|
{
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
replicationSetMaster(myself->slaveof->ip, getNodeDefaultReplicationPort(myself->slaveof));
|
2013-03-05 16:12:08 +01:00
|
|
|
}
|
2013-03-07 15:40:53 +01:00
|
|
|
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
/* Abort a manual failover if the timeout is reached. */
|
2014-02-05 13:01:24 +01:00
|
|
|
manualFailoverCheckTimeout();
|
|
|
|
|
2014-01-30 18:05:11 +01:00
|
|
|
if (nodeIsSlave(myself)) {
|
2014-02-05 13:01:24 +01:00
|
|
|
clusterHandleManualFailover();
|
2018-09-19 11:43:37 +02:00
|
|
|
if (!(server.cluster_module_flags & CLUSTER_MODULE_FLAG_NO_FAILOVER))
|
|
|
|
clusterHandleSlaveFailover();
|
2014-01-30 18:05:11 +01:00
|
|
|
/* If there are orphaned slaves, and we are a slave among the masters
|
|
|
|
* with the max number of non-failing slaves, consider migrating to
|
|
|
|
* the orphaned masters. Note that it does not make sense to try
|
|
|
|
* a migration if there is no master with at least *two* working
|
|
|
|
* slaves. */
|
2021-04-04 09:43:24 +03:00
|
|
|
if (orphaned_masters && max_slaves >= 2 && this_slaves == max_slaves &&
|
2023-10-02 16:44:09 -07:00
|
|
|
server.cluster_allow_replica_migration)
|
2014-01-30 18:05:11 +01:00
|
|
|
clusterHandleSlaveMigration(max_slaves);
|
|
|
|
}
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
if (update_state || server.cluster->state == CLUSTER_FAIL)
|
2014-01-15 12:26:12 +01:00
|
|
|
clusterUpdateState();
|
2013-09-26 16:54:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This function is called before the event handler returns to sleep for
|
|
|
|
* events. It is useful to perform operations that must be done ASAP in
|
|
|
|
* reaction to events fired but that are not safe to perform inside event
|
2013-10-03 09:55:20 +02:00
|
|
|
* handlers, or to perform potentially expansive tasks that we need to do
|
|
|
|
* a single time before replying to clients. */
|
2013-09-26 16:54:43 +02:00
|
|
|
void clusterBeforeSleep(void) {
|
2020-10-27 14:13:59 +08:00
|
|
|
int flags = server.cluster->todo_before_sleep;
|
|
|
|
|
|
|
|
/* Reset our flags (not strictly needed since every single function
|
|
|
|
* called for flags set should be able to clear its flag). */
|
|
|
|
server.cluster->todo_before_sleep = 0;
|
|
|
|
|
|
|
|
if (flags & CLUSTER_TODO_HANDLE_MANUALFAILOVER) {
|
|
|
|
/* Handle manual failover as soon as possible so that won't have a 100ms
|
|
|
|
* as it was handled only in clusterCron */
|
|
|
|
if(nodeIsSlave(myself)) {
|
|
|
|
clusterHandleManualFailover();
|
|
|
|
if (!(server.cluster_module_flags & CLUSTER_MODULE_FLAG_NO_FAILOVER))
|
|
|
|
clusterHandleSlaveFailover();
|
|
|
|
}
|
|
|
|
} else if (flags & CLUSTER_TODO_HANDLE_FAILOVER) {
|
|
|
|
/* Handle failover, this is needed when it is likely that there is already
|
|
|
|
* the quorum from masters in order to react fast. */
|
2013-03-13 12:44:02 +01:00
|
|
|
clusterHandleSlaveFailover();
|
2020-10-27 14:13:59 +08:00
|
|
|
}
|
2013-10-03 09:55:20 +02:00
|
|
|
|
|
|
|
/* Update the cluster state. */
|
2020-10-27 14:13:59 +08:00
|
|
|
if (flags & CLUSTER_TODO_UPDATE_STATE)
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterUpdateState();
|
|
|
|
|
|
|
|
/* Save the config, possibly using fsync. */
|
2020-10-27 14:13:59 +08:00
|
|
|
if (flags & CLUSTER_TODO_SAVE_CONFIG) {
|
|
|
|
int fsync = flags & CLUSTER_TODO_FSYNC_CONFIG;
|
2013-10-03 09:55:20 +02:00
|
|
|
clusterSaveConfigOrDie(fsync);
|
2013-03-13 12:44:02 +01:00
|
|
|
}
|
2013-10-03 09:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void clusterDoBeforeSleep(int flags) {
|
|
|
|
server.cluster->todo_before_sleep |= flags;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* Slots management
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2013-10-08 12:45:35 +02:00
|
|
|
/* Test bit 'pos' in a generic bitmap. Return 1 if the bit is set,
|
2013-02-28 15:23:09 +01:00
|
|
|
* otherwise 0. */
|
|
|
|
int bitmapTestBit(unsigned char *bitmap, int pos) {
|
|
|
|
off_t byte = pos/8;
|
|
|
|
int bit = pos&7;
|
|
|
|
return (bitmap[byte] & (1<<bit)) != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Set the bit at position 'pos' in a bitmap. */
|
|
|
|
void bitmapSetBit(unsigned char *bitmap, int pos) {
|
|
|
|
off_t byte = pos/8;
|
|
|
|
int bit = pos&7;
|
|
|
|
bitmap[byte] |= 1<<bit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear the bit at position 'pos' in a bitmap. */
|
|
|
|
void bitmapClearBit(unsigned char *bitmap, int pos) {
|
|
|
|
off_t byte = pos/8;
|
|
|
|
int bit = pos&7;
|
|
|
|
bitmap[byte] &= ~(1<<bit);
|
|
|
|
}
|
|
|
|
|
2016-05-02 16:41:56 +02:00
|
|
|
/* Return non-zero if there is at least one master with slaves in the cluster.
|
|
|
|
* Otherwise zero is returned. Used by clusterNodeSetSlotBit() to set the
|
|
|
|
* MIGRATE_TO flag the when a master gets the first slot. */
|
|
|
|
int clusterMastersHaveSlaves(void) {
|
|
|
|
dictIterator *di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
dictEntry *de;
|
|
|
|
int slaves = 0;
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
|
|
|
if (nodeIsSlave(node)) continue;
|
|
|
|
slaves += node->numslaves;
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
return slaves != 0;
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* Set the slot bit and return the old value. */
|
|
|
|
int clusterNodeSetSlotBit(clusterNode *n, int slot) {
|
2013-02-28 15:23:09 +01:00
|
|
|
int old = bitmapTestBit(n->slots,slot);
|
2016-05-02 16:41:56 +02:00
|
|
|
if (!old) {
|
2022-11-26 03:58:19 +08:00
|
|
|
bitmapSetBit(n->slots,slot);
|
2016-05-02 16:41:56 +02:00
|
|
|
n->numslots++;
|
|
|
|
/* When a master gets its first slot, even if it has no slaves,
|
|
|
|
* it gets flagged with MIGRATE_TO, that is, the master is a valid
|
|
|
|
* target for replicas migration, if and only if at least one of
|
|
|
|
* the other masters has slaves right now.
|
|
|
|
*
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* Normally masters are valid targets of replica migration if:
|
2016-05-02 16:41:56 +02:00
|
|
|
* 1. The used to have slaves (but no longer have).
|
|
|
|
* 2. They are slaves failing over a master that used to have slaves.
|
|
|
|
*
|
|
|
|
* However new masters with slots assigned are considered valid
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* migration targets if the rest of the cluster is not a slave-less.
|
2016-05-02 16:41:56 +02:00
|
|
|
*
|
2021-04-06 17:29:02 +08:00
|
|
|
* See https://github.com/redis/redis/issues/3043 for more info. */
|
2016-05-02 16:41:56 +02:00
|
|
|
if (n->numslots == 1 && clusterMastersHaveSlaves())
|
|
|
|
n->flags |= CLUSTER_NODE_MIGRATE_TO;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
return old;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Clear the slot bit and return the old value. */
|
|
|
|
int clusterNodeClearSlotBit(clusterNode *n, int slot) {
|
2013-02-28 15:23:09 +01:00
|
|
|
int old = bitmapTestBit(n->slots,slot);
|
2022-11-26 03:58:19 +08:00
|
|
|
if (old) {
|
|
|
|
bitmapClearBit(n->slots,slot);
|
|
|
|
n->numslots--;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
return old;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return the slot bit from the cluster node structure. */
|
2023-11-01 12:37:00 +02:00
|
|
|
int clusterNodeCoversSlot(clusterNode *n, int slot) {
|
2013-02-28 15:23:09 +01:00
|
|
|
return bitmapTestBit(n->slots,slot);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add the specified slot to the list of slots that node 'n' will
|
2015-07-26 23:17:55 +02:00
|
|
|
* serve. Return C_OK if the operation ended with success.
|
2011-03-29 17:51:15 +02:00
|
|
|
* If the slot is already assigned to another instance this is considered
|
2015-07-26 23:17:55 +02:00
|
|
|
* an error and C_ERR is returned. */
|
2011-03-29 17:51:15 +02:00
|
|
|
int clusterAddSlot(clusterNode *n, int slot) {
|
2015-07-26 23:17:55 +02:00
|
|
|
if (server.cluster->slots[slot]) return C_ERR;
|
2013-02-21 11:51:17 +01:00
|
|
|
clusterNodeSetSlotBit(n,slot);
|
2013-02-14 13:20:56 +01:00
|
|
|
server.cluster->slots[slot] = n;
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2011-05-06 13:38:27 +02:00
|
|
|
/* Delete the specified slot marking it as unassigned.
|
2015-07-26 23:17:55 +02:00
|
|
|
* Returns C_OK if the slot was assigned, otherwise if the slot was
|
|
|
|
* already unassigned C_ERR is returned. */
|
2011-05-06 13:38:27 +02:00
|
|
|
int clusterDelSlot(int slot) {
|
2013-02-14 13:20:56 +01:00
|
|
|
clusterNode *n = server.cluster->slots[slot];
|
2011-05-06 13:38:27 +02:00
|
|
|
|
2015-07-26 23:17:55 +02:00
|
|
|
if (!n) return C_ERR;
|
2022-01-03 01:54:47 +01:00
|
|
|
|
|
|
|
/* Cleanup the channels in master/replica as part of slot deletion. */
|
2023-10-12 00:15:25 -05:00
|
|
|
removeChannelsInSlot(slot);
|
|
|
|
/* Clear the slot bit. */
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(clusterNodeClearSlotBit(n,slot) == 1);
|
2013-02-14 13:20:56 +01:00
|
|
|
server.cluster->slots[slot] = NULL;
|
2023-09-26 14:03:27 -07:00
|
|
|
/* Make owner_not_claiming_slot flag consistent with slot ownership information. */
|
|
|
|
bitmapClearBit(server.cluster->owner_not_claiming_slot, slot);
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2011-05-06 13:38:27 +02:00
|
|
|
}
|
|
|
|
|
2013-03-15 16:35:16 +01:00
|
|
|
/* Delete all the slots associated with the specified node.
|
|
|
|
* The number of deleted slots is returned. */
|
|
|
|
int clusterDelNodeSlots(clusterNode *node) {
|
|
|
|
int deleted = 0, j;
|
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2023-11-01 12:37:00 +02:00
|
|
|
if (clusterNodeCoversSlot(node, j)) {
|
2017-07-20 17:24:38 +08:00
|
|
|
clusterDelSlot(j);
|
|
|
|
deleted++;
|
|
|
|
}
|
2013-03-15 16:35:16 +01:00
|
|
|
}
|
|
|
|
return deleted;
|
|
|
|
}
|
|
|
|
|
2014-03-11 11:16:18 +01:00
|
|
|
/* Clear the migrating / importing state for all the slots.
|
|
|
|
* This is useful at initialization and when turning a master into slave. */
|
|
|
|
void clusterCloseAllSlots(void) {
|
|
|
|
memset(server.cluster->migrating_slots_to,0,
|
|
|
|
sizeof(server.cluster->migrating_slots_to));
|
|
|
|
memset(server.cluster->importing_slots_from,0,
|
|
|
|
sizeof(server.cluster->importing_slots_from));
|
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* Cluster state evaluation function
|
|
|
|
* -------------------------------------------------------------------------- */
|
2013-12-20 09:56:18 +01:00
|
|
|
|
2014-01-20 11:52:52 +01:00
|
|
|
/* The following are defines that are only used in the evaluation function
|
2018-07-01 13:24:50 +08:00
|
|
|
* and are based on heuristics. Actually the main point about the rejoin and
|
2014-01-20 11:52:52 +01:00
|
|
|
* writable delay is that they should be a few orders of magnitude larger
|
|
|
|
* than the network latency. */
|
2015-07-27 14:55:45 +02:00
|
|
|
#define CLUSTER_MAX_REJOIN_DELAY 5000
|
|
|
|
#define CLUSTER_MIN_REJOIN_DELAY 500
|
|
|
|
#define CLUSTER_WRITABLE_DELAY 2000
|
2013-12-20 09:56:18 +01:00
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
void clusterUpdateState(void) {
|
2013-12-20 09:56:18 +01:00
|
|
|
int j, new_state;
|
2014-10-08 16:27:07 +02:00
|
|
|
int reachable_masters = 0;
|
2013-12-20 09:56:18 +01:00
|
|
|
static mstime_t among_minority_time;
|
2014-01-20 11:52:52 +01:00
|
|
|
static mstime_t first_call_time = 0;
|
|
|
|
|
2014-05-15 16:33:13 +02:00
|
|
|
server.cluster->todo_before_sleep &= ~CLUSTER_TODO_UPDATE_STATE;
|
|
|
|
|
2014-01-20 11:52:52 +01:00
|
|
|
/* If this is a master node, wait some time before turning the state
|
|
|
|
* into OK, since it is not a good idea to rejoin the cluster as a writable
|
|
|
|
* master, after a reboot, without giving the cluster a chance to
|
|
|
|
* reconfigure this node. Note that the delay is calculated starting from
|
|
|
|
* the first call to this function and not since the server start, in order
|
2021-05-03 15:18:52 +03:00
|
|
|
* to not count the DB loading time. */
|
2014-01-20 11:52:52 +01:00
|
|
|
if (first_call_time == 0) first_call_time = mstime();
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) &&
|
2015-07-27 14:55:45 +02:00
|
|
|
server.cluster->state == CLUSTER_FAIL &&
|
|
|
|
mstime() - first_call_time < CLUSTER_WRITABLE_DELAY) return;
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2013-03-06 18:24:43 +01:00
|
|
|
/* Start assuming the state is OK. We'll turn it into FAIL if there
|
|
|
|
* are the right conditions. */
|
2015-07-27 14:55:45 +02:00
|
|
|
new_state = CLUSTER_OK;
|
2013-03-06 18:24:43 +01:00
|
|
|
|
2013-02-22 17:43:35 +01:00
|
|
|
/* Check if all the slots are covered. */
|
2014-09-17 11:10:09 +02:00
|
|
|
if (server.cluster_require_full_coverage) {
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2014-09-17 11:10:09 +02:00
|
|
|
if (server.cluster->slots[j] == NULL ||
|
2015-07-27 14:55:45 +02:00
|
|
|
server.cluster->slots[j]->flags & (CLUSTER_NODE_FAIL))
|
2014-09-17 11:10:09 +02:00
|
|
|
{
|
2015-07-27 14:55:45 +02:00
|
|
|
new_state = CLUSTER_FAIL;
|
2014-09-17 11:10:09 +02:00
|
|
|
break;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
}
|
2013-02-22 17:43:35 +01:00
|
|
|
|
2013-02-22 19:18:30 +01:00
|
|
|
/* Compute the cluster size, that is the number of master nodes
|
2013-03-07 15:36:59 +01:00
|
|
|
* serving at least a single slot.
|
|
|
|
*
|
2014-10-08 16:27:07 +02:00
|
|
|
* At the same time count the number of reachable masters having
|
|
|
|
* at least one slot. */
|
2013-02-22 19:18:30 +01:00
|
|
|
{
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
|
|
|
server.cluster->size = 0;
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2013-02-22 19:18:30 +01:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(node) && node->numslots) {
|
2013-02-22 19:18:30 +01:00
|
|
|
server.cluster->size++;
|
2015-07-27 14:55:45 +02:00
|
|
|
if ((node->flags & (CLUSTER_NODE_FAIL|CLUSTER_NODE_PFAIL)) == 0)
|
2014-10-08 16:27:07 +02:00
|
|
|
reachable_masters++;
|
2013-03-07 15:36:59 +01:00
|
|
|
}
|
2013-02-22 19:18:30 +01:00
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
2013-03-07 15:22:32 +01:00
|
|
|
|
2014-10-08 16:27:07 +02:00
|
|
|
/* If we are in a minority partition, change the cluster state
|
|
|
|
* to FAIL. */
|
2013-03-07 15:36:59 +01:00
|
|
|
{
|
|
|
|
int needed_quorum = (server.cluster->size / 2) + 1;
|
2014-05-15 10:18:16 +02:00
|
|
|
|
2014-10-08 16:27:07 +02:00
|
|
|
if (reachable_masters < needed_quorum) {
|
2015-07-27 14:55:45 +02:00
|
|
|
new_state = CLUSTER_FAIL;
|
2013-12-20 09:56:18 +01:00
|
|
|
among_minority_time = mstime();
|
|
|
|
}
|
2013-03-07 15:36:59 +01:00
|
|
|
}
|
|
|
|
|
2013-03-07 15:22:32 +01:00
|
|
|
/* Log a state change */
|
2013-12-20 09:56:18 +01:00
|
|
|
if (new_state != server.cluster->state) {
|
|
|
|
mstime_t rejoin_delay = server.cluster_node_timeout;
|
|
|
|
|
|
|
|
/* If the instance is a master and was partitioned away with the
|
|
|
|
* minority, don't let it accept queries for some time after the
|
|
|
|
* partition heals, to make sure there is enough time to receive
|
|
|
|
* a configuration update. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (rejoin_delay > CLUSTER_MAX_REJOIN_DELAY)
|
|
|
|
rejoin_delay = CLUSTER_MAX_REJOIN_DELAY;
|
|
|
|
if (rejoin_delay < CLUSTER_MIN_REJOIN_DELAY)
|
|
|
|
rejoin_delay = CLUSTER_MIN_REJOIN_DELAY;
|
2013-12-20 09:56:18 +01:00
|
|
|
|
2015-07-27 14:55:45 +02:00
|
|
|
if (new_state == CLUSTER_OK &&
|
2023-11-09 11:04:47 +02:00
|
|
|
clusterNodeIsMaster(myself) &&
|
2013-12-20 09:56:18 +01:00
|
|
|
mstime() - among_minority_time < rejoin_delay)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Change the state and log the event. */
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(new_state == CLUSTER_OK ? LL_NOTICE : LL_WARNING,
|
|
|
|
"Cluster state changed: %s",
|
2015-07-27 14:55:45 +02:00
|
|
|
new_state == CLUSTER_OK ? "ok" : "fail");
|
2013-12-20 09:56:18 +01:00
|
|
|
server.cluster->state = new_state;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2013-02-25 11:20:17 +01:00
|
|
|
/* This function is called after the node startup in order to verify that data
|
|
|
|
* loaded from disk is in agreement with the cluster configuration:
|
|
|
|
*
|
|
|
|
* 1) If we find keys about hash slots we have no responsibility for, the
|
|
|
|
* following happens:
|
|
|
|
* A) If no other node is in charge according to the current cluster
|
|
|
|
* configuration, we add these slots to our node.
|
|
|
|
* B) If according to our config other nodes are already in charge for
|
Squash merging 125 typo/grammar/comment/doc PRs (#7773)
List of squashed commits or PRs
===============================
commit 66801ea
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Jan 13 00:54:31 2020 -0500
typo fix in acl.c
commit 46f55db
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun Sep 6 18:24:11 2020 +0300
Updates a couple of comments
Specifically:
* RM_AutoMemory completed instead of pointing to docs
* Updated link to custom type doc
commit 61a2aa0
Author: xindoo <xindoo@qq.com>
Date: Tue Sep 1 19:24:59 2020 +0800
Correct errors in code comments
commit a5871d1
Author: yz1509 <pro-756@qq.com>
Date: Tue Sep 1 18:36:06 2020 +0800
fix typos in module.c
commit 41eede7
Author: bookug <bookug@qq.com>
Date: Sat Aug 15 01:11:33 2020 +0800
docs: fix typos in comments
commit c303c84
Author: lazy-snail <ws.niu@outlook.com>
Date: Fri Aug 7 11:15:44 2020 +0800
fix spelling in redis.conf
commit 1eb76bf
Author: zhujian <zhujianxyz@gmail.com>
Date: Thu Aug 6 15:22:10 2020 +0800
add a missing 'n' in comment
commit 1530ec2
Author: Daniel Dai <764122422@qq.com>
Date: Mon Jul 27 00:46:35 2020 -0400
fix spelling in tracking.c
commit e517b31
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:32 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit c300eff
Author: Hunter-Chen <huntcool001@gmail.com>
Date: Fri Jul 17 22:33:23 2020 +0800
Update redis.conf
Co-authored-by: Itamar Haber <itamar@redislabs.com>
commit 4c058a8
Author: 陈浩鹏 <chenhaopeng@heytea.com>
Date: Thu Jun 25 19:00:56 2020 +0800
Grammar fix and clarification
commit 5fcaa81
Author: bodong.ybd <bodong.ybd@alibaba-inc.com>
Date: Fri Jun 19 10:09:00 2020 +0800
Fix typos
commit 4caca9a
Author: Pruthvi P <pruthvi@ixigo.com>
Date: Fri May 22 00:33:22 2020 +0530
Fix typo eviciton => eviction
commit b2a25f6
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Sun May 17 12:39:59 2020 -0400
Fix a typo.
commit 12842ae
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun May 3 17:16:59 2020 -0400
fix spelling in redis conf
commit ddba07c
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Sat May 2 23:25:34 2020 +0100
Correct a "conflicts" spelling error.
commit 8fc7bf2
Author: Nao YONASHIRO <yonashiro@r.recruit.co.jp>
Date: Thu Apr 30 10:25:27 2020 +0900
docs: fix EXPIRE_FAST_CYCLE_DURATION to ACTIVE_EXPIRE_CYCLE_FAST_DURATION
commit 9b2b67a
Author: Brad Dunbar <dunbarb2@gmail.com>
Date: Fri Apr 24 11:46:22 2020 -0400
Fix a typo.
commit 0746f10
Author: devilinrust <63737265+devilinrust@users.noreply.github.com>
Date: Thu Apr 16 00:17:53 2020 +0200
Fix typos in server.c
commit 92b588d
Author: benjessop12 <56115861+benjessop12@users.noreply.github.com>
Date: Mon Apr 13 13:43:55 2020 +0100
Fix spelling mistake in lazyfree.c
commit 1da37aa
Merge: 2d4ba28 af347a8
Author: hwware <wen.hui.ware@gmail.com>
Date: Thu Mar 5 22:41:31 2020 -0500
Merge remote-tracking branch 'upstream/unstable' into expiretypofix
commit 2d4ba28
Author: hwware <wen.hui.ware@gmail.com>
Date: Mon Mar 2 00:09:40 2020 -0500
fix typo in expire.c
commit 1a746f7
Author: SennoYuki <minakami1yuki@gmail.com>
Date: Thu Feb 27 16:54:32 2020 +0800
fix typo
commit 8599b1a
Author: dongheejeong <donghee950403@gmail.com>
Date: Sun Feb 16 20:31:43 2020 +0000
Fix typo in server.c
commit f38d4e8
Author: hwware <wen.hui.ware@gmail.com>
Date: Sun Feb 2 22:58:38 2020 -0500
fix typo in evict.c
commit fe143fc
Author: Leo Murillo <leonardo.murillo@gmail.com>
Date: Sun Feb 2 01:57:22 2020 -0600
Fix a few typos in redis.conf
commit 1ab4d21
Author: viraja1 <anchan.viraj@gmail.com>
Date: Fri Dec 27 17:15:58 2019 +0530
Fix typo in Latency API docstring
commit ca1f70e
Author: gosth <danxuedexing@qq.com>
Date: Wed Dec 18 15:18:02 2019 +0800
fix typo in sort.c
commit a57c06b
Author: ZYunH <zyunhjob@163.com>
Date: Mon Dec 16 22:28:46 2019 +0800
fix-zset-typo
commit b8c92b5
Author: git-hulk <hulk.website@gmail.com>
Date: Mon Dec 16 15:51:42 2019 +0800
FIX: typo in cluster.c, onformation->information
commit 9dd981c
Author: wujm2007 <jim.wujm@gmail.com>
Date: Mon Dec 16 09:37:52 2019 +0800
Fix typo
commit e132d7a
Author: Sebastien Williams-Wynn <s.williamswynn.mail@gmail.com>
Date: Fri Nov 15 00:14:07 2019 +0000
Minor typo change
commit 47f44d5
Author: happynote3966 <01ssrmikururudevice01@gmail.com>
Date: Mon Nov 11 22:08:48 2019 +0900
fix comment typo in redis-cli.c
commit b8bdb0d
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 18:00:17 2019 +0800
Fix a spelling mistake of comments in defragDictBucketCallback
commit 0def46a
Author: fulei <fulei@kuaishou.com>
Date: Wed Oct 16 13:09:27 2019 +0800
fix some spelling mistakes of comments in defrag.c
commit f3596fd
Author: Phil Rajchgot <tophil@outlook.com>
Date: Sun Oct 13 02:02:32 2019 -0400
Typo and grammar fixes
Redis and its documentation are great -- just wanted to submit a few corrections in the spirit of Hacktoberfest. Thanks for all your work on this project. I use it all the time and it works beautifully.
commit 2b928cd
Author: KangZhiDong <worldkzd@gmail.com>
Date: Sun Sep 1 07:03:11 2019 +0800
fix typos
commit 33aea14
Author: Axlgrep <axlgrep@gmail.com>
Date: Tue Aug 27 11:02:18 2019 +0800
Fixed eviction spelling issues
commit e282a80
Author: Simen Flatby <simen@oms.no>
Date: Tue Aug 20 15:25:51 2019 +0200
Update comments to reflect prop name
In the comments the prop is referenced as replica-validity-factor,
but it is really named cluster-replica-validity-factor.
commit 74d1f9a
Author: Jim Green <jimgreen2013@qq.com>
Date: Tue Aug 20 20:00:31 2019 +0800
fix comment error, the code is ok
commit eea1407
Author: Liao Tonglang <liaotonglang@gmail.com>
Date: Fri May 31 10:16:18 2019 +0800
typo fix
fix cna't to can't
commit 0da553c
Author: KAWACHI Takashi <tkawachi@gmail.com>
Date: Wed Jul 17 00:38:16 2019 +0900
Fix typo
commit 7fc8fb6
Author: Michael Prokop <mika@grml.org>
Date: Tue May 28 17:58:42 2019 +0200
Typo fixes
s/familar/familiar/
s/compatiblity/compatibility/
s/ ot / to /
s/itsef/itself/
commit 5f46c9d
Author: zhumoing <34539422+zhumoing@users.noreply.github.com>
Date: Tue May 21 21:16:50 2019 +0800
typo-fixes
typo-fixes
commit 321dfe1
Author: wxisme <850885154@qq.com>
Date: Sat Mar 16 15:10:55 2019 +0800
typo fix
commit b4fb131
Merge: 267e0e6 3df1eb8
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Fri Feb 8 22:55:45 2019 +0200
Merge branch 'unstable' of antirez/redis into unstable
commit 267e0e6
Author: Nikitas Bastas <nikitasbst@gmail.com>
Date: Wed Jan 30 21:26:04 2019 +0200
Minor typo fix
commit 30544e7
Author: inshal96 <39904558+inshal96@users.noreply.github.com>
Date: Fri Jan 4 16:54:50 2019 +0500
remove an extra 'a' in the comments
commit 337969d
Author: BrotherGao <yangdongheng11@gmail.com>
Date: Sat Dec 29 12:37:29 2018 +0800
fix typo in redis.conf
commit 9f4b121
Merge: 423a030 e504583
Author: BrotherGao <yangdongheng@xiaomi.com>
Date: Sat Dec 29 11:41:12 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 423a030
Merge: 42b02b7 46a51cd
Author: 杨东衡 <yangdongheng@xiaomi.com>
Date: Tue Dec 4 23:56:11 2018 +0800
Merge branch 'unstable' of antirez/redis into unstable
commit 42b02b7
Merge: 68c0e6e b8febe6
Author: Dongheng Yang <yangdongheng11@gmail.com>
Date: Sun Oct 28 15:54:23 2018 +0800
Merge pull request #1 from antirez/unstable
update local data
commit 714b589
Author: Christian <crifei93@gmail.com>
Date: Fri Dec 28 01:17:26 2018 +0100
fix typo "resulution"
commit e23259d
Author: garenchan <1412950785@qq.com>
Date: Wed Dec 26 09:58:35 2018 +0800
fix typo: segfauls -> segfault
commit a9359f8
Author: xjp <jianping_xie@aliyun.com>
Date: Tue Dec 18 17:31:44 2018 +0800
Fixed REDISMODULE_H spell bug
commit a12c3e4
Author: jdiaz <jrd.palacios@gmail.com>
Date: Sat Dec 15 23:39:52 2018 -0600
Fixes hyperloglog hash function comment block description
commit 770eb11
Author: 林上耀 <1210tom@163.com>
Date: Sun Nov 25 17:16:10 2018 +0800
fix typo
commit fd97fbb
Author: Chris Lamb <chris@chris-lamb.co.uk>
Date: Fri Nov 23 17:14:01 2018 +0100
Correct "unsupported" typo.
commit a85522d
Author: Jungnam Lee <jungnam.lee@oracle.com>
Date: Thu Nov 8 23:01:29 2018 +0900
fix typo in test comments
commit ade8007
Author: Arun Kumar <palerdot@users.noreply.github.com>
Date: Tue Oct 23 16:56:35 2018 +0530
Fixed grammatical typo
Fixed typo for word 'dictionary'
commit 869ee39
Author: Hamid Alaei <hamid.a85@gmail.com>
Date: Sun Aug 12 16:40:02 2018 +0430
fix documentations: (ThreadSafeContextStart/Stop -> ThreadSafeContextLock/Unlock), minor typo
commit f89d158
Author: Mayank Jain <mayankjain255@gmail.com>
Date: Tue Jul 31 23:01:21 2018 +0530
Updated README.md with some spelling corrections.
Made correction in spelling of some misspelled words.
commit 892198e
Author: dsomeshwar <someshwar.dhayalan@gmail.com>
Date: Sat Jul 21 23:23:04 2018 +0530
typo fix
commit 8a4d780
Author: Itamar Haber <itamar@redislabs.com>
Date: Mon Apr 30 02:06:52 2018 +0300
Fixes some typos
commit e3acef6
Author: Noah Rosamilia <ivoahivoah@gmail.com>
Date: Sat Mar 3 23:41:21 2018 -0500
Fix typo in /deps/README.md
commit 04442fb
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:32:42 2018 +0800
Fix typo in readSyncBulkPayload() comment.
commit 9f36880
Author: WuYunlong <xzsyeb@126.com>
Date: Sat Mar 3 10:20:37 2018 +0800
replication.c comment: run_id -> replid.
commit f866b4a
Author: Francesco 'makevoid' Canessa <makevoid@gmail.com>
Date: Thu Feb 22 22:01:56 2018 +0000
fix comment typo in server.c
commit 0ebc69b
Author: 줍 <jubee0124@gmail.com>
Date: Mon Feb 12 16:38:48 2018 +0900
Fix typo in redis.conf
Fix `five behaviors` to `eight behaviors` in [this sentence ](antirez/redis@unstable/redis.conf#L564)
commit b50a620
Author: martinbroadhurst <martinbroadhurst@users.noreply.github.com>
Date: Thu Dec 28 12:07:30 2017 +0000
Fix typo in valgrind.sup
commit 7d8f349
Author: Peter Boughton <peter@sorcerersisle.com>
Date: Mon Nov 27 19:52:19 2017 +0000
Update CONTRIBUTING; refer doc updates to redis-doc repo.
commit 02dec7e
Author: Klauswk <klauswk1@hotmail.com>
Date: Tue Oct 24 16:18:38 2017 -0200
Fix typo in comment
commit e1efbc8
Author: chenshi <baiwfg2@gmail.com>
Date: Tue Oct 3 18:26:30 2017 +0800
Correct two spelling errors of comments
commit 93327d8
Author: spacewander <spacewanderlzx@gmail.com>
Date: Wed Sep 13 16:47:24 2017 +0800
Update the comment for OBJ_ENCODING_EMBSTR_SIZE_LIMIT's value
The value of OBJ_ENCODING_EMBSTR_SIZE_LIMIT is 44 now instead of 39.
commit 63d361f
Author: spacewander <spacewanderlzx@gmail.com>
Date: Tue Sep 12 15:06:42 2017 +0800
Fix <prevlen> related doc in ziplist.c
According to the definition of ZIP_BIG_PREVLEN and other related code,
the guard of single byte <prevlen> should be 254 instead of 255.
commit ebe228d
Author: hanael80 <hanael80@gmail.com>
Date: Tue Aug 15 09:09:40 2017 +0900
Fix typo
commit 6b696e6
Author: Matt Robenolt <matt@ydekproductions.com>
Date: Mon Aug 14 14:50:47 2017 -0700
Fix typo in LATENCY DOCTOR output
commit a2ec6ae
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 15 14:15:16 2017 +0800
Fix a typo: form => from
commit 3ab7699
Author: caosiyang <caosiyang@qiyi.com>
Date: Thu Aug 10 18:40:33 2017 +0800
Fix a typo: replicationFeedSlavesFromMaster() => replicationFeedSlavesFromMasterStream()
commit 72d43ef
Author: caosiyang <caosiyang@qiyi.com>
Date: Tue Aug 8 15:57:25 2017 +0800
fix a typo: servewr => server
commit 707c958
Author: Bo Cai <charpty@gmail.com>
Date: Wed Jul 26 21:49:42 2017 +0800
redis-cli.c typo: conut -> count.
Signed-off-by: Bo Cai <charpty@gmail.com>
commit b9385b2
Author: JackDrogon <jack.xsuperman@gmail.com>
Date: Fri Jun 30 14:22:31 2017 +0800
Fix some spell problems
commit 20d9230
Author: akosel <aaronjkosel@gmail.com>
Date: Sun Jun 4 19:35:13 2017 -0500
Fix typo
commit b167bfc
Author: Krzysiek Witkowicz <krzysiekwitkowicz@gmail.com>
Date: Mon May 22 21:32:27 2017 +0100
Fix #4008 small typo in comment
commit 2b78ac8
Author: Jake Clarkson <jacobwclarkson@gmail.com>
Date: Wed Apr 26 15:49:50 2017 +0100
Correct typo in tests/unit/hyperloglog.tcl
commit b0f1cdb
Author: Qi Luo <qiluo-msft@users.noreply.github.com>
Date: Wed Apr 19 14:25:18 2017 -0700
Fix typo
commit a90b0f9
Author: charsyam <charsyam@naver.com>
Date: Thu Mar 16 18:19:53 2017 +0900
fix typos
fix typos
fix typos
commit 8430a79
Author: Richard Hart <richardhart92@gmail.com>
Date: Mon Mar 13 22:17:41 2017 -0400
Fixed log message typo in listenToPort.
commit 481a1c2
Author: Vinod Kumar <kumar003vinod@gmail.com>
Date: Sun Jan 15 23:04:51 2017 +0530
src/db.c: Correct "save" -> "safe" typo
commit 586b4d3
Author: wangshaonan <wshn13@gmail.com>
Date: Wed Dec 21 20:28:27 2016 +0800
Fix typo they->the in helloworld.c
commit c1c4b5e
Author: Jenner <hypxm@qq.com>
Date: Mon Dec 19 16:39:46 2016 +0800
typo error
commit 1ee1a3f
Author: tielei <43289893@qq.com>
Date: Mon Jul 18 13:52:25 2016 +0800
fix some comments
commit 11a41fb
Author: Otto Kekäläinen <otto@seravo.fi>
Date: Sun Jul 3 10:23:55 2016 +0100
Fix spelling in documentation and comments
commit 5fb5d82
Author: francischan <f1ancis621@gmail.com>
Date: Tue Jun 28 00:19:33 2016 +0800
Fix outdated comments about redis.c file.
It should now refer to server.c file.
commit 6b254bc
Author: lmatt-bit <lmatt123n@gmail.com>
Date: Thu Apr 21 21:45:58 2016 +0800
Refine the comment of dictRehashMilliseconds func
SLAVECONF->REPLCONF in comment - by andyli029
commit ee9869f
Author: clark.kang <charsyam@naver.com>
Date: Tue Mar 22 11:09:51 2016 +0900
fix typos
commit f7b3b11
Author: Harisankar H <harisankarh@gmail.com>
Date: Wed Mar 9 11:49:42 2016 +0530
Typo correction: "faield" --> "failed"
Typo correction: "faield" --> "failed"
commit 3fd40fc
Author: Itamar Haber <itamar@redislabs.com>
Date: Thu Feb 25 10:31:51 2016 +0200
Fixes a typo in comments
commit 621c160
Author: Prayag Verma <prayag.verma@gmail.com>
Date: Mon Feb 1 12:36:20 2016 +0530
Fix typo in Readme.md
Spelling mistakes -
`eviciton` > `eviction`
`familar` > `familiar`
commit d7d07d6
Author: WonCheol Lee <toctoc21c@gmail.com>
Date: Wed Dec 30 15:11:34 2015 +0900
Typo fixed
commit a4dade7
Author: Felix Bünemann <buenemann@louis.info>
Date: Mon Dec 28 11:02:55 2015 +0100
[ci skip] Improve supervised upstart config docs
This mentions that "expect stop" is required for supervised upstart
to work correctly. See http://upstart.ubuntu.com/cookbook/#expect-stop
for an explanation.
commit d9caba9
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:30:03 2015 +1100
README: Remove trailing whitespace
commit 72d42e5
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:32 2015 +1100
README: Fix typo. th => the
commit dd6e957
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:29:20 2015 +1100
README: Fix typo. familar => familiar
commit 3a12b23
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:28:54 2015 +1100
README: Fix typo. eviciton => eviction
commit 2d1d03b
Author: daurnimator <quae@daurnimator.com>
Date: Mon Dec 21 18:21:45 2015 +1100
README: Fix typo. sever => server
commit 3973b06
Author: Itamar Haber <itamar@garantiadata.com>
Date: Sat Dec 19 17:01:20 2015 +0200
Typo fix
commit 4f2e460
Author: Steve Gao <fu@2token.com>
Date: Fri Dec 4 10:22:05 2015 +0800
Update README - fix typos
commit b21667c
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:48:37 2015 +0800
delete redundancy color judge in sdscatcolor
commit 88894c7
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 22:14:42 2015 +0800
the example output shoule be HelloWorld
commit 2763470
Author: binyan <binbin.yan@nokia.com>
Date: Wed Dec 2 17:41:39 2015 +0800
modify error word keyevente
Signed-off-by: binyan <binbin.yan@nokia.com>
commit 0847b3d
Author: Bruno Martins <bscmartins@gmail.com>
Date: Wed Nov 4 11:37:01 2015 +0000
typo
commit bbb9e9e
Author: dawedawe <dawedawe@gmx.de>
Date: Fri Mar 27 00:46:41 2015 +0100
typo: zimap -> zipmap
commit 5ed297e
Author: Axel Advento <badwolf.bloodseeker.rev@gmail.com>
Date: Tue Mar 3 15:58:29 2015 +0800
Fix 'salve' typos to 'slave'
commit edec9d6
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Wed Jun 12 14:12:47 2019 +0200
Update README.md
Co-Authored-By: Qix <Qix-@users.noreply.github.com>
commit 692a7af
Author: LudwikJaniuk <ludvig.janiuk@gmail.com>
Date: Tue May 28 14:32:04 2019 +0200
grammar
commit d962b0a
Author: Nick Frost <nickfrostatx@gmail.com>
Date: Wed Jul 20 15:17:12 2016 -0700
Minor grammar fix
commit 24fff01aaccaf5956973ada8c50ceb1462e211c6 (typos)
Author: Chad Miller <chadm@squareup.com>
Date: Tue Sep 8 13:46:11 2020 -0400
Fix faulty comment about operation of unlink()
commit 3cd5c1f3326c52aa552ada7ec797c6bb16452355
Author: Kevin <kevin.xgr@gmail.com>
Date: Wed Nov 20 00:13:50 2019 +0800
Fix typo in server.c.
From a83af59 Mon Sep 17 00:00:00 2001
From: wuwo <wuwo@wacai.com>
Date: Fri, 17 Mar 2017 20:37:45 +0800
Subject: [PATCH] falure to failure
From c961896 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=B7=A6=E6=87=B6?= <veficos@gmail.com>
Date: Sat, 27 May 2017 15:33:04 +0800
Subject: [PATCH] fix typo
From e600ef2 Mon Sep 17 00:00:00 2001
From: "rui.zou" <rui.zou@yunify.com>
Date: Sat, 30 Sep 2017 12:38:15 +0800
Subject: [PATCH] fix a typo
From c7d07fa Mon Sep 17 00:00:00 2001
From: Alexandre Perrin <alex@kaworu.ch>
Date: Thu, 16 Aug 2018 10:35:31 +0200
Subject: [PATCH] deps README.md typo
From b25cb67 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 10:55:37 +0300
Subject: [PATCH 1/2] fix typos in header
From ad28ca6 Mon Sep 17 00:00:00 2001
From: Guy Korland <gkorland@gmail.com>
Date: Wed, 26 Sep 2018 11:02:36 +0300
Subject: [PATCH 2/2] fix typos
commit 34924cdedd8552466fc22c1168d49236cb7ee915
Author: Adrian Lynch <adi_ady_ade@hotmail.com>
Date: Sat Apr 4 21:59:15 2015 +0100
Typos fixed
commit fd2a1e7
Author: Jan <jsteemann@users.noreply.github.com>
Date: Sat Oct 27 19:13:01 2018 +0200
Fix typos
Fix typos
commit e14e47c1a234b53b0e103c5f6a1c61481cbcbb02
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:30:07 2019 -0500
Fix multiple misspellings of "following"
commit 79b948ce2dac6b453fe80995abbcaac04c213d5a
Author: Andy Lester <andy@petdance.com>
Date: Fri Aug 2 22:24:28 2019 -0500
Fix misspelling of create-cluster
commit 1fffde52666dc99ab35efbd31071a4c008cb5a71
Author: Andy Lester <andy@petdance.com>
Date: Wed Jul 31 17:57:56 2019 -0500
Fix typos
commit 204c9ba9651e9e05fd73936b452b9a30be456cfe
Author: Xiaobo Zhu <xiaobo.zhu@shopee.com>
Date: Tue Aug 13 22:19:25 2019 +0800
fix typos
Squashed commit of the following:
commit 1d9aaf8
Author: danmedani <danmedani@gmail.com>
Date: Sun Aug 2 11:40:26 2015 -0700
README typo fix.
Squashed commit of the following:
commit 32bfa7c
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Jul 6 21:15:08 2015 +0200
Fixed grammer
Squashed commit of the following:
commit b24f69c
Author: Sisir Koppaka <sisir.koppaka@gmail.com>
Date: Mon Mar 2 22:38:45 2015 -0500
utils/hashtable/rehashing.c: Fix typos
Squashed commit of the following:
commit 4e04082
Author: Erik Dubbelboer <erik@dubbelboer.com>
Date: Mon Mar 23 08:22:21 2015 +0000
Small config file documentation improvements
Squashed commit of the following:
commit acb8773
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:52:48 2015 -0700
Typo and grammar fixes in readme
commit 2eb75b6
Author: ctd1500 <ctd1500@gmail.com>
Date: Fri May 8 01:36:18 2015 -0700
fixed redis.conf comment
Squashed commit of the following:
commit a8249a2
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Date: Fri Dec 11 11:39:52 2015 +0530
Revise correction of typos.
Squashed commit of the following:
commit 3c02028
Author: zhaojun11 <zhaojun11@jd.com>
Date: Wed Jan 17 19:05:28 2018 +0800
Fix typos include two code typos in cluster.c and latency.c
Squashed commit of the following:
commit 9dba47c
Author: q191201771 <191201771@qq.com>
Date: Sat Jan 4 11:31:04 2020 +0800
fix function listCreate comment in adlist.c
Update src/server.c
commit 2c7c2cb536e78dd211b1ac6f7bda00f0f54faaeb
Author: charpty <charpty@gmail.com>
Date: Tue May 1 23:16:59 2018 +0800
server.c typo: modules system dictionary type comment
Signed-off-by: charpty <charpty@gmail.com>
commit a8395323fb63cb59cb3591cb0f0c8edb7c29a680
Author: Itamar Haber <itamar@redislabs.com>
Date: Sun May 6 00:25:18 2018 +0300
Updates test_helper.tcl's help with undocumented options
Specifically:
* Host
* Port
* Client
commit bde6f9ced15755cd6407b4af7d601b030f36d60b
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 15:19:19 2018 +0800
fix comments in deps files
commit 3172474ba991532ab799ee1873439f3402412331
Author: wxisme <850885154@qq.com>
Date: Wed Aug 8 14:33:49 2018 +0800
fix some comments
commit 01b6f2b6858b5cf2ce4ad5092d2c746e755f53f0
Author: Thor Juhasz <thor@juhasz.pro>
Date: Sun Nov 18 14:37:41 2018 +0100
Minor fixes to comments
Found some parts a little unclear on a first read, which prompted me to have a better look at the file and fix some minor things I noticed.
Fixing minor typos and grammar. There are no changes to configuration options.
These changes are only meant to help the user better understand the explanations to the various configuration options
2020-09-10 13:43:38 +03:00
|
|
|
* this slots, we set the slots as IMPORTING from our point of view
|
2013-02-25 11:20:17 +01:00
|
|
|
* in order to justify we have those slots, and in order to make
|
2021-09-21 00:30:22 +08:00
|
|
|
* redis-cli aware of the issue, so that it can try to fix it.
|
2015-07-26 23:17:55 +02:00
|
|
|
* 2) If we find data in a DB different than DB0 we return C_ERR to
|
2013-02-25 11:20:17 +01:00
|
|
|
* signal the caller it should quit the server with an error message
|
|
|
|
* or take other actions.
|
|
|
|
*
|
2015-07-26 23:17:55 +02:00
|
|
|
* The function always returns C_OK even if it will try to correct
|
2013-02-25 11:20:17 +01:00
|
|
|
* the error described in "1". However if data is found in DB different
|
2015-07-26 23:17:55 +02:00
|
|
|
* from DB0, C_ERR is returned.
|
2013-02-25 11:20:17 +01:00
|
|
|
*
|
|
|
|
* The function also uses the logging facility in order to warn the user
|
|
|
|
* about desynchronizations between the data we have in memory and the
|
|
|
|
* cluster configuration. */
|
|
|
|
int verifyClusterConfigWithData(void) {
|
2013-02-25 11:43:49 +01:00
|
|
|
int j;
|
|
|
|
int update_config = 0;
|
|
|
|
|
2018-09-19 12:02:37 +02:00
|
|
|
/* Return ASAP if a module disabled cluster redirections. In that case
|
|
|
|
* every master can store keys about every possible hash slot. */
|
|
|
|
if (server.cluster_module_flags & CLUSTER_MODULE_FLAG_NO_REDIRECTION)
|
|
|
|
return C_OK;
|
|
|
|
|
2013-03-04 19:47:00 +01:00
|
|
|
/* If this node is a slave, don't perform the check at all as we
|
|
|
|
* completely depend on the replication stream. */
|
2015-07-26 23:17:55 +02:00
|
|
|
if (nodeIsSlave(myself)) return C_OK;
|
2013-03-04 19:47:00 +01:00
|
|
|
|
2013-02-25 11:43:49 +01:00
|
|
|
/* Make sure we only have keys in DB0. */
|
|
|
|
for (j = 1; j < server.dbnum; j++) {
|
Replace cluster metadata with slot specific dictionaries (#11695)
This is an implementation of https://github.com/redis/redis/issues/10589 that eliminates 16 bytes per entry in cluster mode, that are currently used to create a linked list between entries in the same slot. Main idea is splitting main dictionary into 16k smaller dictionaries (one per slot), so we can perform all slot specific operations, such as iteration, without any additional info in the `dictEntry`. For Redis cluster, the expectation is that there will be a larger number of keys, so the fixed overhead of 16k dictionaries will be The expire dictionary is also split up so that each slot is logically decoupled, so that in subsequent revisions we will be able to atomically flush a slot of data.
## Important changes
* Incremental rehashing - one big change here is that it's not one, but rather up to 16k dictionaries that can be rehashing at the same time, in order to keep track of them, we introduce a separate queue for dictionaries that are rehashing. Also instead of rehashing a single dictionary, cron job will now try to rehash as many as it can in 1ms.
* getRandomKey - now needs to not only select a random key, from the random bucket, but also needs to select a random dictionary. Fairness is a major concern here, as it's possible that keys can be unevenly distributed across the slots. In order to address this search we introduced binary index tree). With that data structure we are able to efficiently find a random slot using binary search in O(log^2(slot count)) time.
* Iteration efficiency - when iterating dictionary with a lot of empty slots, we want to skip them efficiently. We can do this using same binary index that is used for random key selection, this index allows us to find a slot for a specific key index. For example if there are 10 keys in the slot 0, then we can quickly find a slot that contains 11th key using binary search on top of the binary index tree.
* scan API - in order to perform a scan across the entire DB, the cursor now needs to not only save position within the dictionary but also the slot id. In this change we append slot id into LSB of the cursor so it can be passed around between client and the server. This has interesting side effect, now you'll be able to start scanning specific slot by simply providing slot id as a cursor value. The plan is to not document this as defined behavior, however. It's also worth nothing the SCAN API is now technically incompatible with previous versions, although practically we don't believe it's an issue.
* Checksum calculation optimizations - During command execution, we know that all of the keys are from the same slot (outside of a few notable exceptions such as cross slot scripts and modules). We don't want to compute the checksum multiple multiple times, hence we are relying on cached slot id in the client during the command executions. All operations that access random keys, either should pass in the known slot or recompute the slot.
* Slot info in RDB - in order to resize individual dictionaries correctly, while loading RDB, it's not enough to know total number of keys (of course we could approximate number of keys per slot, but it won't be precise). To address this issue, we've added additional metadata into RDB that contains number of keys in each slot, which can be used as a hint during loading.
* DB size - besides `DBSIZE` API, we need to know size of the DB in many places want, in order to avoid scanning all dictionaries and summing up their sizes in a loop, we've introduced a new field into `redisDb` that keeps track of `key_count`. This way we can keep DBSIZE operation O(1). This is also kept for O(1) expires computation as well.
## Performance
This change improves SET performance in cluster mode by ~5%, most of the gains come from us not having to maintain linked lists for keys in slot, non-cluster mode has same performance. For workloads that rely on evictions, the performance is similar because of the extra overhead for finding keys to evict.
RDB loading performance is slightly reduced, as the slot of each key needs to be computed during the load.
## Interface changes
* Removed `overhead.hashtable.slot-to-keys` to `MEMORY STATS`
* Scan API will now require 64 bits to store the cursor, even on 32 bit systems, as the slot information will be stored.
* New RDB version to support the new op code for SLOT information.
---------
Co-authored-by: Vitaly Arbuzov <arvit@amazon.com>
Co-authored-by: Harkrishn Patro <harkrisp@amazon.com>
Co-authored-by: Roshan Khatri <rvkhatri@amazon.com>
Co-authored-by: Madelyn Olson <madelyneolson@gmail.com>
Co-authored-by: Oran Agra <oran@redislabs.com>
2023-10-14 23:58:26 -07:00
|
|
|
if (dbSize(&server.db[j], DB_MAIN)) return C_ERR;
|
2013-02-25 11:43:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Check that all the slots we see populated memory have a corresponding
|
|
|
|
* entry in the cluster table. Otherwise fix the table. */
|
2015-07-27 14:55:45 +02:00
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2013-02-25 11:43:49 +01:00
|
|
|
if (!countKeysInSlot(j)) continue; /* No keys in this slot. */
|
|
|
|
/* Check if we are assigned to this slot or if we are importing it.
|
|
|
|
* In both cases check the next slot as the configuration makes
|
|
|
|
* sense. */
|
2014-01-29 11:38:14 +01:00
|
|
|
if (server.cluster->slots[j] == myself ||
|
2013-02-25 11:43:49 +01:00
|
|
|
server.cluster->importing_slots_from[j] != NULL) continue;
|
|
|
|
|
|
|
|
/* If we are here data and cluster config don't agree, and we have
|
|
|
|
* slot 'j' populated even if we are not importing it, nor we are
|
|
|
|
* assigned to this slot. Fix this condition. */
|
|
|
|
|
|
|
|
update_config++;
|
2014-07-31 14:51:05 -04:00
|
|
|
/* Case A: slot is unassigned. Take responsibility for it. */
|
2013-02-25 11:43:49 +01:00
|
|
|
if (server.cluster->slots[j] == NULL) {
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE, "I have keys for unassigned slot %d. "
|
2014-08-01 16:42:02 -04:00
|
|
|
"Taking responsibility for it.",j);
|
2014-01-29 11:38:14 +01:00
|
|
|
clusterAddSlot(myself,j);
|
2013-02-25 11:43:49 +01:00
|
|
|
} else {
|
2023-02-19 22:33:19 +08:00
|
|
|
serverLog(LL_NOTICE, "I have keys for slot %d, but the slot is "
|
2014-08-01 16:42:02 -04:00
|
|
|
"assigned to another node. "
|
|
|
|
"Setting it to importing state.",j);
|
2013-02-25 11:43:49 +01:00
|
|
|
server.cluster->importing_slots_from[j] = server.cluster->slots[j];
|
|
|
|
}
|
|
|
|
}
|
2013-10-03 09:55:20 +02:00
|
|
|
if (update_config) clusterSaveConfigOrDie(1);
|
2015-07-26 23:17:55 +02:00
|
|
|
return C_OK;
|
2013-02-25 11:20:17 +01:00
|
|
|
}
|
|
|
|
|
2023-10-12 20:48:27 -07:00
|
|
|
/* Remove all the shard channel related information not owned by the current shard. */
|
|
|
|
static inline void removeAllNotOwnedShardChannelSubscriptions(void) {
|
|
|
|
if (!dictSize(server.pubsubshard_channels)) return;
|
2023-11-09 11:04:47 +02:00
|
|
|
clusterNode *currmaster = clusterNodeIsMaster(myself) ? myself : myself->slaveof;
|
2023-10-12 20:48:27 -07:00
|
|
|
for (int j = 0; j < CLUSTER_SLOTS; j++) {
|
|
|
|
if (server.cluster->slots[j] != currmaster) {
|
|
|
|
removeChannelsInSlot(j);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-04 13:15:09 +01:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* SLAVE nodes handling
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2014-03-11 11:22:06 +01:00
|
|
|
/* Set the specified node 'n' as master for this node.
|
|
|
|
* If this node is currently a master, it is turned into a slave. */
|
2013-03-04 13:15:09 +01:00
|
|
|
void clusterSetMaster(clusterNode *n) {
|
2015-07-26 15:29:53 +02:00
|
|
|
serverAssert(n != myself);
|
|
|
|
serverAssert(myself->numslots == 0);
|
2013-03-04 13:15:09 +01:00
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself)) {
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
myself->flags &= ~(CLUSTER_NODE_MASTER|CLUSTER_NODE_MIGRATE_TO);
|
2015-07-27 14:55:45 +02:00
|
|
|
myself->flags |= CLUSTER_NODE_SLAVE;
|
2014-03-11 11:22:06 +01:00
|
|
|
clusterCloseAllSlots();
|
2014-01-22 18:46:06 +01:00
|
|
|
} else {
|
|
|
|
if (myself->slaveof)
|
|
|
|
clusterNodeRemoveSlave(myself->slaveof,myself);
|
2013-03-04 13:15:09 +01:00
|
|
|
}
|
|
|
|
myself->slaveof = n;
|
2022-11-16 19:24:18 -08:00
|
|
|
updateShardId(myself, n->shard_id);
|
2014-01-22 18:46:06 +01:00
|
|
|
clusterNodeAddSlave(n,myself);
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
replicationSetMaster(n->ip, getNodeDefaultReplicationPort(n));
|
2023-10-12 20:48:27 -07:00
|
|
|
removeAllNotOwnedShardChannelSubscriptions();
|
2014-02-05 13:01:24 +01:00
|
|
|
resetManualFailover();
|
2013-03-04 13:15:09 +01:00
|
|
|
}
|
|
|
|
|
2011-03-29 17:51:15 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
2014-08-08 15:52:04 +02:00
|
|
|
* Nodes to string representation functions.
|
2011-03-29 17:51:15 +02:00
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2014-08-08 15:52:04 +02:00
|
|
|
struct redisNodeFlags {
|
|
|
|
uint16_t flag;
|
|
|
|
char *name;
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct redisNodeFlags redisNodeFlagsTable[] = {
|
Fix replicas migration by adding a new flag.
Some time ago I broken replicas migration (reported in #2924).
The idea was to prevent masters without replicas from getting replicas
because of replica migration, I remember it to create issues with tests,
but there is no clue in the commit message about why it was so
undesirable.
However my patch as a side effect totally ruined the concept of replicas
migration since we want it to work also for instances that, technically,
never had slaves in the past: promoted slaves.
So now instead the ability to be targeted by replicas migration, is a
new flag "migrate-to". It only applies to masters, and is set in the
following two cases:
1. When a master gets a slave, it is set.
2. When a slave turns into a master because of fail over, it is set.
This way replicas migration targets are only masters that used to have
slaves, and slaves of masters (that used to have slaves... obviously)
and are promoted.
The new flag is only internal, and is never exposed in the output nor
persisted in the nodes configuration, since all the information to
handle it are implicit in the cluster configuration we already have.
2015-12-09 22:52:53 +01:00
|
|
|
{CLUSTER_NODE_MYSELF, "myself,"},
|
|
|
|
{CLUSTER_NODE_MASTER, "master,"},
|
|
|
|
{CLUSTER_NODE_SLAVE, "slave,"},
|
|
|
|
{CLUSTER_NODE_PFAIL, "fail?,"},
|
|
|
|
{CLUSTER_NODE_FAIL, "fail,"},
|
|
|
|
{CLUSTER_NODE_HANDSHAKE, "handshake,"},
|
2018-03-14 13:46:36 +01:00
|
|
|
{CLUSTER_NODE_NOADDR, "noaddr,"},
|
|
|
|
{CLUSTER_NODE_NOFAILOVER, "nofailover,"}
|
2014-08-08 15:52:04 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Concatenate the comma separated list of node flags to the given SDS
|
|
|
|
* string 'ci'. */
|
2015-07-27 15:08:58 +02:00
|
|
|
sds representClusterNodeFlags(sds ci, uint16_t flags) {
|
2017-07-20 15:17:35 +02:00
|
|
|
size_t orig_len = sdslen(ci);
|
|
|
|
int i, size = sizeof(redisNodeFlagsTable)/sizeof(struct redisNodeFlags);
|
|
|
|
for (i = 0; i < size; i++) {
|
|
|
|
struct redisNodeFlags *nodeflag = redisNodeFlagsTable + i;
|
|
|
|
if (flags & nodeflag->flag) ci = sdscat(ci, nodeflag->name);
|
|
|
|
}
|
|
|
|
/* If no flag was added, add the "noflags" special flag. */
|
|
|
|
if (sdslen(ci) == orig_len) ci = sdscat(ci,"noflags,");
|
2014-08-08 15:52:04 +02:00
|
|
|
sdsIncrLen(ci,-1); /* Remove trailing comma. */
|
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
|
2022-03-16 02:24:40 +01:00
|
|
|
/* Concatenate the slot ownership information to the given SDS string 'ci'.
|
|
|
|
* If the slot ownership is in a contiguous block, it's represented as start-end pair,
|
|
|
|
* else each slot is added separately. */
|
2022-03-29 10:05:06 +03:00
|
|
|
sds representSlotInfo(sds ci, uint16_t *slot_info_pairs, int slot_info_pairs_count) {
|
|
|
|
for (int i = 0; i< slot_info_pairs_count; i+=2) {
|
|
|
|
unsigned long start = slot_info_pairs[i];
|
|
|
|
unsigned long end = slot_info_pairs[i+1];
|
2022-03-16 02:24:40 +01:00
|
|
|
if (start == end) {
|
|
|
|
ci = sdscatfmt(ci, " %i", start);
|
|
|
|
} else {
|
|
|
|
ci = sdscatfmt(ci, " %i-%i", start, end);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
|
2014-01-22 18:09:06 +01:00
|
|
|
/* Generate a csv-alike representation of the specified cluster node.
|
|
|
|
* See clusterGenNodesDescription() top comment for more information.
|
|
|
|
*
|
2015-03-20 16:42:49 +01:00
|
|
|
* The function returns the string representation as an SDS string. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
sds clusterGenNodeDescription(client *c, clusterNode *node, int tls_primary) {
|
2014-01-22 18:09:06 +01:00
|
|
|
int j, start;
|
2015-03-20 16:42:49 +01:00
|
|
|
sds ci;
|
2023-11-09 11:04:47 +02:00
|
|
|
int port = clusterNodeClientPort(node, tls_primary);
|
2014-01-22 18:09:06 +01:00
|
|
|
|
|
|
|
/* Node coordinates */
|
2021-01-14 04:36:03 +08:00
|
|
|
ci = sdscatlen(sdsempty(),node->name,CLUSTER_NAMELEN);
|
2023-06-18 12:16:51 +08:00
|
|
|
ci = sdscatfmt(ci," %s:%i@%i",
|
|
|
|
node->ip,
|
|
|
|
port,
|
|
|
|
node->cport);
|
2022-02-16 13:35:49 -08:00
|
|
|
if (sdslen(node->hostname) != 0) {
|
2023-06-18 12:16:51 +08:00
|
|
|
ci = sdscatfmt(ci,",%s", node->hostname);
|
|
|
|
}
|
2023-05-23 08:32:37 -07:00
|
|
|
/* Don't expose aux fields to any clients yet but do allow them
|
|
|
|
* to be persisted to nodes.conf */
|
|
|
|
if (c == NULL) {
|
2023-07-16 11:31:42 +08:00
|
|
|
if (sdslen(node->hostname) == 0) {
|
|
|
|
ci = sdscatfmt(ci,",", 1);
|
|
|
|
}
|
2023-06-18 12:16:51 +08:00
|
|
|
for (int i = af_count-1; i >=0; i--) {
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if ((tls_primary && i == af_tls_port) || (!tls_primary && i == af_tcp_port)) {
|
|
|
|
continue;
|
|
|
|
}
|
2023-05-23 08:32:37 -07:00
|
|
|
if (auxFieldHandlers[i].isPresent(node)) {
|
|
|
|
ci = sdscatprintf(ci, ",%s=", auxFieldHandlers[i].field);
|
|
|
|
ci = auxFieldHandlers[i].getter(node, ci);
|
|
|
|
}
|
2023-02-14 16:47:55 -05:00
|
|
|
}
|
2022-11-16 19:24:18 -08:00
|
|
|
}
|
|
|
|
|
2014-01-22 18:09:06 +01:00
|
|
|
/* Flags */
|
2022-11-16 19:24:18 -08:00
|
|
|
ci = sdscatlen(ci," ",1);
|
2015-07-27 15:08:58 +02:00
|
|
|
ci = representClusterNodeFlags(ci, node->flags);
|
2014-01-22 18:09:06 +01:00
|
|
|
|
|
|
|
/* Slave of... or just "-" */
|
2021-01-14 04:36:03 +08:00
|
|
|
ci = sdscatlen(ci," ",1);
|
2015-03-20 16:42:49 +01:00
|
|
|
if (node->slaveof)
|
2021-01-14 04:36:03 +08:00
|
|
|
ci = sdscatlen(ci,node->slaveof->name,CLUSTER_NAMELEN);
|
2015-03-20 16:42:49 +01:00
|
|
|
else
|
2021-01-14 04:36:03 +08:00
|
|
|
ci = sdscatlen(ci,"-",1);
|
2014-01-22 18:09:06 +01:00
|
|
|
|
2020-07-13 07:16:06 -07:00
|
|
|
unsigned long long nodeEpoch = node->configEpoch;
|
|
|
|
if (nodeIsSlave(node) && node->slaveof) {
|
|
|
|
nodeEpoch = node->slaveof->configEpoch;
|
|
|
|
}
|
2015-03-21 12:12:23 +01:00
|
|
|
/* Latency from the POV of this node, config epoch, link status */
|
2021-01-14 04:36:03 +08:00
|
|
|
ci = sdscatfmt(ci," %I %I %U %s",
|
2014-01-22 18:09:06 +01:00
|
|
|
(long long) node->ping_sent,
|
|
|
|
(long long) node->pong_received,
|
2020-07-13 07:16:06 -07:00
|
|
|
nodeEpoch,
|
2015-07-27 14:55:45 +02:00
|
|
|
(node->link || node->flags & CLUSTER_NODE_MYSELF) ?
|
2014-01-22 18:09:06 +01:00
|
|
|
"connected" : "disconnected");
|
|
|
|
|
2021-01-14 04:36:03 +08:00
|
|
|
/* Slots served by this instance. If we already have slots info,
|
2021-06-10 20:39:33 +08:00
|
|
|
* append it directly, otherwise, generate slots only if it has. */
|
2022-03-16 02:24:40 +01:00
|
|
|
if (node->slot_info_pairs) {
|
2022-03-29 10:05:06 +03:00
|
|
|
ci = representSlotInfo(ci, node->slot_info_pairs, node->slot_info_pairs_count);
|
2021-01-14 04:36:03 +08:00
|
|
|
} else if (node->numslots > 0) {
|
|
|
|
start = -1;
|
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
|
|
|
int bit;
|
2014-01-22 18:09:06 +01:00
|
|
|
|
2023-11-01 12:37:00 +02:00
|
|
|
if ((bit = clusterNodeCoversSlot(node, j)) != 0) {
|
2021-01-14 04:36:03 +08:00
|
|
|
if (start == -1) start = j;
|
|
|
|
}
|
|
|
|
if (start != -1 && (!bit || j == CLUSTER_SLOTS-1)) {
|
|
|
|
if (bit && j == CLUSTER_SLOTS-1) j++;
|
2014-01-22 18:09:06 +01:00
|
|
|
|
2021-01-14 04:36:03 +08:00
|
|
|
if (start == j-1) {
|
|
|
|
ci = sdscatfmt(ci," %i",start);
|
|
|
|
} else {
|
|
|
|
ci = sdscatfmt(ci," %i-%i",start,j-1);
|
|
|
|
}
|
|
|
|
start = -1;
|
2014-01-22 18:09:06 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Just for MYSELF node we also dump info about slots that
|
|
|
|
* we are migrating to other instances or importing from other
|
|
|
|
* instances. */
|
2015-07-27 14:55:45 +02:00
|
|
|
if (node->flags & CLUSTER_NODE_MYSELF) {
|
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
2014-01-22 18:09:06 +01:00
|
|
|
if (server.cluster->migrating_slots_to[j]) {
|
|
|
|
ci = sdscatprintf(ci," [%d->-%.40s]",j,
|
|
|
|
server.cluster->migrating_slots_to[j]->name);
|
|
|
|
} else if (server.cluster->importing_slots_from[j]) {
|
|
|
|
ci = sdscatprintf(ci," [%d-<-%.40s]",j,
|
|
|
|
server.cluster->importing_slots_from[j]->name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
|
2021-01-14 04:36:03 +08:00
|
|
|
/* Generate the slot topology for all nodes and store the string representation
|
|
|
|
* in the slots_info struct on the node. This is used to improve the efficiency
|
|
|
|
* of clusterGenNodesDescription() because it removes looping of the slot space
|
|
|
|
* for generating the slot info for each node individually. */
|
|
|
|
void clusterGenNodesSlotsInfo(int filter) {
|
|
|
|
clusterNode *n = NULL;
|
|
|
|
int start = -1;
|
|
|
|
|
|
|
|
for (int i = 0; i <= CLUSTER_SLOTS; i++) {
|
|
|
|
/* Find start node and slot id. */
|
|
|
|
if (n == NULL) {
|
|
|
|
if (i == CLUSTER_SLOTS) break;
|
|
|
|
n = server.cluster->slots[i];
|
|
|
|
start = i;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Generate slots info when occur different node with start
|
|
|
|
* or end of slot. */
|
|
|
|
if (i == CLUSTER_SLOTS || n != server.cluster->slots[i]) {
|
|
|
|
if (!(n->flags & filter)) {
|
2022-04-10 10:52:36 +08:00
|
|
|
if (!n->slot_info_pairs) {
|
|
|
|
n->slot_info_pairs = zmalloc(2 * n->numslots * sizeof(uint16_t));
|
2021-01-14 04:36:03 +08:00
|
|
|
}
|
2022-04-10 10:52:36 +08:00
|
|
|
serverAssert((n->slot_info_pairs_count + 1) < (2 * n->numslots));
|
2022-03-29 10:05:06 +03:00
|
|
|
n->slot_info_pairs[n->slot_info_pairs_count++] = start;
|
|
|
|
n->slot_info_pairs[n->slot_info_pairs_count++] = i-1;
|
2021-01-14 04:36:03 +08:00
|
|
|
}
|
|
|
|
if (i == CLUSTER_SLOTS) break;
|
|
|
|
n = server.cluster->slots[i];
|
|
|
|
start = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-29 10:05:06 +03:00
|
|
|
void clusterFreeNodesSlotsInfo(clusterNode *n) {
|
|
|
|
zfree(n->slot_info_pairs);
|
|
|
|
n->slot_info_pairs = NULL;
|
|
|
|
n->slot_info_pairs_count = 0;
|
|
|
|
}
|
|
|
|
|
2013-09-04 10:25:26 +02:00
|
|
|
/* Generate a csv-alike representation of the nodes we are aware of,
|
|
|
|
* including the "myself" node, and return an SDS string containing the
|
|
|
|
* representation (it is up to the caller to free it).
|
|
|
|
*
|
|
|
|
* All the nodes matching at least one of the node flags specified in
|
|
|
|
* "filter" are excluded from the output, so using zero as a filter will
|
|
|
|
* include all the known nodes in the representation, including nodes in
|
|
|
|
* the HANDSHAKE state.
|
|
|
|
*
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
* Setting tls_primary to 1 to put TLS port in the main <ip>:<port>
|
|
|
|
* field and put TCP port in aux field, instead of the opposite way.
|
2021-03-30 22:11:32 +02:00
|
|
|
*
|
2013-09-04 10:25:26 +02:00
|
|
|
* The representation obtained using this function is used for the output
|
|
|
|
* of the CLUSTER NODES function, and as format for the cluster
|
|
|
|
* configuration file (nodes.conf) for a given node. */
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
sds clusterGenNodesDescription(client *c, int filter, int tls_primary) {
|
2015-03-20 16:42:49 +01:00
|
|
|
sds ci = sdsempty(), ni;
|
2011-03-30 14:58:19 +02:00
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
|
2021-01-14 04:36:03 +08:00
|
|
|
/* Generate all nodes slots info firstly. */
|
|
|
|
clusterGenNodesSlotsInfo(filter);
|
|
|
|
|
2013-09-04 10:07:50 +02:00
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
2011-03-30 14:58:19 +02:00
|
|
|
while((de = dictNext(di)) != NULL) {
|
2011-11-08 17:07:55 +01:00
|
|
|
clusterNode *node = dictGetVal(de);
|
2011-03-30 14:58:19 +02:00
|
|
|
|
2013-09-04 10:25:26 +02:00
|
|
|
if (node->flags & filter) continue;
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
ni = clusterGenNodeDescription(c, node, tls_primary);
|
2015-03-20 16:42:49 +01:00
|
|
|
ci = sdscatsds(ci,ni);
|
|
|
|
sdsfree(ni);
|
2011-04-07 19:04:16 +02:00
|
|
|
ci = sdscatlen(ci,"\n",1);
|
2021-01-14 04:36:03 +08:00
|
|
|
|
|
|
|
/* Release slots info. */
|
2022-03-29 10:05:06 +03:00
|
|
|
clusterFreeNodesSlotsInfo(node);
|
2011-03-30 14:58:19 +02:00
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
|
2021-12-16 21:56:59 -08:00
|
|
|
/* Add to the output buffer of the given client the description of the given cluster link.
|
|
|
|
* The description is a map with each entry being an attribute of the link. */
|
|
|
|
void addReplyClusterLinkDescription(client *c, clusterLink *link) {
|
|
|
|
addReplyMapLen(c, 6);
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "direction");
|
|
|
|
addReplyBulkCString(c, link->inbound ? "from" : "to");
|
|
|
|
|
|
|
|
/* addReplyClusterLinkDescription is only called for links that have been
|
|
|
|
* associated with nodes. The association is always bi-directional, so
|
|
|
|
* in addReplyClusterLinkDescription, link->node should never be NULL. */
|
|
|
|
serverAssert(link->node);
|
|
|
|
sds node_name = sdsnewlen(link->node->name, CLUSTER_NAMELEN);
|
|
|
|
addReplyBulkCString(c, "node");
|
|
|
|
addReplyBulkCString(c, node_name);
|
|
|
|
sdsfree(node_name);
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "create-time");
|
|
|
|
addReplyLongLong(c, link->ctime);
|
|
|
|
|
|
|
|
char events[3], *p;
|
|
|
|
p = events;
|
|
|
|
if (link->conn) {
|
|
|
|
if (connHasReadHandler(link->conn)) *p++ = 'r';
|
|
|
|
if (connHasWriteHandler(link->conn)) *p++ = 'w';
|
|
|
|
}
|
|
|
|
*p = '\0';
|
|
|
|
addReplyBulkCString(c, "events");
|
|
|
|
addReplyBulkCString(c, events);
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "send-buffer-allocated");
|
2022-11-01 22:26:44 -04:00
|
|
|
addReplyLongLong(c, link->send_msg_queue_mem);
|
2021-12-16 21:56:59 -08:00
|
|
|
|
|
|
|
addReplyBulkCString(c, "send-buffer-used");
|
2022-11-01 22:26:44 -04:00
|
|
|
addReplyLongLong(c, link->send_msg_queue_mem);
|
2021-12-16 21:56:59 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Add to the output buffer of the given client an array of cluster link descriptions,
|
|
|
|
* with array entry being a description of a single current cluster link. */
|
|
|
|
void addReplyClusterLinksDescription(client *c) {
|
|
|
|
dictIterator *di;
|
|
|
|
dictEntry *de;
|
|
|
|
void *arraylen_ptr = NULL;
|
|
|
|
int num_links = 0;
|
|
|
|
|
|
|
|
arraylen_ptr = addReplyDeferredLen(c);
|
|
|
|
|
|
|
|
di = dictGetSafeIterator(server.cluster->nodes);
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
if (node->link) {
|
|
|
|
num_links++;
|
|
|
|
addReplyClusterLinkDescription(c, node->link);
|
|
|
|
}
|
|
|
|
if (node->inbound_link) {
|
|
|
|
num_links++;
|
|
|
|
addReplyClusterLinkDescription(c, node->inbound_link);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
|
|
|
|
setDeferredArrayLen(c, arraylen_ptr, num_links);
|
|
|
|
}
|
|
|
|
|
2014-08-08 15:52:04 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* CLUSTER command
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
2017-04-13 19:22:35 +02:00
|
|
|
const char *clusterGetMessageTypeString(int type) {
|
|
|
|
switch(type) {
|
|
|
|
case CLUSTERMSG_TYPE_PING: return "ping";
|
|
|
|
case CLUSTERMSG_TYPE_PONG: return "pong";
|
|
|
|
case CLUSTERMSG_TYPE_MEET: return "meet";
|
|
|
|
case CLUSTERMSG_TYPE_FAIL: return "fail";
|
|
|
|
case CLUSTERMSG_TYPE_PUBLISH: return "publish";
|
2022-01-03 01:54:47 +01:00
|
|
|
case CLUSTERMSG_TYPE_PUBLISHSHARD: return "publishshard";
|
2017-04-13 19:22:35 +02:00
|
|
|
case CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST: return "auth-req";
|
|
|
|
case CLUSTERMSG_TYPE_FAILOVER_AUTH_ACK: return "auth-ack";
|
|
|
|
case CLUSTERMSG_TYPE_UPDATE: return "update";
|
|
|
|
case CLUSTERMSG_TYPE_MFSTART: return "mfstart";
|
2018-03-29 15:13:31 +02:00
|
|
|
case CLUSTERMSG_TYPE_MODULE: return "module";
|
2017-04-13 19:22:35 +02:00
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
|
|
|
|
2015-07-26 15:20:46 +02:00
|
|
|
int getSlotOrReply(client *c, robj *o) {
|
2011-05-06 15:44:09 +02:00
|
|
|
long long slot;
|
|
|
|
|
2015-07-26 23:17:55 +02:00
|
|
|
if (getLongLongFromObject(o,&slot) != C_OK ||
|
2015-07-27 14:55:45 +02:00
|
|
|
slot < 0 || slot >= CLUSTER_SLOTS)
|
2011-05-06 15:44:09 +02:00
|
|
|
{
|
|
|
|
addReplyError(c,"Invalid or out of range slot");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
return (int) slot;
|
|
|
|
}
|
|
|
|
|
2021-10-27 00:44:33 -04:00
|
|
|
int checkSlotAssignmentsOrReply(client *c, unsigned char *slots, int del, int start_slot, int end_slot) {
|
|
|
|
int slot;
|
|
|
|
for (slot = start_slot; slot <= end_slot; slot++) {
|
|
|
|
if (del && server.cluster->slots[slot] == NULL) {
|
|
|
|
addReplyErrorFormat(c,"Slot %d is already unassigned", slot);
|
|
|
|
return C_ERR;
|
|
|
|
} else if (!del && server.cluster->slots[slot]) {
|
|
|
|
addReplyErrorFormat(c,"Slot %d is already busy", slot);
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
if (slots[slot]++ == 1) {
|
|
|
|
addReplyErrorFormat(c,"Slot %d specified multiple times",(int)slot);
|
|
|
|
return C_ERR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return C_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clusterUpdateSlots(client *c, unsigned char *slots, int del) {
|
|
|
|
int j;
|
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
|
|
|
if (slots[j]) {
|
|
|
|
int retval;
|
|
|
|
|
|
|
|
/* If this slot was set as importing we can clear this
|
|
|
|
* state as now we are the real owner of the slot. */
|
|
|
|
if (server.cluster->importing_slots_from[j])
|
|
|
|
server.cluster->importing_slots_from[j] = NULL;
|
|
|
|
|
|
|
|
retval = del ? clusterDelSlot(j) :
|
|
|
|
clusterAddSlot(myself,j);
|
|
|
|
serverAssertWithInfo(c,NULL,retval == C_OK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-16 02:24:40 +01:00
|
|
|
/* Add detailed information of a node to the output buffer of the given client. */
|
|
|
|
void addNodeDetailsToShardReply(client *c, clusterNode *node) {
|
|
|
|
int reply_count = 0;
|
|
|
|
void *node_replylen = addReplyDeferredLen(c);
|
|
|
|
addReplyBulkCString(c, "id");
|
|
|
|
addReplyBulkCBuffer(c, node->name, CLUSTER_NAMELEN);
|
|
|
|
reply_count++;
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (node->tcp_port) {
|
2022-03-16 02:24:40 +01:00
|
|
|
addReplyBulkCString(c, "port");
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
addReplyLongLong(c, node->tcp_port);
|
2022-03-16 02:24:40 +01:00
|
|
|
reply_count++;
|
|
|
|
}
|
|
|
|
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
if (node->tls_port) {
|
2022-03-16 02:24:40 +01:00
|
|
|
addReplyBulkCString(c, "tls-port");
|
Support TLS service when "tls-cluster" is not enabled and persist both plain and TLS port in nodes.conf (#12233)
Originally, when "tls-cluster" is enabled, `port` is set to TLS port. In order to support non-TLS clients, `pport` is used to propagate TCP port across cluster nodes. However when "tls-cluster" is disabled, `port` is set to TCP port, and `pport` is not used, which means the cluster cannot provide TLS service unless "tls-cluster" is on.
```
typedef struct {
// ...
uint16_t port; /* Latest known clients port (TLS or plain). */
uint16_t pport; /* Latest known clients plaintext port. Only used if the main clients port is for TLS. */
// ...
} clusterNode;
```
```
typedef struct {
// ...
uint16_t port; /* TCP base port number. */
uint16_t pport; /* Sender TCP plaintext port, if base port is TLS */
// ...
} clusterMsg;
```
This PR renames `port` and `pport` in `clusterNode` to `tcp_port` and `tls_port`, to record both ports no matter "tls-cluster" is enabled or disabled.
This allows to provide TLS service to clients when "tls-cluster" is disabled: when displaying cluster topology, or giving `MOVED` error, server can provide TLS or TCP port according to client's connection type, no matter what type of connection cluster bus is using.
For backwards compatibility, `port` and `pport` in `clusterMsg` are preserved, when "tls-cluster" is enabled, `port` is set to TLS port and `pport` is set to TCP port, when "tls-cluster" is disabled, `port` is set to TCP port and `pport` is set to TLS port (instead of 0).
Also, in the nodes.conf file, a new aux field displaying an extra port is added to complete the persisted info. We may have `tls_port=xxxxx` or `tcp_port=xxxxx` in the aux field, to complete the cluster topology, while the other port is stored in the normal `<ip>:<port>` field. The format is shown below.
```
<node-id> <ip>:<tcp_port>@<cport>,<hostname>,shard-id=...,tls-port=6379 myself,master - 0 0 0 connected 0-1000
```
Or we can switch the position of two ports, both can be correctly resolved.
```
<node-id> <ip>:<tls_port>@<cport>,<hostname>,shard-id=...,tcp-port=6379 myself,master - 0 0 0 connected 0-1000
```
2023-06-26 22:43:38 +08:00
|
|
|
addReplyLongLong(c, node->tls_port);
|
2022-03-16 02:24:40 +01:00
|
|
|
reply_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "ip");
|
|
|
|
addReplyBulkCString(c, node->ip);
|
|
|
|
reply_count++;
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "endpoint");
|
2023-11-09 11:04:47 +02:00
|
|
|
addReplyBulkCString(c, clusterNodePreferredEndpoint(node));
|
2022-03-16 02:24:40 +01:00
|
|
|
reply_count++;
|
|
|
|
|
2022-09-23 02:39:34 +08:00
|
|
|
if (sdslen(node->hostname) != 0) {
|
2022-03-16 02:24:40 +01:00
|
|
|
addReplyBulkCString(c, "hostname");
|
2022-09-23 02:39:34 +08:00
|
|
|
addReplyBulkCBuffer(c, node->hostname, sdslen(node->hostname));
|
2022-03-16 02:24:40 +01:00
|
|
|
reply_count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long node_offset;
|
|
|
|
if (node->flags & CLUSTER_NODE_MYSELF) {
|
|
|
|
node_offset = nodeIsSlave(node) ? replicationGetSlaveOffset() : server.master_repl_offset;
|
|
|
|
} else {
|
|
|
|
node_offset = node->repl_offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "role");
|
|
|
|
addReplyBulkCString(c, nodeIsSlave(node) ? "replica" : "master");
|
|
|
|
reply_count++;
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "replication-offset");
|
|
|
|
addReplyLongLong(c, node_offset);
|
|
|
|
reply_count++;
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "health");
|
|
|
|
const char *health_msg = NULL;
|
|
|
|
if (nodeFailed(node)) {
|
|
|
|
health_msg = "fail";
|
|
|
|
} else if (nodeIsSlave(node) && node_offset == 0) {
|
|
|
|
health_msg = "loading";
|
|
|
|
} else {
|
|
|
|
health_msg = "online";
|
|
|
|
}
|
|
|
|
addReplyBulkCString(c, health_msg);
|
|
|
|
reply_count++;
|
|
|
|
|
|
|
|
setDeferredMapLen(c, node_replylen, reply_count);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add the shard reply of a single shard based off the given primary node. */
|
2022-11-16 19:24:18 -08:00
|
|
|
void addShardReplyForClusterShards(client *c, list *nodes) {
|
|
|
|
serverAssert(listLength(nodes) > 0);
|
|
|
|
clusterNode *n = listNodeValue(listFirst(nodes));
|
2022-03-16 02:24:40 +01:00
|
|
|
addReplyMapLen(c, 2);
|
|
|
|
addReplyBulkCString(c, "slots");
|
2022-11-16 19:24:18 -08:00
|
|
|
|
|
|
|
/* Use slot_info_pairs from the primary only */
|
|
|
|
while (n->slaveof != NULL) n = n->slaveof;
|
|
|
|
|
|
|
|
if (n->slot_info_pairs != NULL) {
|
|
|
|
serverAssert((n->slot_info_pairs_count % 2) == 0);
|
|
|
|
addReplyArrayLen(c, n->slot_info_pairs_count);
|
|
|
|
for (int i = 0; i < n->slot_info_pairs_count; i++)
|
2023-09-10 14:33:00 +08:00
|
|
|
addReplyLongLong(c, (unsigned long)n->slot_info_pairs[i]);
|
2022-03-16 02:24:40 +01:00
|
|
|
} else {
|
|
|
|
/* If no slot info pair is provided, the node owns no slots */
|
|
|
|
addReplyArrayLen(c, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
addReplyBulkCString(c, "nodes");
|
2022-11-16 19:24:18 -08:00
|
|
|
addReplyArrayLen(c, listLength(nodes));
|
|
|
|
listIter li;
|
|
|
|
listRewind(nodes, &li);
|
|
|
|
for (listNode *ln = listNext(&li); ln != NULL; ln = listNext(&li)) {
|
|
|
|
clusterNode *n = listNodeValue(ln);
|
|
|
|
addNodeDetailsToShardReply(c, n);
|
|
|
|
clusterFreeNodesSlotsInfo(n);
|
2022-03-16 02:24:40 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Add to the output buffer of the given client, an array of slot (start, end)
|
|
|
|
* pair owned by the shard, also the primary and set of replica(s) along with
|
|
|
|
* information about each node. */
|
2023-11-01 14:51:49 +02:00
|
|
|
void clusterCommandShards(client *c) {
|
2022-11-16 19:24:18 -08:00
|
|
|
addReplyArrayLen(c, dictSize(server.cluster->shards));
|
2022-03-16 02:24:40 +01:00
|
|
|
/* This call will add slot_info_pairs to all nodes */
|
|
|
|
clusterGenNodesSlotsInfo(0);
|
2022-11-16 19:24:18 -08:00
|
|
|
dictIterator *di = dictGetSafeIterator(server.cluster->shards);
|
|
|
|
for(dictEntry *de = dictNext(di); de != NULL; de = dictNext(di)) {
|
|
|
|
addShardReplyForClusterShards(c, dictGetVal(de));
|
2022-03-16 02:24:40 +01:00
|
|
|
}
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
}
|
|
|
|
|
2023-05-02 17:31:32 -07:00
|
|
|
sds genClusterInfoString(void) {
|
2023-01-02 09:41:54 +02:00
|
|
|
sds info = sdsempty();
|
|
|
|
char *statestr[] = {"ok","fail"};
|
|
|
|
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
|
|
|
|
uint64_t myepoch;
|
|
|
|
int j;
|
|
|
|
|
|
|
|
for (j = 0; j < CLUSTER_SLOTS; j++) {
|
|
|
|
clusterNode *n = server.cluster->slots[j];
|
|
|
|
|
|
|
|
if (n == NULL) continue;
|
|
|
|
slots_assigned++;
|
|
|
|
if (nodeFailed(n)) {
|
|
|
|
slots_fail++;
|
|
|
|
} else if (nodeTimedOut(n)) {
|
|
|
|
slots_pfail++;
|
|
|
|
} else {
|
|
|
|
slots_ok++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
myepoch = (nodeIsSlave(myself) && myself->slaveof) ?
|
|
|
|
myself->slaveof->configEpoch : myself->configEpoch;
|
|
|
|
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"cluster_state:%s\r\n"
|
|
|
|
"cluster_slots_assigned:%d\r\n"
|
|
|
|
"cluster_slots_ok:%d\r\n"
|
|
|
|
"cluster_slots_pfail:%d\r\n"
|
|
|
|
"cluster_slots_fail:%d\r\n"
|
|
|
|
"cluster_known_nodes:%lu\r\n"
|
|
|
|
"cluster_size:%d\r\n"
|
|
|
|
"cluster_current_epoch:%llu\r\n"
|
|
|
|
"cluster_my_epoch:%llu\r\n"
|
|
|
|
, statestr[server.cluster->state],
|
|
|
|
slots_assigned,
|
|
|
|
slots_ok,
|
|
|
|
slots_pfail,
|
|
|
|
slots_fail,
|
|
|
|
dictSize(server.cluster->nodes),
|
|
|
|
server.cluster->size,
|
|
|
|
(unsigned long long) server.cluster->currentEpoch,
|
|
|
|
(unsigned long long) myepoch
|
|
|
|
);
|
|
|
|
|
|
|
|
/* Show stats about messages sent and received. */
|
|
|
|
long long tot_msg_sent = 0;
|
|
|
|
long long tot_msg_received = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < CLUSTERMSG_TYPE_COUNT; i++) {
|
|
|
|
if (server.cluster->stats_bus_messages_sent[i] == 0) continue;
|
|
|
|
tot_msg_sent += server.cluster->stats_bus_messages_sent[i];
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"cluster_stats_messages_%s_sent:%lld\r\n",
|
|
|
|
clusterGetMessageTypeString(i),
|
|
|
|
server.cluster->stats_bus_messages_sent[i]);
|
|
|
|
}
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"cluster_stats_messages_sent:%lld\r\n", tot_msg_sent);
|
|
|
|
|
|
|
|
for (int i = 0; i < CLUSTERMSG_TYPE_COUNT; i++) {
|
|
|
|
if (server.cluster->stats_bus_messages_received[i] == 0) continue;
|
|
|
|
tot_msg_received += server.cluster->stats_bus_messages_received[i];
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"cluster_stats_messages_%s_received:%lld\r\n",
|
|
|
|
clusterGetMessageTypeString(i),
|
|
|
|
server.cluster->stats_bus_messages_received[i]);
|
|
|
|
}
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"cluster_stats_messages_received:%lld\r\n", tot_msg_received);
|
|
|
|
|
|
|
|
info = sdscatprintf(info,
|
|
|
|
"total_cluster_links_buffer_limit_exceeded:%llu\r\n",
|
|
|
|
server.cluster->stat_cluster_links_buffer_limit_exceeded);
|
|
|
|
|
|
|
|
return info;
|
|
|
|
}
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
|
|
|
|
void removeChannelsInSlot(unsigned int slot) {
|
|
|
|
unsigned int channelcount = countChannelsInSlot(slot);
|
|
|
|
if (channelcount == 0) return;
|
|
|
|
|
|
|
|
/* Retrieve all the channels for the slot. */
|
|
|
|
robj **channels = zmalloc(sizeof(robj*)*channelcount);
|
|
|
|
raxIterator iter;
|
|
|
|
int j = 0;
|
|
|
|
unsigned char indexed[2];
|
|
|
|
|
|
|
|
indexed[0] = (slot >> 8) & 0xff;
|
|
|
|
indexed[1] = slot & 0xff;
|
|
|
|
raxStart(&iter,server.cluster->slots_to_channels);
|
|
|
|
raxSeek(&iter,">=",indexed,2);
|
|
|
|
while(raxNext(&iter)) {
|
|
|
|
if (iter.key[0] != indexed[0] || iter.key[1] != indexed[1]) break;
|
|
|
|
channels[j++] = createStringObject((char*)iter.key + 2, iter.key_len - 2);
|
|
|
|
}
|
|
|
|
raxStop(&iter);
|
|
|
|
|
|
|
|
pubsubUnsubscribeShardChannels(channels, channelcount);
|
|
|
|
zfree(channels);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-12 16:34:20 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Remove all the keys in the specified hash slot.
|
|
|
|
* The number of removed items is returned. */
|
|
|
|
unsigned int delKeysInSlot(unsigned int hashslot) {
|
|
|
|
unsigned int j = 0;
|
2014-05-12 16:34:20 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
dictIterator *iter = NULL;
|
|
|
|
dictEntry *de = NULL;
|
|
|
|
iter = dictGetSafeIterator(server.db->dict[hashslot]);
|
|
|
|
while((de = dictNext(iter)) != NULL) {
|
|
|
|
sds sdskey = dictGetKey(de);
|
|
|
|
robj *key = createStringObject(sdskey, sdslen(sdskey));
|
|
|
|
dbDelete(&server.db[0], key);
|
|
|
|
propagateDeletion(&server.db[0], key, server.lazyfree_lazy_server_del);
|
|
|
|
signalModifiedKey(NULL, &server.db[0], key);
|
|
|
|
/* The keys are not actually logically deleted from the database, just moved to another node.
|
|
|
|
* The modules needs to know that these keys are no longer available locally, so just send the
|
|
|
|
* keyspace notification to the modules, but not to clients. */
|
|
|
|
moduleNotifyKeyspaceEvent(NOTIFY_GENERIC, "del", key, server.db[0].id);
|
|
|
|
postExecutionUnitOperations();
|
|
|
|
decrRefCount(key);
|
|
|
|
j++;
|
|
|
|
server.dirty++;
|
|
|
|
}
|
|
|
|
dictReleaseIterator(iter);
|
2014-04-29 19:15:16 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
return j;
|
|
|
|
}
|
2014-04-29 19:15:16 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* -----------------------------------------------------------------------------
|
|
|
|
* Operation(s) on channel rax tree.
|
|
|
|
* -------------------------------------------------------------------------- */
|
2014-05-15 11:43:06 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
void slotToChannelUpdate(sds channel, int add) {
|
|
|
|
size_t keylen = sdslen(channel);
|
|
|
|
unsigned int hashslot = keyHashSlot(channel,keylen);
|
|
|
|
unsigned char buf[64];
|
|
|
|
unsigned char *indexed = buf;
|
2014-05-15 11:43:06 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (keylen+2 > 64) indexed = zmalloc(keylen+2);
|
|
|
|
indexed[0] = (hashslot >> 8) & 0xff;
|
|
|
|
indexed[1] = hashslot & 0xff;
|
|
|
|
memcpy(indexed+2,channel,keylen);
|
|
|
|
if (add) {
|
|
|
|
raxInsert(server.cluster->slots_to_channels,indexed,keylen+2,NULL,NULL);
|
2011-03-29 17:51:15 +02:00
|
|
|
} else {
|
2023-11-01 14:51:49 +02:00
|
|
|
raxRemove(server.cluster->slots_to_channels,indexed,keylen+2,NULL);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
if (indexed != buf) zfree(indexed);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
void slotToChannelAdd(sds channel) {
|
|
|
|
slotToChannelUpdate(channel,1);
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
void slotToChannelDel(sds channel) {
|
|
|
|
slotToChannelUpdate(channel,0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get the count of the channels for a given slot. */
|
|
|
|
unsigned int countChannelsInSlot(unsigned int hashslot) {
|
2022-01-03 01:54:47 +01:00
|
|
|
raxIterator iter;
|
|
|
|
int j = 0;
|
|
|
|
unsigned char indexed[2];
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
indexed[0] = (hashslot >> 8) & 0xff;
|
|
|
|
indexed[1] = hashslot & 0xff;
|
2022-01-03 01:54:47 +01:00
|
|
|
raxStart(&iter,server.cluster->slots_to_channels);
|
|
|
|
raxSeek(&iter,">=",indexed,2);
|
|
|
|
while(raxNext(&iter)) {
|
|
|
|
if (iter.key[0] != indexed[0] || iter.key[1] != indexed[1]) break;
|
2023-11-01 14:51:49 +02:00
|
|
|
j++;
|
2022-01-03 01:54:47 +01:00
|
|
|
}
|
|
|
|
raxStop(&iter);
|
2023-11-01 14:51:49 +02:00
|
|
|
return j;
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodeIsMyself(clusterNode *n) {
|
|
|
|
return n == server.cluster->myself;
|
2022-01-03 01:54:47 +01:00
|
|
|
}
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
clusterNode* getMyClusterNode(void) {
|
|
|
|
return server.cluster->myself;
|
|
|
|
}
|
2011-04-01 18:59:28 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterManualFailoverTimeLimit(void) {
|
|
|
|
return server.cluster->mf_end;
|
|
|
|
}
|
2014-01-14 16:33:14 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int getClusterSize(void) {
|
|
|
|
return dictSize(server.cluster->nodes);
|
2014-01-14 16:33:14 +01:00
|
|
|
}
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
char** getClusterNodesList(size_t *numnodes) {
|
|
|
|
size_t count = dictSize(server.cluster->nodes);
|
|
|
|
char **ids = zmalloc((count+1)*CLUSTER_NAMELEN);
|
|
|
|
dictIterator *di = dictGetIterator(server.cluster->nodes);
|
|
|
|
dictEntry *de;
|
|
|
|
int j = 0;
|
|
|
|
while((de = dictNext(di)) != NULL) {
|
|
|
|
clusterNode *node = dictGetVal(de);
|
|
|
|
if (node->flags & (CLUSTER_NODE_NOADDR|CLUSTER_NODE_HANDSHAKE)) continue;
|
|
|
|
ids[j] = zmalloc(CLUSTER_NAMELEN);
|
|
|
|
memcpy(ids[j],node->name,CLUSTER_NAMELEN);
|
|
|
|
j++;
|
2021-06-22 05:02:44 +08:00
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
*numnodes = j;
|
|
|
|
ids[j] = NULL; /* Null term so that FreeClusterNodesList does not need
|
|
|
|
* to also get the count argument. */
|
|
|
|
dictReleaseIterator(di);
|
|
|
|
return ids;
|
2014-01-14 16:33:14 +01:00
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
int clusterNodeIsMaster(clusterNode *n) {
|
2023-11-01 14:51:49 +02:00
|
|
|
return n->flags & CLUSTER_NODE_MASTER;
|
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int handleDebugClusterCommand(client *c) {
|
|
|
|
if (strcasecmp(c->argv[1]->ptr, "CLUSTERLINK") ||
|
|
|
|
strcasecmp(c->argv[2]->ptr, "KILL") ||
|
|
|
|
c->argc != 5) {
|
|
|
|
return 0;
|
|
|
|
}
|
2018-09-19 11:31:22 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (!server.cluster_enabled) {
|
|
|
|
addReplyError(c, "Debug option only available for cluster mode enabled setup!");
|
|
|
|
return 1;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Find the node. */
|
|
|
|
clusterNode *n = clusterLookupNode(c->argv[4]->ptr, sdslen(c->argv[4]->ptr));
|
|
|
|
if (!n) {
|
|
|
|
addReplyErrorFormat(c, "Unknown node %s", (char *) c->argv[4]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
2018-09-19 11:20:52 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Terminate the link based on the direction or all. */
|
|
|
|
if (!strcasecmp(c->argv[3]->ptr, "from")) {
|
|
|
|
freeClusterLink(n->inbound_link);
|
|
|
|
} else if (!strcasecmp(c->argv[3]->ptr, "to")) {
|
|
|
|
freeClusterLink(n->link);
|
|
|
|
} else if (!strcasecmp(c->argv[3]->ptr, "all")) {
|
|
|
|
freeClusterLink(n->link);
|
|
|
|
freeClusterLink(n->inbound_link);
|
2011-03-29 17:51:15 +02:00
|
|
|
} else {
|
2023-11-01 14:51:49 +02:00
|
|
|
addReplyErrorFormat(c, "Unknown direction %s", (char *) c->argv[3]->ptr);
|
2011-03-29 17:51:15 +02:00
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
addReply(c, shared.ok);
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
return 1;
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodePending(clusterNode *node) {
|
|
|
|
return node->flags & (CLUSTER_NODE_NOADDR|CLUSTER_NODE_HANDSHAKE);
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
char* clusterNodeIp(clusterNode *node) {
|
|
|
|
return node->ip;
|
|
|
|
}
|
2011-03-29 17:51:15 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodeIsSlave(clusterNode *node) {
|
|
|
|
return node->flags & CLUSTER_NODE_SLAVE;
|
|
|
|
}
|
2020-10-05 17:03:17 +03:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
clusterNode *clusterNodeGetSlaveof(clusterNode *node) {
|
|
|
|
return node->slaveof;
|
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
char* clusterNodeGetName(clusterNode *node) {
|
|
|
|
return node->name;
|
|
|
|
}
|
2015-03-20 09:57:10 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodeTimedOut(clusterNode *node) {
|
|
|
|
return nodeTimedOut(node);
|
|
|
|
}
|
2015-03-20 09:57:10 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodeIsFailing(clusterNode *node) {
|
|
|
|
return nodeFailed(node);
|
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterNodeIsNoFailover(clusterNode *node) {
|
|
|
|
return node->flags & CLUSTER_NODE_NOFAILOVER;
|
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
const char **clusterDebugCommandExtendedHelp(void) {
|
2023-11-01 14:51:49 +02:00
|
|
|
static const char *help[] = {
|
|
|
|
"CLUSTERLINK KILL <to|from|all> <node-id>",
|
|
|
|
" Kills the link based on the direction to/from (both) with the provided node.",
|
|
|
|
NULL
|
|
|
|
};
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
return help;
|
|
|
|
}
|
2016-05-05 11:33:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
char* clusterNodeGetShardId(clusterNode *node) {
|
|
|
|
return node->shard_id;
|
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int clusterCommandSpecial(client *c) {
|
|
|
|
if (!strcasecmp(c->argv[1]->ptr,"meet") && (c->argc == 4 || c->argc == 5)) {
|
|
|
|
/* CLUSTER MEET <ip> <port> [cport] */
|
|
|
|
long long port, cport;
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (getLongLongFromObject(c->argv[3], &port) != C_OK) {
|
|
|
|
addReplyErrorFormat(c,"Invalid base port specified: %s",
|
|
|
|
(char*)c->argv[3]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c->argc == 5) {
|
|
|
|
if (getLongLongFromObject(c->argv[4], &cport) != C_OK) {
|
|
|
|
addReplyErrorFormat(c,"Invalid bus port specified: %s",
|
|
|
|
(char*)c->argv[4]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
2022-06-14 12:32:43 +08:00
|
|
|
} else {
|
2023-11-01 14:51:49 +02:00
|
|
|
cport = port + CLUSTER_PORT_INCR;
|
2022-06-14 12:32:43 +08:00
|
|
|
}
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (clusterStartHandshake(c->argv[2]->ptr,port,cport) == 0 &&
|
|
|
|
errno == EINVAL)
|
|
|
|
{
|
|
|
|
addReplyErrorFormat(c,"Invalid node address specified: %s:%s",
|
|
|
|
(char*)c->argv[2]->ptr, (char*)c->argv[3]->ptr);
|
2014-03-07 13:19:09 +01:00
|
|
|
} else {
|
2023-11-01 14:51:49 +02:00
|
|
|
addReply(c,shared.ok);
|
2014-03-07 13:19:09 +01:00
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"flushslots") && c->argc == 2) {
|
|
|
|
/* CLUSTER FLUSHSLOTS */
|
|
|
|
if (dbSize(&server.db[0], DB_MAIN) != 0) {
|
|
|
|
addReplyError(c,"DB must be empty to perform CLUSTER FLUSHSLOTS.");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
clusterDelNodeSlots(myself);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if ((!strcasecmp(c->argv[1]->ptr,"addslots") ||
|
|
|
|
!strcasecmp(c->argv[1]->ptr,"delslots")) && c->argc >= 3) {
|
|
|
|
/* CLUSTER ADDSLOTS <slot> [slot] ... */
|
|
|
|
/* CLUSTER DELSLOTS <slot> [slot] ... */
|
|
|
|
int j, slot;
|
|
|
|
unsigned char *slots = zmalloc(CLUSTER_SLOTS);
|
|
|
|
int del = !strcasecmp(c->argv[1]->ptr,"delslots");
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
memset(slots,0,CLUSTER_SLOTS);
|
|
|
|
/* Check that all the arguments are parseable.*/
|
|
|
|
for (j = 2; j < c->argc; j++) {
|
|
|
|
if ((slot = getSlotOrReply(c,c->argv[j])) == C_ERR) {
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Check that the slots are not already busy. */
|
|
|
|
for (j = 2; j < c->argc; j++) {
|
|
|
|
slot = getSlotOrReply(c,c->argv[j]);
|
|
|
|
if (checkSlotAssignmentsOrReply(c, slots, del, slot, slot) == C_ERR) {
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clusterUpdateSlots(c, slots, del);
|
|
|
|
zfree(slots);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if ((!strcasecmp(c->argv[1]->ptr,"addslotsrange") ||
|
|
|
|
!strcasecmp(c->argv[1]->ptr,"delslotsrange")) && c->argc >= 4) {
|
|
|
|
if (c->argc % 2 == 1) {
|
|
|
|
addReplyErrorArity(c);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
/* CLUSTER ADDSLOTSRANGE <start slot> <end slot> [<start slot> <end slot> ...] */
|
|
|
|
/* CLUSTER DELSLOTSRANGE <start slot> <end slot> [<start slot> <end slot> ...] */
|
|
|
|
int j, startslot, endslot;
|
|
|
|
unsigned char *slots = zmalloc(CLUSTER_SLOTS);
|
|
|
|
int del = !strcasecmp(c->argv[1]->ptr,"delslotsrange");
|
2014-03-07 13:19:09 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
memset(slots,0,CLUSTER_SLOTS);
|
|
|
|
/* Check that all the arguments are parseable and that all the
|
|
|
|
* slots are not already busy. */
|
|
|
|
for (j = 2; j < c->argc; j += 2) {
|
|
|
|
if ((startslot = getSlotOrReply(c,c->argv[j])) == C_ERR) {
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if ((endslot = getSlotOrReply(c,c->argv[j+1])) == C_ERR) {
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (startslot > endslot) {
|
|
|
|
addReplyErrorFormat(c,"start slot number %d is greater than end slot number %d", startslot, endslot);
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
2015-03-24 11:07:10 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (checkSlotAssignmentsOrReply(c, slots, del, startslot, endslot) == C_ERR) {
|
|
|
|
zfree(slots);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
clusterUpdateSlots(c, slots, del);
|
|
|
|
zfree(slots);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"setslot") && c->argc >= 4) {
|
|
|
|
/* SETSLOT 10 MIGRATING <node ID> */
|
|
|
|
/* SETSLOT 10 IMPORTING <node ID> */
|
|
|
|
/* SETSLOT 10 STABLE */
|
|
|
|
/* SETSLOT 10 NODE <node ID> */
|
|
|
|
int slot;
|
|
|
|
clusterNode *n;
|
2015-03-24 11:07:10 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (nodeIsSlave(myself)) {
|
|
|
|
addReplyError(c,"Please use SETSLOT only with masters.");
|
2015-03-24 11:07:10 +01:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if ((slot = getSlotOrReply(c, c->argv[2])) == -1) return 1;
|
2015-03-24 11:07:10 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (!strcasecmp(c->argv[3]->ptr,"migrating") && c->argc == 5) {
|
|
|
|
if (server.cluster->slots[slot] != myself) {
|
|
|
|
addReplyErrorFormat(c,"I'm not the owner of hash slot %u",slot);
|
|
|
|
return 1;
|
2020-10-06 21:43:30 +03:00
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
n = clusterLookupNode(c->argv[4]->ptr, sdslen(c->argv[4]->ptr));
|
|
|
|
if (n == NULL) {
|
|
|
|
addReplyErrorFormat(c,"I don't know about node %s",
|
|
|
|
(char*)c->argv[4]->ptr);
|
2015-03-24 11:07:10 +01:00
|
|
|
return 1;
|
|
|
|
}
|
2023-11-01 14:51:49 +02:00
|
|
|
if (nodeIsSlave(n)) {
|
|
|
|
addReplyError(c,"Target node is not a master");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
server.cluster->migrating_slots_to[slot] = n;
|
|
|
|
} else if (!strcasecmp(c->argv[3]->ptr,"importing") && c->argc == 5) {
|
|
|
|
if (server.cluster->slots[slot] == myself) {
|
|
|
|
addReplyErrorFormat(c,
|
|
|
|
"I'm already the owner of hash slot %u",slot);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
n = clusterLookupNode(c->argv[4]->ptr, sdslen(c->argv[4]->ptr));
|
|
|
|
if (n == NULL) {
|
|
|
|
addReplyErrorFormat(c,"I don't know about node %s",
|
|
|
|
(char*)c->argv[4]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (nodeIsSlave(n)) {
|
|
|
|
addReplyError(c,"Target node is not a master");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
server.cluster->importing_slots_from[slot] = n;
|
|
|
|
} else if (!strcasecmp(c->argv[3]->ptr,"stable") && c->argc == 4) {
|
|
|
|
/* CLUSTER SETSLOT <SLOT> STABLE */
|
|
|
|
server.cluster->importing_slots_from[slot] = NULL;
|
|
|
|
server.cluster->migrating_slots_to[slot] = NULL;
|
|
|
|
} else if (!strcasecmp(c->argv[3]->ptr,"node") && c->argc == 5) {
|
|
|
|
/* CLUSTER SETSLOT <SLOT> NODE <NODE ID> */
|
|
|
|
n = clusterLookupNode(c->argv[4]->ptr, sdslen(c->argv[4]->ptr));
|
|
|
|
if (!n) {
|
|
|
|
addReplyErrorFormat(c,"Unknown node %s",
|
|
|
|
(char*)c->argv[4]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
if (nodeIsSlave(n)) {
|
|
|
|
addReplyError(c,"Target node is not a master");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
/* If this hash slot was served by 'myself' before to switch
|
|
|
|
* make sure there are no longer local keys for this hash slot. */
|
|
|
|
if (server.cluster->slots[slot] == myself && n != myself) {
|
|
|
|
if (countKeysInSlot(slot) != 0) {
|
|
|
|
addReplyErrorFormat(c,
|
|
|
|
"Can't assign hashslot %d to a different node "
|
|
|
|
"while I still hold keys for this hash slot.", slot);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* If this slot is in migrating status but we have no keys
|
|
|
|
* for it assigning the slot to another node will clear
|
|
|
|
* the migrating status. */
|
|
|
|
if (countKeysInSlot(slot) == 0 &&
|
|
|
|
server.cluster->migrating_slots_to[slot])
|
|
|
|
server.cluster->migrating_slots_to[slot] = NULL;
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
int slot_was_mine = server.cluster->slots[slot] == myself;
|
|
|
|
clusterDelSlot(slot);
|
|
|
|
clusterAddSlot(n,slot);
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* If we are a master left without slots, we should turn into a
|
|
|
|
* replica of the new master. */
|
|
|
|
if (slot_was_mine &&
|
|
|
|
n != myself &&
|
|
|
|
myself->numslots == 0 &&
|
|
|
|
server.cluster_allow_replica_migration) {
|
|
|
|
serverLog(LL_NOTICE,
|
|
|
|
"Configuration change detected. Reconfiguring myself "
|
|
|
|
"as a replica of %.40s (%s)", n->name, n->human_nodename);
|
|
|
|
clusterSetMaster(n);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG |
|
|
|
|
CLUSTER_TODO_UPDATE_STATE |
|
|
|
|
CLUSTER_TODO_FSYNC_CONFIG);
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* If this node was importing this slot, assigning the slot to
|
|
|
|
* itself also clears the importing status. */
|
|
|
|
if (n == myself &&
|
|
|
|
server.cluster->importing_slots_from[slot]) {
|
|
|
|
/* This slot was manually migrated, set this node configEpoch
|
|
|
|
* to a new epoch so that the new version can be propagated
|
|
|
|
* by the cluster.
|
|
|
|
*
|
|
|
|
* Note that if this ever results in a collision with another
|
|
|
|
* node getting the same configEpoch, for example because a
|
|
|
|
* failover happens at the same time we close the slot, the
|
|
|
|
* configEpoch collision resolution will fix it assigning
|
|
|
|
* a different epoch to each node. */
|
|
|
|
if (clusterBumpConfigEpochWithoutConsensus() == C_OK) {
|
|
|
|
serverLog(LL_NOTICE,
|
|
|
|
"configEpoch updated after importing slot %d", slot);
|
|
|
|
}
|
|
|
|
server.cluster->importing_slots_from[slot] = NULL;
|
|
|
|
/* After importing this slot, let the other nodes know as
|
|
|
|
* soon as possible. */
|
|
|
|
clusterBroadcastPong(CLUSTER_BROADCAST_ALL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
addReplyError(c,
|
|
|
|
"Invalid CLUSTER SETSLOT action or number of arguments. Try CLUSTER HELP");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_SAVE_CONFIG|CLUSTER_TODO_UPDATE_STATE);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"bumpepoch") && c->argc == 2) {
|
|
|
|
/* CLUSTER BUMPEPOCH */
|
|
|
|
int retval = clusterBumpConfigEpochWithoutConsensus();
|
|
|
|
sds reply = sdscatprintf(sdsempty(),"+%s %llu\r\n",
|
|
|
|
(retval == C_OK) ? "BUMPED" : "STILL",
|
|
|
|
(unsigned long long) myself->configEpoch);
|
|
|
|
addReplySds(c,reply);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"saveconfig") && c->argc == 2) {
|
|
|
|
int retval = clusterSaveConfig(1);
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (retval == 0)
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
else
|
|
|
|
addReplyErrorFormat(c,"error saving the cluster node config: %s",
|
|
|
|
strerror(errno));
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"forget") && c->argc == 3) {
|
|
|
|
/* CLUSTER FORGET <NODE ID> */
|
|
|
|
clusterNode *n = clusterLookupNode(c->argv[2]->ptr, sdslen(c->argv[2]->ptr));
|
|
|
|
if (!n) {
|
|
|
|
if (clusterBlacklistExists((char*)c->argv[2]->ptr))
|
|
|
|
/* Already forgotten. The deletion may have been gossipped by
|
|
|
|
* another node, so we pretend it succeeded. */
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
else
|
|
|
|
addReplyErrorFormat(c,"Unknown node %s", (char*)c->argv[2]->ptr);
|
|
|
|
return 1;
|
|
|
|
} else if (n == myself) {
|
|
|
|
addReplyError(c,"I tried hard but I can't forget myself...");
|
|
|
|
return 1;
|
|
|
|
} else if (nodeIsSlave(myself) && myself->slaveof == n) {
|
|
|
|
addReplyError(c,"Can't forget my master!");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
clusterBlacklistAddNode(n);
|
|
|
|
clusterDelNode(n);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"replicate") && c->argc == 3) {
|
|
|
|
/* CLUSTER REPLICATE <NODE ID> */
|
|
|
|
/* Lookup the specified node in our table. */
|
|
|
|
clusterNode *n = clusterLookupNode(c->argv[2]->ptr, sdslen(c->argv[2]->ptr));
|
|
|
|
if (!n) {
|
|
|
|
addReplyErrorFormat(c,"Unknown node %s", (char*)c->argv[2]->ptr);
|
|
|
|
return 1;
|
|
|
|
}
|
2022-01-03 01:54:47 +01:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* I can't replicate myself. */
|
|
|
|
if (n == myself) {
|
|
|
|
addReplyError(c,"Can't replicate myself");
|
|
|
|
return 1;
|
|
|
|
}
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Can't replicate a slave. */
|
|
|
|
if (nodeIsSlave(n)) {
|
|
|
|
addReplyError(c,"I can only replicate a master, not a replica.");
|
|
|
|
return 1;
|
|
|
|
}
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* If the instance is currently a master, it should have no assigned
|
|
|
|
* slots nor keys to accept to replicate some other node.
|
|
|
|
* Slaves can switch to another master without issues. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) &&
|
2023-11-01 14:51:49 +02:00
|
|
|
(myself->numslots != 0 || dbSize(&server.db[0], DB_MAIN) != 0)) {
|
|
|
|
addReplyError(c,
|
|
|
|
"To set a master the node must be empty and "
|
|
|
|
"without assigned slots.");
|
|
|
|
return 1;
|
|
|
|
}
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Set the master. */
|
|
|
|
clusterSetMaster(n);
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"count-failure-reports") &&
|
|
|
|
c->argc == 3)
|
|
|
|
{
|
|
|
|
/* CLUSTER COUNT-FAILURE-REPORTS <NODE ID> */
|
|
|
|
clusterNode *n = clusterLookupNode(c->argv[2]->ptr, sdslen(c->argv[2]->ptr));
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (!n) {
|
|
|
|
addReplyErrorFormat(c,"Unknown node %s", (char*)c->argv[2]->ptr);
|
|
|
|
return 1;
|
|
|
|
} else {
|
|
|
|
addReplyLongLong(c,clusterNodeFailureReportsCount(n));
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"failover") &&
|
|
|
|
(c->argc == 2 || c->argc == 3))
|
|
|
|
{
|
|
|
|
/* CLUSTER FAILOVER [FORCE|TAKEOVER] */
|
|
|
|
int force = 0, takeover = 0;
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (c->argc == 3) {
|
|
|
|
if (!strcasecmp(c->argv[2]->ptr,"force")) {
|
|
|
|
force = 1;
|
|
|
|
} else if (!strcasecmp(c->argv[2]->ptr,"takeover")) {
|
|
|
|
takeover = 1;
|
|
|
|
force = 1; /* Takeover also implies force. */
|
|
|
|
} else {
|
|
|
|
addReplyErrorObject(c,shared.syntaxerr);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
2023-10-30 12:38:43 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Check preconditions. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself)) {
|
2023-11-01 14:51:49 +02:00
|
|
|
addReplyError(c,"You should send CLUSTER FAILOVER to a replica");
|
|
|
|
return 1;
|
|
|
|
} else if (myself->slaveof == NULL) {
|
|
|
|
addReplyError(c,"I'm a replica but my master is unknown to me");
|
|
|
|
return 1;
|
|
|
|
} else if (!force &&
|
|
|
|
(nodeFailed(myself->slaveof) ||
|
|
|
|
myself->slaveof->link == NULL))
|
|
|
|
{
|
|
|
|
addReplyError(c,"Master is down or failed, "
|
|
|
|
"please use CLUSTER FAILOVER FORCE");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
resetManualFailover();
|
|
|
|
server.cluster->mf_end = mstime() + CLUSTER_MF_TIMEOUT;
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (takeover) {
|
|
|
|
/* A takeover does not perform any initial check. It just
|
|
|
|
* generates a new configuration epoch for this node without
|
|
|
|
* consensus, claims the master's slots, and broadcast the new
|
|
|
|
* configuration. */
|
|
|
|
serverLog(LL_NOTICE,"Taking over the master (user request).");
|
|
|
|
clusterBumpConfigEpochWithoutConsensus();
|
|
|
|
clusterFailoverReplaceYourMaster();
|
|
|
|
} else if (force) {
|
|
|
|
/* If this is a forced failover, we don't need to talk with our
|
|
|
|
* master to agree about the offset. We just failover taking over
|
|
|
|
* it without coordination. */
|
|
|
|
serverLog(LL_NOTICE,"Forced failover user request accepted.");
|
|
|
|
server.cluster->mf_can_start = 1;
|
|
|
|
} else {
|
|
|
|
serverLog(LL_NOTICE,"Manual failover user request accepted.");
|
|
|
|
clusterSendMFStart(myself->slaveof);
|
|
|
|
}
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"set-config-epoch") && c->argc == 3)
|
|
|
|
{
|
|
|
|
/* CLUSTER SET-CONFIG-EPOCH <epoch>
|
|
|
|
*
|
|
|
|
* The user is allowed to set the config epoch only when a node is
|
|
|
|
* totally fresh: no config epoch, no other known node, and so forth.
|
|
|
|
* This happens at cluster creation time to start with a cluster where
|
|
|
|
* every node has a different node ID, without to rely on the conflicts
|
|
|
|
* resolution system which is too slow when a big cluster is created. */
|
|
|
|
long long epoch;
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (getLongLongFromObjectOrReply(c,c->argv[2],&epoch,NULL) != C_OK)
|
|
|
|
return 1;
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (epoch < 0) {
|
|
|
|
addReplyErrorFormat(c,"Invalid config epoch specified: %lld",epoch);
|
|
|
|
} else if (dictSize(server.cluster->nodes) > 1) {
|
|
|
|
addReplyError(c,"The user can assign a config epoch only when the "
|
|
|
|
"node does not know any other node.");
|
|
|
|
} else if (myself->configEpoch != 0) {
|
|
|
|
addReplyError(c,"Node config epoch is already non-zero");
|
|
|
|
} else {
|
|
|
|
myself->configEpoch = epoch;
|
|
|
|
serverLog(LL_NOTICE,
|
|
|
|
"configEpoch set to %llu via CLUSTER SET-CONFIG-EPOCH",
|
|
|
|
(unsigned long long) myself->configEpoch);
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
if (server.cluster->currentEpoch < (uint64_t)epoch)
|
|
|
|
server.cluster->currentEpoch = epoch;
|
|
|
|
/* No need to fsync the config here since in the unlucky event
|
|
|
|
* of a failure to persist the config, the conflict resolution code
|
|
|
|
* will assign a unique config to this node. */
|
|
|
|
clusterDoBeforeSleep(CLUSTER_TODO_UPDATE_STATE|
|
|
|
|
CLUSTER_TODO_SAVE_CONFIG);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
}
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"reset") &&
|
|
|
|
(c->argc == 2 || c->argc == 3))
|
|
|
|
{
|
|
|
|
/* CLUSTER RESET [SOFT|HARD] */
|
|
|
|
int hard = 0;
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
/* Parse soft/hard argument. Default is soft. */
|
|
|
|
if (c->argc == 3) {
|
|
|
|
if (!strcasecmp(c->argv[2]->ptr,"hard")) {
|
|
|
|
hard = 1;
|
|
|
|
} else if (!strcasecmp(c->argv[2]->ptr,"soft")) {
|
|
|
|
hard = 0;
|
|
|
|
} else {
|
|
|
|
addReplyErrorObject(c,shared.syntaxerr);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Slaves can be reset while containing data, but not master nodes
|
|
|
|
* that must be empty. */
|
2023-11-09 11:04:47 +02:00
|
|
|
if (clusterNodeIsMaster(myself) && dbSize(c->db, DB_MAIN) != 0) {
|
2023-11-01 14:51:49 +02:00
|
|
|
addReplyError(c,"CLUSTER RESET can't be called with "
|
|
|
|
"master nodes containing keys");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
clusterReset(hard);
|
|
|
|
addReply(c,shared.ok);
|
|
|
|
} else if (!strcasecmp(c->argv[1]->ptr,"links") && c->argc == 2) {
|
|
|
|
/* CLUSTER LINKS */
|
|
|
|
addReplyClusterLinksDescription(c);
|
2023-10-30 17:08:30 +02:00
|
|
|
} else {
|
2023-11-01 14:51:49 +02:00
|
|
|
return 0;
|
2023-10-30 17:08:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
const char** clusterCommandExtendedHelp(void) {
|
2023-11-01 14:51:49 +02:00
|
|
|
static const char *help[] = {
|
|
|
|
"ADDSLOTS <slot> [<slot> ...]",
|
|
|
|
" Assign slots to current node.",
|
|
|
|
"ADDSLOTSRANGE <start slot> <end slot> [<start slot> <end slot> ...]",
|
|
|
|
" Assign slots which are between <start-slot> and <end-slot> to current node.",
|
|
|
|
"BUMPEPOCH",
|
|
|
|
" Advance the cluster config epoch.",
|
|
|
|
"COUNT-FAILURE-REPORTS <node-id>",
|
|
|
|
" Return number of failure reports for <node-id>.",
|
|
|
|
"DELSLOTS <slot> [<slot> ...]",
|
|
|
|
" Delete slots information from current node.",
|
|
|
|
"DELSLOTSRANGE <start slot> <end slot> [<start slot> <end slot> ...]",
|
|
|
|
" Delete slots information which are between <start-slot> and <end-slot> from current node.",
|
|
|
|
"FAILOVER [FORCE|TAKEOVER]",
|
|
|
|
" Promote current replica node to being a master.",
|
|
|
|
"FORGET <node-id>",
|
|
|
|
" Remove a node from the cluster.",
|
|
|
|
"FLUSHSLOTS",
|
|
|
|
" Delete current node own slots information.",
|
|
|
|
"MEET <ip> <port> [<bus-port>]",
|
|
|
|
" Connect nodes into a working cluster.",
|
|
|
|
"REPLICATE <node-id>",
|
|
|
|
" Configure current node as replica to <node-id>.",
|
|
|
|
"RESET [HARD|SOFT]",
|
|
|
|
" Reset current node (default: soft).",
|
|
|
|
"SET-CONFIG-EPOCH <epoch>",
|
|
|
|
" Set config epoch of current node.",
|
|
|
|
"SETSLOT <slot> (IMPORTING <node-id>|MIGRATING <node-id>|STABLE|NODE <node-id>)",
|
|
|
|
" Set slot state.",
|
|
|
|
"SAVECONFIG",
|
|
|
|
" Force saving cluster configuration on disk.",
|
|
|
|
"LINKS",
|
|
|
|
" Return information about all network links between this node and its peers.",
|
|
|
|
" Output format is an array where each array element is a map containing attributes of a link",
|
|
|
|
NULL
|
|
|
|
};
|
2023-10-30 17:08:30 +02:00
|
|
|
|
2023-11-01 14:51:49 +02:00
|
|
|
return help;
|
2023-10-30 17:08:30 +02:00
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
int clusterNodeNumSlaves(clusterNode *node) {
|
2023-11-01 14:51:49 +02:00
|
|
|
return node->numslaves;
|
2023-10-30 17:08:30 +02:00
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
clusterNode *clusterNodeGetSlave(clusterNode *node, int slave_idx) {
|
2023-11-01 14:51:49 +02:00
|
|
|
return node->slaves[slave_idx];
|
2023-10-30 17:08:30 +02:00
|
|
|
}
|
2023-11-02 11:38:31 +02:00
|
|
|
|
|
|
|
clusterNode *getMigratingSlotDest(int slot) {
|
|
|
|
return server.cluster->migrating_slots_to[slot];
|
|
|
|
}
|
|
|
|
|
|
|
|
clusterNode *getImportingSlotSource(int slot) {
|
|
|
|
return server.cluster->importing_slots_from[slot];
|
|
|
|
}
|
|
|
|
|
|
|
|
int isClusterHealthy(void) {
|
|
|
|
return server.cluster->state == CLUSTER_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
clusterNode *getNodeBySlot(int slot) {
|
|
|
|
return server.cluster->slots[slot];
|
|
|
|
}
|
|
|
|
|
|
|
|
char* clusterNodeHostname(clusterNode *node) {
|
|
|
|
return node->hostname;
|
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
long long clusterNodeReplOffset(clusterNode *node) {
|
2023-11-02 11:38:31 +02:00
|
|
|
return node->repl_offset;
|
|
|
|
}
|
|
|
|
|
2023-11-09 11:04:47 +02:00
|
|
|
const char *clusterNodePreferredEndpoint(clusterNode *n) {
|
2023-11-05 10:47:57 +02:00
|
|
|
char *hostname = clusterNodeHostname(n);
|
|
|
|
switch (server.cluster_preferred_endpoint_type) {
|
|
|
|
case CLUSTER_ENDPOINT_TYPE_IP:
|
|
|
|
return clusterNodeIp(n);
|
|
|
|
case CLUSTER_ENDPOINT_TYPE_HOSTNAME:
|
|
|
|
return (hostname != NULL && hostname[0] != '\0') ? hostname : "?";
|
|
|
|
case CLUSTER_ENDPOINT_TYPE_UNKNOWN_ENDPOINT:
|
|
|
|
return "";
|
2023-11-02 11:38:31 +02:00
|
|
|
}
|
|
|
|
return "unknown";
|
|
|
|
}
|
2023-11-05 10:47:57 +02:00
|
|
|
|
|
|
|
int clusterAllowFailoverCmd(client *c) {
|
|
|
|
if (!server.cluster_enabled) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
addReplyError(c,"FAILOVER not allowed in cluster mode. "
|
|
|
|
"Use CLUSTER FAILOVER command instead.");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void clusterPromoteSelfToMaster(void) {
|
|
|
|
replicationUnsetMaster();
|
|
|
|
}
|