code, typo and comment cleanups (#11280)
- fix `the the` typo - `LPOPRPUSH` does not exist, should be `RPOPLPUSH` - `CLUSTER GETKEYINSLOT` 's time complexity should be O(N) - `there bytes` should be `three bytes`, this closes #11266 - `slave` word to `replica` in log, modified the front and missed the back - remove useless aofReadDiffFromParent in server.h - `trackingHandlePendingKeyInvalidations` method adds a void parameter
This commit is contained in:
parent
2804eefc58
commit
3c02d1acc4
@ -848,7 +848,7 @@ void setClusterNodeToInboundClusterLink(clusterNode *node, clusterLink *link) {
|
|||||||
* one inbound link from the same node at the same time. Our cleanup logic assumes
|
* 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
|
* 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
|
* one of the links. The existing link is more likely the outdated one, but it's
|
||||||
* possible the the other node may need to open another link. */
|
* possible the other node may need to open another link. */
|
||||||
serverLog(LL_DEBUG, "Replacing inbound link fd %d from node %.40s with fd %d",
|
serverLog(LL_DEBUG, "Replacing inbound link fd %d from node %.40s with fd %d",
|
||||||
node->inbound_link->conn->fd, node->name, link->conn->fd);
|
node->inbound_link->conn->fd, node->name, link->conn->fd);
|
||||||
freeClusterLink(node->inbound_link);
|
freeClusterLink(node->inbound_link);
|
||||||
@ -5216,7 +5216,7 @@ void clusterReplyShards(client *c) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
shard_count++;
|
shard_count++;
|
||||||
/* n->slot_info_pairs is set to NULL when the the node owns no slots. */
|
/* n->slot_info_pairs is set to NULL when the node owns no slots. */
|
||||||
addShardReplyForClusterShards(c, n, n->slot_info_pairs, n->slot_info_pairs_count);
|
addShardReplyForClusterShards(c, n, n->slot_info_pairs, n->slot_info_pairs_count);
|
||||||
clusterFreeNodesSlotsInfo(n);
|
clusterFreeNodesSlotsInfo(n);
|
||||||
}
|
}
|
||||||
@ -6652,7 +6652,7 @@ void readwriteCommand(client *c) {
|
|||||||
/* Return the pointer to the cluster node that is able to serve the command.
|
/* Return the pointer to the cluster node that is able to serve the command.
|
||||||
* For the function to succeed the command should only target either:
|
* For the function to succeed the command should only target either:
|
||||||
*
|
*
|
||||||
* 1) A single key (even multiple times like LPOPRPUSH mylist mylist).
|
* 1) A single key (even multiple times like RPOPLPUSH mylist mylist).
|
||||||
* 2) Multiple keys in the same hash slot, while the slot is stable (no
|
* 2) Multiple keys in the same hash slot, while the slot is stable (no
|
||||||
* resharding in progress).
|
* resharding in progress).
|
||||||
*
|
*
|
||||||
|
@ -640,7 +640,7 @@ struct redisCommand CLUSTER_Subcommands[] = {
|
|||||||
{"failover","Forces a replica to perform a manual failover of its master.","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FAILOVER_History,CLUSTER_FAILOVER_tips,clusterCommand,-2,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0,.args=CLUSTER_FAILOVER_Args},
|
{"failover","Forces a replica to perform a manual failover of its master.","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FAILOVER_History,CLUSTER_FAILOVER_tips,clusterCommand,-2,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0,.args=CLUSTER_FAILOVER_Args},
|
||||||
{"flushslots","Delete a node's own slots information","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FLUSHSLOTS_History,CLUSTER_FLUSHSLOTS_tips,clusterCommand,2,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0},
|
{"flushslots","Delete a node's own slots information","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FLUSHSLOTS_History,CLUSTER_FLUSHSLOTS_tips,clusterCommand,2,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0},
|
||||||
{"forget","Remove a node from the nodes table","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FORGET_History,CLUSTER_FORGET_tips,clusterCommand,3,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0,.args=CLUSTER_FORGET_Args},
|
{"forget","Remove a node from the nodes table","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_FORGET_History,CLUSTER_FORGET_tips,clusterCommand,3,CMD_NO_ASYNC_LOADING|CMD_ADMIN|CMD_STALE,0,.args=CLUSTER_FORGET_Args},
|
||||||
{"getkeysinslot","Return local key names in the specified hash slot","O(log(N)) where N is the number of requested keys","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_GETKEYSINSLOT_History,CLUSTER_GETKEYSINSLOT_tips,clusterCommand,4,CMD_STALE,0,.args=CLUSTER_GETKEYSINSLOT_Args},
|
{"getkeysinslot","Return local key names in the specified hash slot","O(N) where N is the number of requested keys","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_GETKEYSINSLOT_History,CLUSTER_GETKEYSINSLOT_tips,clusterCommand,4,CMD_STALE,0,.args=CLUSTER_GETKEYSINSLOT_Args},
|
||||||
{"help","Show helpful text about the different subcommands","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_HELP_History,CLUSTER_HELP_tips,clusterCommand,2,CMD_LOADING|CMD_STALE,0},
|
{"help","Show helpful text about the different subcommands","O(1)","5.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_HELP_History,CLUSTER_HELP_tips,clusterCommand,2,CMD_LOADING|CMD_STALE,0},
|
||||||
{"info","Provides info about Redis Cluster node state","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_INFO_History,CLUSTER_INFO_tips,clusterCommand,2,CMD_STALE,0},
|
{"info","Provides info about Redis Cluster node state","O(1)","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_INFO_History,CLUSTER_INFO_tips,clusterCommand,2,CMD_STALE,0},
|
||||||
{"keyslot","Returns the hash slot of the specified key","O(N) where N is the number of bytes in the key","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_KEYSLOT_History,CLUSTER_KEYSLOT_tips,clusterCommand,3,CMD_STALE,0,.args=CLUSTER_KEYSLOT_Args},
|
{"keyslot","Returns the hash slot of the specified key","O(N) where N is the number of bytes in the key","3.0.0",CMD_DOC_NONE,NULL,NULL,COMMAND_GROUP_CLUSTER,CLUSTER_KEYSLOT_History,CLUSTER_KEYSLOT_tips,clusterCommand,3,CMD_STALE,0,.args=CLUSTER_KEYSLOT_Args},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"GETKEYSINSLOT": {
|
"GETKEYSINSLOT": {
|
||||||
"summary": "Return local key names in the specified hash slot",
|
"summary": "Return local key names in the specified hash slot",
|
||||||
"complexity": "O(log(N)) where N is the number of requested keys",
|
"complexity": "O(N) where N is the number of requested keys",
|
||||||
"group": "cluster",
|
"group": "cluster",
|
||||||
"since": "3.0.0",
|
"since": "3.0.0",
|
||||||
"arity": 4,
|
"arity": 4,
|
||||||
|
@ -352,7 +352,7 @@ raxNode *raxAddChild(raxNode *n, unsigned char c, raxNode **childptr, raxNode **
|
|||||||
* we don't need to do anything if there was already some padding to use. In
|
* we don't need to do anything if there was already some padding to use. In
|
||||||
* that case the final destination of the pointers will be the same, however
|
* that case the final destination of the pointers will be the same, however
|
||||||
* in our example there was no pre-existing padding, so we added one byte
|
* in our example there was no pre-existing padding, so we added one byte
|
||||||
* plus there bytes of padding. After the next memmove() things will look
|
* plus three bytes of padding. After the next memmove() things will look
|
||||||
* like that:
|
* like that:
|
||||||
*
|
*
|
||||||
* [HDR*][abde][....][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
|
* [HDR*][abde][....][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
|
||||||
|
@ -1581,7 +1581,7 @@ void updateSlavesWaitingBgsave(int bgsaveerr, int type) {
|
|||||||
* the slave online. */
|
* the slave online. */
|
||||||
if (type == RDB_CHILD_TYPE_SOCKET) {
|
if (type == RDB_CHILD_TYPE_SOCKET) {
|
||||||
serverLog(LL_NOTICE,
|
serverLog(LL_NOTICE,
|
||||||
"Streamed RDB transfer with replica %s succeeded (socket). Waiting for REPLCONF ACK from slave to enable streaming",
|
"Streamed RDB transfer with replica %s succeeded (socket). Waiting for REPLCONF ACK from replica to enable streaming",
|
||||||
replicationGetSlaveName(slave));
|
replicationGetSlaveName(slave));
|
||||||
/* Note: we wait for a REPLCONF ACK message from the replica in
|
/* Note: we wait for a REPLCONF ACK message from the replica in
|
||||||
* order to really put it online (install the write handler
|
* order to really put it online (install the write handler
|
||||||
|
@ -2729,7 +2729,6 @@ int loadAppendOnlyFiles(aofManifest *am);
|
|||||||
void stopAppendOnly(void);
|
void stopAppendOnly(void);
|
||||||
int startAppendOnly(void);
|
int startAppendOnly(void);
|
||||||
void backgroundRewriteDoneHandler(int exitcode, int bysignal);
|
void backgroundRewriteDoneHandler(int exitcode, int bysignal);
|
||||||
ssize_t aofReadDiffFromParent(void);
|
|
||||||
void killAppendOnlyChild(void);
|
void killAppendOnlyChild(void);
|
||||||
void restartAOFAfterSYNC();
|
void restartAOFAfterSYNC();
|
||||||
void aofLoadManifestFromDisk(void);
|
void aofLoadManifestFromDisk(void);
|
||||||
|
@ -412,7 +412,7 @@ void trackingInvalidateKey(client *c, robj *keyobj, int bcast) {
|
|||||||
raxRemove(TrackingTable,(unsigned char*)key,keylen,NULL);
|
raxRemove(TrackingTable,(unsigned char*)key,keylen,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void trackingHandlePendingKeyInvalidations() {
|
void trackingHandlePendingKeyInvalidations(void) {
|
||||||
if (!listLength(server.tracking_pending_keys)) return;
|
if (!listLength(server.tracking_pending_keys)) return;
|
||||||
|
|
||||||
listNode *ln;
|
listNode *ln;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user