From: HaiTing Yao <wujue.yht at taobao.com> When restart the sheepdog daemon or start a new daemon, the new daemon should get templeave time from master Signed-off-by: HaiTing Yao <wujue.yht at taobao.com> --- sheep/group.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/sheep/group.c b/sheep/group.c index 6c6cf6a..69bdc82 100644 --- a/sheep/group.c +++ b/sheep/group.c @@ -47,6 +47,7 @@ struct join_message { uint32_t result; uint8_t inc_epoch; /* set non-zero when we increment epoch of all nodes */ uint8_t store[STORE_LEN]; + uint32_t templeft_time; union { struct sd_node nodes[0]; struct sd_node leave_nodes[0]; @@ -552,6 +553,7 @@ static void update_cluster_info(struct join_message *msg, sys->nr_sobjs = msg->nr_sobjs; sys->epoch = msg->epoch; + sys->templeft_time = msg->templeft_time; /* add nodes execept for newly joined one */ for (i = 0; i < nr_nodes; i++) { @@ -801,6 +803,7 @@ static enum cluster_join_result sd_check_join_cb( return CJ_RES_MASTER_TRANSFER; } jm->epoch = sys->epoch; + jm->templeft_time = sys->templeft_time; if (jm->result == SD_RES_SUCCESS) return CJ_RES_SUCCESS; -- 1.7.1 |