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. */
| 1037 | * pick a random one, and will fix it when we receive the PONG request using |
| 1038 | * this function. */ |
| 1039 | void clusterRenameNode(clusterNode *node, char *newname) { |
| 1040 | int retval; |
| 1041 | sds s = sdsnewlen(node->name, CLUSTER_NAMELEN); |
| 1042 | |
| 1043 | serverLog(LL_DEBUG,"Renaming node %.40s into %.40s", |
| 1044 | node->name, newname); |
| 1045 | retval = dictDelete(server.cluster->nodes, s); |
| 1046 | sdsfree(s); |
| 1047 | serverAssert(retval == DICT_OK); |
| 1048 | memcpy(node->name, newname, CLUSTER_NAMELEN); |
| 1049 | clusterAddNode(node); |
| 1050 | } |
| 1051 | |
| 1052 | /* ----------------------------------------------------------------------------- |
| 1053 | * CLUSTER config epoch handling |
no test coverage detected