Rizin
unix-like reverse engineering framework and cli tools
|
#include "server.h"
#include "cluster.h"
#include "endianconv.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/file.h>
#include <math.h>
Go to the source code of this file.
Classes | |
struct | redisNodeFlags |
struct | migrateCachedSocket |
Macros | |
#define | MAX_CLUSTER_ACCEPTS_PER_CALL 1000 |
#define | CLUSTER_BLACKLIST_TTL 60 /* 1 minute. */ |
#define | CLUSTER_BROADCAST_ALL 0 |
#define | CLUSTER_BROADCAST_LOCAL_SLAVES 1 |
#define | CLUSTER_MAX_REJOIN_DELAY 5000 |
#define | CLUSTER_MIN_REJOIN_DELAY 500 |
#define | CLUSTER_WRITABLE_DELAY 2000 |
#define | MIGRATE_SOCKET_CACHE_ITEMS 64 /* max num of items in the cache. */ |
#define | MIGRATE_SOCKET_CACHE_TTL 10 /* close cached sockets after 10 sec. */ |
Typedefs | |
typedef struct migrateCachedSocket | migrateCachedSocket |
Variables | |
clusterNode * | myself = NULL |
static struct redisNodeFlags | redisNodeFlagsTable [] |
typedef struct migrateCachedSocket migrateCachedSocket |
void askingCommand | ( | client * | c | ) |
Definition at line 3499 of file cluster.c.
Referenced by clusterNodeClearSlotBit(), clusterNodeGetSlotBit(), clusterNodeSetSlotBit(), clusterProcessPacket(), clusterSendFailoverAuthIfNeeded(), and clusterUpdateSlotsConfigWith().
void clearNodeFailureIfNeeded | ( | clusterNode * | node | ) |
Definition at line 1200 of file cluster.c.
References clusterDoBeforeSleep().
Referenced by clusterProcessPacket().
Definition at line 593 of file cluster.c.
References clusterReadHandler(), createClusterLink(), fd, link, mask, max, MAX_CLUSTER_ACCEPTS_PER_CALL, NULL, and UNUSED.
Referenced by clusterInit().
int clusterAddNode | ( | clusterNode * | node | ) |
Definition at line 864 of file cluster.c.
Referenced by clusterInit(), clusterLoadConfig(), clusterProcessPacket(), clusterRenameNode(), clusterReset(), and clusterStartHandshake().
Definition at line 3578 of file cluster.c.
References clusterNodeSetSlotBit(), and n.
Referenced by clusterCommand(), clusterFailoverReplaceYourMaster(), clusterLoadConfig(), clusterUpdateSlotsConfigWith(), and verifyClusterConfigWithData().
void clusterBeforeSleep | ( | void | ) |
Definition at line 3467 of file cluster.c.
References clusterHandleSlaveFailover(), clusterSaveConfigOrDie(), clusterUpdateState(), and fsync.
void clusterBlacklistAddNode | ( | clusterNode * | node | ) |
Definition at line 1118 of file cluster.c.
References CLUSTER_BLACKLIST_TTL, clusterBlacklistCleanup(), NULL, and time.
Referenced by clusterCommand().
void clusterBlacklistCleanup | ( | void | ) |
Definition at line 1103 of file cluster.c.
References NULL.
Referenced by clusterBlacklistAddNode(), and clusterBlacklistExists().
int clusterBlacklistExists | ( | char * | nodeid | ) |
Definition at line 1136 of file cluster.c.
References clusterBlacklistCleanup(), and NULL.
Referenced by clusterProcessGossipSection().
void clusterBroadcastMessage | ( | void * | buf, |
size_t | len | ||
) |
Definition at line 2172 of file cluster.c.
References clusterSendMessage(), len, and NULL.
Referenced by clusterRequestFailoverAuth(), clusterSendFail(), and clusterSendPublish().
void clusterBroadcastPong | ( | int | target | ) |
Definition at line 2437 of file cluster.c.
References CLUSTER_BROADCAST_LOCAL_SLAVES, clusterSendPing(), myself, and NULL.
Referenced by clusterFailoverReplaceYourMaster(), and clusterHandleSlaveFailover().
void clusterBuildMessageHdr | ( | clusterMsg * | hdr, |
int | type | ||
) |
Definition at line 2190 of file cluster.c.
References htons, memcpy(), memset(), myself, NULL, and type.
Referenced by clusterRequestFailoverAuth(), clusterSendFail(), clusterSendFailoverAuth(), clusterSendMFStart(), clusterSendPing(), clusterSendPublish(), and clusterSendUpdate().
int clusterBumpConfigEpochWithoutConsensus | ( | void | ) |
Definition at line 990 of file cluster.c.
References clusterDoBeforeSleep(), clusterGetMaxEpoch(), and myself.
Referenced by clusterCommand().
void clusterCloseAllSlots | ( | void | ) |
Definition at line 3611 of file cluster.c.
References memset().
Referenced by clusterInit(), clusterReset(), and clusterSetMaster().
void clusterCommand | ( | client * | c | ) |
Definition at line 4056 of file cluster.c.
References c, clusterAddSlot(), clusterBlacklistAddNode(), clusterBumpConfigEpochWithoutConsensus(), clusterDelNode(), clusterDelNodeSlots(), clusterDelSlot(), clusterDoBeforeSleep(), clusterFailoverReplaceYourMaster(), clusterGenNodeDescription(), clusterGenNodesDescription(), clusterGetMessageTypeString(), clusterLookupNode(), clusterNodeFailureReportsCount(), clusterReplyMultiBulkSlots(), clusterReset(), clusterSaveConfig(), clusterSendMFStart(), clusterSetMaster(), clusterStartHandshake(), del(), EINVAL, getSlotOrReply(), i, info(), key, keyHashSlot(), keys, long, memset(), myself, n, NULL, resetManualFailover(), and slots.
int clusterCountNonFailingSlaves | ( | clusterNode * | n | ) |
Definition at line 830 of file cluster.c.
References n.
Referenced by clusterCron(), and clusterHandleSlaveMigration().
void clusterCron | ( | void | ) |
Definition at line 3190 of file cluster.c.
References clusterCountNonFailingSlaves(), clusterDelNode(), clusterHandleManualFailover(), clusterHandleSlaveFailover(), clusterHandleSlaveMigration(), clusterReadHandler(), clusterSendPing(), clusterUpdateState(), createClusterLink(), fd, flags, freeClusterLink(), link, manualFailoverCheckTimeout(), myself, and NULL.
void clusterDelNode | ( | clusterNode * | delnode | ) |
Definition at line 883 of file cluster.c.
References clusterDelSlot(), clusterNodeDelFailureReport(), freeClusterNode(), and NULL.
Referenced by clusterCommand(), clusterCron(), clusterProcessPacket(), and clusterReset().
int clusterDelNodeSlots | ( | clusterNode * | node | ) |
Definition at line 3599 of file cluster.c.
References clusterDelSlot(), and clusterNodeGetSlotBit().
Referenced by clusterCommand(), and clusterProcessPacket().
Definition at line 3588 of file cluster.c.
References clusterNodeClearSlotBit(), n, and NULL.
Referenced by clusterCommand(), clusterDelNode(), clusterDelNodeSlots(), clusterFailoverReplaceYourMaster(), clusterReset(), and clusterUpdateSlotsConfigWith().
void clusterDoBeforeSleep | ( | int | flags | ) |
Definition at line 3489 of file cluster.c.
References flags.
Referenced by clearNodeFailureIfNeeded(), clusterBumpConfigEpochWithoutConsensus(), clusterCommand(), clusterHandleSlaveFailover(), clusterProcessPacket(), clusterReset(), clusterSetNodeAsMaster(), clusterUpdateSlotsConfigWith(), and markNodeAsFailingIfNeeded().
void clusterFailoverReplaceYourMaster | ( | void | ) |
Definition at line 2794 of file cluster.c.
References CLUSTER_BROADCAST_ALL, clusterAddSlot(), clusterBroadcastPong(), clusterDelSlot(), clusterNodeGetSlotBit(), clusterSaveConfigOrDie(), clusterSetNodeAsMaster(), clusterUpdateState(), myself, NULL, and resetManualFailover().
Referenced by clusterCommand(), and clusterHandleSlaveFailover().
sds clusterGenNodeDescription | ( | clusterNode * | node | ) |
Definition at line 3855 of file cluster.c.
References bit, clusterNodeGetSlotBit(), representClusterNodeFlags(), and start.
Referenced by clusterCommand(), and clusterGenNodesDescription().
sds clusterGenNodesDescription | ( | int | filter | ) |
Definition at line 3932 of file cluster.c.
References clusterGenNodeDescription(), and NULL.
Referenced by clusterCommand(), and clusterSaveConfig().
uint64_t clusterGetMaxEpoch | ( | void | ) |
Definition at line 946 of file cluster.c.
Referenced by clusterBumpConfigEpochWithoutConsensus(), and clusterLoadConfig().
int clusterGetSlaveRank | ( | void | ) |
void clusterHandleConfigEpochCollision | ( | clusterNode * | sender | ) |
Definition at line 1055 of file cluster.c.
References clusterSaveConfigOrDie(), and myself.
Referenced by clusterProcessPacket().
void clusterHandleManualFailover | ( | void | ) |
void clusterHandleSlaveFailover | ( | void | ) |
Definition at line 2832 of file cluster.c.
References CLUSTER_BROADCAST_LOCAL_SLAVES, clusterBroadcastPong(), clusterDoBeforeSleep(), clusterFailoverReplaceYourMaster(), clusterGetSlaveRank(), clusterLogCantFailover(), clusterRequestFailoverAuth(), myself, and NULL.
Referenced by clusterBeforeSleep(), and clusterCron().
void clusterHandleSlaveMigration | ( | int | max_slaves | ) |
Definition at line 3026 of file cluster.c.
References clusterCountNonFailingSlaves(), clusterSetMaster(), myself, and NULL.
Referenced by clusterCron().
void clusterInit | ( | void | ) |
Definition at line 407 of file cluster.c.
References clusterAcceptHandler(), clusterAddNode(), clusterCloseAllSlots(), clusterLoadConfig(), clusterLockConfig(), clusterSaveConfigOrDie(), createClusterNode(), test-lz4-list::exit, i, memset(), myself, NULL, and resetManualFailover().
int clusterLoadConfig | ( | char * | filename | ) |
Definition at line 89 of file cluster.c.
References argv, clusterAddNode(), clusterAddSlot(), clusterGetMaxEpoch(), clusterLookupNode(), clusterNodeAddSlave(), createClusterNode(), ENOENT, test-lz4-list::exit, benchmark::FILE, fstat, setup::line, memcpy(), myself, n, NULL, p, s, sb, and start.
Referenced by clusterInit().
int clusterLockConfig | ( | char * | filename | ) |
void clusterLogCantFailover | ( | int | reason | ) |
Definition at line 2746 of file cluster.c.
References msg, myself, NULL, and time.
Referenced by clusterHandleSlaveFailover().
clusterNode * clusterLookupNode | ( | char * | name | ) |
Definition at line 913 of file cluster.c.
Referenced by clusterCommand(), clusterLoadConfig(), clusterProcessGossipSection(), and clusterProcessPacket().
int clusterMastersHaveSlaves | ( | void | ) |
int clusterNodeAddFailureReport | ( | clusterNode * | failing, |
clusterNode * | sender | ||
) |
int clusterNodeAddSlave | ( | clusterNode * | master, |
clusterNode * | slave | ||
) |
Definition at line 816 of file cluster.c.
Referenced by clusterLoadConfig(), clusterProcessPacket(), and clusterSetMaster().
void clusterNodeCleanupFailureReports | ( | clusterNode * | node | ) |
Definition at line 742 of file cluster.c.
Referenced by clusterNodeDelFailureReport(), and clusterNodeFailureReportsCount().
Definition at line 3562 of file cluster.c.
References bitmapClearBit(), bitmapTestBit(), and n.
Referenced by clusterDelSlot().
int clusterNodeDelFailureReport | ( | clusterNode * | node, |
clusterNode * | sender | ||
) |
Definition at line 769 of file cluster.c.
References clusterNodeCleanupFailureReports(), list(), and NULL.
Referenced by clusterDelNode(), and clusterProcessGossipSection().
int clusterNodeFailureReportsCount | ( | clusterNode * | node | ) |
Definition at line 792 of file cluster.c.
References clusterNodeCleanupFailureReports().
Referenced by clusterCommand(), clusterProcessGossipSection(), and markNodeAsFailingIfNeeded().
Definition at line 3570 of file cluster.c.
References bitmapTestBit(), and n.
Referenced by clusterDelNodeSlots(), clusterFailoverReplaceYourMaster(), clusterGenNodeDescription(), and clusterReplyMultiBulkSlots().
Definition at line 2267 of file cluster.c.
Referenced by clusterSendPing().
int clusterNodeRemoveSlave | ( | clusterNode * | master, |
clusterNode * | slave | ||
) |
Definition at line 797 of file cluster.c.
Referenced by clusterProcessPacket(), clusterSetMaster(), clusterSetNodeAsMaster(), and freeClusterNode().
Definition at line 3537 of file cluster.c.
References bitmapSetBit(), bitmapTestBit(), clusterMastersHaveSlaves(), and n.
Referenced by clusterAddSlot().
void clusterProcessGossipSection | ( | clusterMsg * | hdr, |
clusterLink * | link | ||
) |
Definition at line 1316 of file cluster.c.
References clusterBlacklistExists(), clusterLookupNode(), clusterNodeAddFailureReport(), clusterNodeDelFailureReport(), clusterNodeFailureReportsCount(), clusterStartHandshake(), count, flags, freeClusterLink(), g, link, markNodeAsFailingIfNeeded(), memcpy(), myself, ntohs, and representClusterNodeFlags().
Referenced by clusterProcessPacket().
int clusterProcessPacket | ( | clusterLink * | link | ) |
Definition at line 1605 of file cluster.c.
References bitmapTestBit(), clearNodeFailureIfNeeded(), clusterAddNode(), clusterDelNode(), clusterDelNodeSlots(), clusterDoBeforeSleep(), clusterHandleConfigEpochCollision(), clusterLookupNode(), clusterNodeAddSlave(), clusterNodeRemoveSlave(), clusterProcessGossipSection(), clusterRenameNode(), clusterSendFailoverAuthIfNeeded(), clusterSendPing(), clusterSendUpdate(), clusterSetNodeAsMaster(), clusterUpdateSlotsConfigWith(), count, createClusterNode(), flags, freeClusterLink(), ip, link, memcpy(), message, myself, n, nodeIp2String(), nodeUpdateAddressIfNeeded(), ntohs, NULL, resetManualFailover(), and type.
Referenced by clusterReadHandler().
void clusterPropagatePublish | ( | robj * | channel, |
robj * | message | ||
) |
Definition at line 2538 of file cluster.c.
References clusterSendPublish(), message, and NULL.
Definition at line 2084 of file cluster.c.
References clusterProcessPacket(), EAGAIN, fd, handleLinkIOError(), if(), link, mask, read(), and UNUSED.
Referenced by clusterAcceptHandler(), and clusterCron().
int clusterRedirectBlockedClientIfNeeded | ( | client * | c | ) |
Definition at line 5410 of file cluster.c.
References c, clusterRedirectClient(), key, keyHashSlot(), myself, and NULL.
Definition at line 5375 of file cluster.c.
References c, test-lz4-versions::error_code, and n.
Referenced by clusterRedirectBlockedClientIfNeeded().
void clusterRenameNode | ( | clusterNode * | node, |
char * | newname | ||
) |
Definition at line 927 of file cluster.c.
References clusterAddNode(), memcpy(), and s.
Referenced by clusterProcessPacket().
void clusterReplyMultiBulkSlots | ( | client * | c | ) |
Definition at line 3982 of file cluster.c.
References bit, c, clusterNodeGetSlotBit(), i, NULL, and start.
Referenced by clusterCommand().
void clusterRequestFailoverAuth | ( | void | ) |
Definition at line 2552 of file cluster.c.
References clusterBroadcastMessage(), and clusterBuildMessageHdr().
Referenced by clusterHandleSlaveFailover().
void clusterReset | ( | int | hard | ) |
Definition at line 508 of file cluster.c.
References clusterAddNode(), clusterCloseAllSlots(), clusterDelNode(), clusterDelSlot(), clusterDoBeforeSleep(), clusterSetNodeAsMaster(), myself, NULL, and resetManualFailover().
Referenced by clusterCommand().
Definition at line 306 of file cluster.c.
References close, clusterGenNodesDescription(), err, fd, fstat, fsync, ftruncate, memset(), O_CREAT, O_WRONLY, sb, and write.
Referenced by clusterCommand(), and clusterSaveConfigOrDie().
void clusterSaveConfigOrDie | ( | int | do_fsync | ) |
Definition at line 353 of file cluster.c.
References clusterSaveConfig(), and test-lz4-list::exit.
Referenced by clusterBeforeSleep(), clusterFailoverReplaceYourMaster(), clusterHandleConfigEpochCollision(), clusterInit(), and verifyClusterConfigWithData().
void clusterSendFail | ( | char * | nodename | ) |
Definition at line 2507 of file cluster.c.
References clusterBroadcastMessage(), clusterBuildMessageHdr(), and memcpy().
Referenced by markNodeAsFailingIfNeeded().
void clusterSendFailoverAuth | ( | clusterNode * | node | ) |
Definition at line 2568 of file cluster.c.
References clusterBuildMessageHdr(), and clusterSendMessage().
Referenced by clusterSendFailoverAuthIfNeeded().
void clusterSendFailoverAuthIfNeeded | ( | clusterNode * | node, |
clusterMsg * | request | ||
) |
Definition at line 2594 of file cluster.c.
References bitmapTestBit(), clusterSendFailoverAuth(), myself, NULL, and request.
Referenced by clusterProcessPacket().
Definition at line 2152 of file cluster.c.
References clusterWriteHandler(), link, msg, ntohs, and type.
Referenced by clusterBroadcastMessage(), clusterSendFailoverAuth(), clusterSendMFStart(), clusterSendPing(), clusterSendPublish(), and clusterSendUpdate().
void clusterSendMFStart | ( | clusterNode * | node | ) |
Definition at line 2581 of file cluster.c.
References clusterBuildMessageHdr(), and clusterSendMessage().
Referenced by clusterCommand().
void clusterSendPing | ( | clusterLink * | link, |
int | type | ||
) |
Definition at line 2293 of file cluster.c.
References clusterBuildMessageHdr(), clusterNodeIsInGossipSection(), clusterSendMessage(), clusterSetGossipEntry(), flags, htons, link, myself, NULL, type, and zcalloc().
Referenced by clusterBroadcastPong(), clusterCron(), and clusterProcessPacket().
void clusterSendPublish | ( | clusterLink * | link, |
robj * | channel, | ||
robj * | message | ||
) |
Definition at line 2461 of file cluster.c.
References clusterBroadcastMessage(), clusterBuildMessageHdr(), clusterSendMessage(), link, memcpy(), and message.
Referenced by clusterPropagatePublish().
void clusterSendUpdate | ( | clusterLink * | link, |
clusterNode * | node | ||
) |
Definition at line 2519 of file cluster.c.
References clusterBuildMessageHdr(), clusterSendMessage(), link, memcpy(), and NULL.
Referenced by clusterProcessPacket().
void clusterSetGossipEntry | ( | clusterMsg * | hdr, |
int | i, | ||
clusterNode * | n | ||
) |
void clusterSetMaster | ( | clusterNode * | n | ) |
Definition at line 3798 of file cluster.c.
References clusterCloseAllSlots(), clusterNodeAddSlave(), clusterNodeRemoveSlave(), myself, n, and resetManualFailover().
Referenced by clusterCommand(), clusterHandleSlaveMigration(), and clusterUpdateSlotsConfigWith().
void clusterSetNodeAsMaster | ( | clusterNode * | n | ) |
Definition at line 1479 of file cluster.c.
References clusterDoBeforeSleep(), clusterNodeRemoveSlave(), myself, n, and NULL.
Referenced by clusterFailoverReplaceYourMaster(), clusterProcessPacket(), and clusterReset().
Definition at line 1259 of file cluster.c.
References AF_INET, AF_INET6, clusterAddNode(), clusterHandshakeInProgress(), createClusterNode(), EAGAIN, EINVAL, ip, memcpy(), memset(), n, and NULL.
Referenced by clusterCommand(), and clusterProcessGossipSection().
void clusterUpdateSlotsConfigWith | ( | clusterNode * | sender, |
uint64_t | senderConfigEpoch, | ||
unsigned char * | slots | ||
) |
Definition at line 1506 of file cluster.c.
References bitmapTestBit(), clusterAddSlot(), clusterDelSlot(), clusterDoBeforeSleep(), clusterSetMaster(), myself, NULL, and slots.
Referenced by clusterProcessPacket().
void clusterUpdateState | ( | void | ) |
Definition at line 3630 of file cluster.c.
References CLUSTER_MAX_REJOIN_DELAY, CLUSTER_MIN_REJOIN_DELAY, CLUSTER_WRITABLE_DELAY, myself, and NULL.
Referenced by clusterBeforeSleep(), clusterCron(), and clusterFailoverReplaceYourMaster().
Definition at line 2063 of file cluster.c.
References fd, handleLinkIOError(), link, mask, UNUSED, and write.
Referenced by clusterSendMessage().
clusterLink* createClusterLink | ( | clusterNode * | node | ) |
Definition at line 566 of file cluster.c.
References link.
Referenced by clusterAcceptHandler(), and clusterCron().
clusterNode * createClusterNode | ( | char * | nodename, |
int | flags | ||
) |
Definition at line 672 of file cluster.c.
References flags, memcpy(), memset(), and NULL.
Referenced by clusterInit(), clusterLoadConfig(), clusterProcessPacket(), and clusterStartHandshake().
void createDumpPayload | ( | rio * | payload, |
robj * | o | ||
) |
void dumpCommand | ( | client * | c | ) |
void freeClusterLink | ( | clusterLink * | link | ) |
Definition at line 579 of file cluster.c.
References close, link, and NULL.
Referenced by clusterCron(), clusterProcessGossipSection(), clusterProcessPacket(), freeClusterNode(), handleLinkIOError(), and nodeUpdateAddressIfNeeded().
void freeClusterNode | ( | clusterNode * | n | ) |
Definition at line 839 of file cluster.c.
References clusterNodeRemoveSlave(), freeClusterLink(), if(), n, and NULL.
Referenced by clusterDelNode().
clusterNode* getNodeByQuery | ( | client * | c, |
struct redisCommand * | cmd, | ||
robj ** | argv, | ||
int | argc, | ||
int * | hashslot, | ||
int * | error_code | ||
) |
Definition at line 5205 of file cluster.c.
References argv, c, cmd, test-lz4-versions::error_code, i, keyHashSlot(), migrateCommand(), myself, n, and NULL.
int getSlotOrReply | ( | client * | c, |
robj * | o | ||
) |
void handleLinkIOError | ( | clusterLink * | link | ) |
Definition at line 2056 of file cluster.c.
References freeClusterLink(), and link.
Referenced by clusterReadHandler(), and clusterWriteHandler().
Definition at line 640 of file cluster.c.
Referenced by clusterCommand(), clusterRedirectBlockedClientIfNeeded(), and getNodeByQuery().
void manualFailoverCheckTimeout | ( | void | ) |
Definition at line 3156 of file cluster.c.
References resetManualFailover().
Referenced by clusterCron().
void markNodeAsFailingIfNeeded | ( | clusterNode * | node | ) |
Definition at line 1171 of file cluster.c.
References clusterDoBeforeSleep(), clusterNodeFailureReportsCount(), clusterSendFail(), and myself.
Referenced by clusterProcessGossipSection().
void migrateCloseSocket | ( | robj * | host, |
robj * | port | ||
) |
Definition at line 4824 of file cluster.c.
References close, and test_evm::cs.
Referenced by migrateCommand().
void migrateCloseTimedoutSockets | ( | void | ) |
Definition at line 4843 of file cluster.c.
References close, test_evm::cs, MIGRATE_SOCKET_CACHE_TTL, and NULL.
void migrateCommand | ( | client * | c | ) |
Definition at line 4864 of file cluster.c.
References buf2, c, cmd, createDumpPayload(), test_evm::cs, ETIMEDOUT, migrateCloseSocket(), migrateGetSocket(), NULL, pos, replace(), select, and timeout.
Referenced by getNodeByQuery().
migrateCachedSocket* migrateGetSocket | ( | client * | c, |
robj * | host, | ||
robj * | port, | ||
long | timeout | ||
) |
Definition at line 4768 of file cluster.c.
References c, close, test_evm::cs, fd, MIGRATE_SOCKET_CACHE_ITEMS, NULL, and timeout.
Referenced by migrateCommand().
void nodeIp2String | ( | char * | buf, |
clusterLink * | link, | ||
char * | announced_ip | ||
) |
Definition at line 1420 of file cluster.c.
References link, memcpy(), and NULL.
Referenced by clusterProcessPacket(), and nodeUpdateAddressIfNeeded().
int nodeUpdateAddressIfNeeded | ( | clusterNode * | node, |
clusterLink * | link, | ||
clusterMsg * | hdr | ||
) |
Definition at line 1441 of file cluster.c.
References freeClusterLink(), ip, link, memcpy(), myself, nodeIp2String(), and ntohs.
Referenced by clusterProcessPacket().
void readonlyCommand | ( | client * | c | ) |
void readwriteCommand | ( | client * | c | ) |
sds representClusterNodeFlags | ( | sds | ci, |
uint16_t | flags | ||
) |
Definition at line 3837 of file cluster.c.
References redisNodeFlags::flag, flags, i, redisNodeFlags::name, and redisNodeFlagsTable.
Referenced by clusterGenNodeDescription(), and clusterProcessGossipSection().
void resetManualFailover | ( | void | ) |
Definition at line 3144 of file cluster.c.
References NULL.
Referenced by clusterCommand(), clusterFailoverReplaceYourMaster(), clusterInit(), clusterProcessPacket(), clusterReset(), clusterSetMaster(), and manualFailoverCheckTimeout().
void restoreCommand | ( | client * | c | ) |
int verifyClusterConfigWithData | ( | void | ) |
Definition at line 3748 of file cluster.c.
References clusterAddSlot(), clusterSaveConfigOrDie(), myself, and NULL.
clusterNode* myself = NULL |
Definition at line 47 of file cluster.c.
Referenced by clusterBroadcastPong(), clusterBuildMessageHdr(), clusterBumpConfigEpochWithoutConsensus(), clusterCommand(), clusterCron(), clusterFailoverReplaceYourMaster(), clusterGetSlaveRank(), clusterHandleConfigEpochCollision(), clusterHandleSlaveFailover(), clusterHandleSlaveMigration(), clusterInit(), clusterLoadConfig(), clusterLogCantFailover(), clusterProcessGossipSection(), clusterProcessPacket(), clusterRedirectBlockedClientIfNeeded(), clusterReset(), clusterSendFailoverAuthIfNeeded(), clusterSendPing(), clusterSetMaster(), clusterSetNodeAsMaster(), clusterUpdateSlotsConfigWith(), clusterUpdateState(), getNodeByQuery(), markNodeAsFailingIfNeeded(), nodeUpdateAddressIfNeeded(), and verifyClusterConfigWithData().
|
static |
Definition at line 3798 of file cluster.c.
Referenced by representClusterNodeFlags().