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 5ec7c67..1c1cb07 100644 --- a/sheep/group.c +++ b/sheep/group.c @@ -53,6 +53,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]; @@ -543,6 +544,7 @@ static void finish_join(struct join_message *msg, struct sd_node *joined, sys->nr_copies = msg->nr_copies; sys->epoch = msg->epoch; + sys->templeft_time = msg->templeft_time; /* add nodes execept for newly joined one */ for (i = 0; i < nr_nodes; i++) { @@ -797,6 +799,7 @@ enum cluster_join_result sd_check_join_cb(struct sd_node *joining, void *opaque) 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 |