From: David van Moolenbroek Date: Thu, 16 Jul 2015 15:12:03 +0000 (+0200) Subject: RS: reset heartbeat status after rollback X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=1aa4eb6a851eed667e25554ab646497870da7d22;p=minix.git RS: reset heartbeat status after rollback While in a multicomponent live update that includes RS, the new RS instance may receive heartbeat replies which, after a rollback, the old RS instance will then never see. As a result, the rolled-back RS instance may end up killing well-behaving services. Change-Id: I0f0af283c33502d5d55b27e353b62aec2e301285 --- diff --git a/minix/servers/rs/update.c b/minix/servers/rs/update.c index b964936e0..49e45f8ee 100644 --- a/minix/servers/rs/update.c +++ b/minix/servers/rs/update.c @@ -296,6 +296,7 @@ int sys_upd_flags; void rollback_service(struct rproc **new_rpp, struct rproc **old_rpp) { /* Rollback an updated service. */ + struct rproc *rp; int r = OK; /* RS is special, we may only need to swap the slots to rollback. */ @@ -311,6 +312,10 @@ void rollback_service(struct rproc **new_rpp, struct rproc **old_rpp) if(rs_verbose) printf("RS: %s performed rollback\n", srv_to_string(*new_rpp)); } + /* Since we may now have missed heartbeat replies, resend requests. */ + for (rp = BEG_RPROC_ADDR; rp < END_RPROC_ADDR; rp++) + if (rp->r_flags & RS_ACTIVE) + rp->r_check_tm = 0; } else { int swap_flag = ((*new_rpp)->r_flags & RS_INIT_PENDING ? RS_DONTSWAP : RS_SWAP);