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. */
| 1076 | * pick a random one, and will fix it when we receive the PONG request using |
| 1077 | * this function. */ |
| 1078 | void clusterRenameNode(clusterNode *node, char *newname) { |
| 1079 | int retval; |
| 1080 | sds s = sdsnewlen(node->name, CLUSTER_NAMELEN); |
| 1081 | |
| 1082 | serverLog(LL_DEBUG,"Renaming node %.40s into %.40s", |
| 1083 | node->name, newname); |
| 1084 | retval = dictDelete(g_pserver->cluster->nodes, s); |
| 1085 | sdsfree(s); |
| 1086 | serverAssert(retval == DICT_OK); |
| 1087 | memcpy(node->name, newname, CLUSTER_NAMELEN); |
| 1088 | clusterAddNode(node); |
| 1089 | } |
| 1090 | |
| 1091 | /* ----------------------------------------------------------------------------- |
| 1092 | * CLUSTER config epoch handling |
no test coverage detected