Esempio n. 1
0
static void ext_prog_failed(struct ticket_config *tk,
		int start_election)
{
	if (!is_manual(tk)) {
		/* Give it to somebody else.
	 	 * Just send a VOTE_FOR message, so the
		 * others can start elections. */
		if (leader_and_valid(tk)) {
			save_committed_tkt(tk);
			reset_ticket(tk);
			ticket_write(tk);	
			if (start_election) {
				ticket_broadcast(tk, OP_VOTE_FOR, OP_REQ_VOTE, RLT_SUCCESS, OR_LOCAL_FAIL);
			}
		}
	} else {
		/* There is not much we can do now because
		 * the manual ticket cannot be relocated.
		 * Just warn the user. */
		if (tk->leader == local) {
			save_committed_tkt(tk);
			reset_ticket(tk);
			ticket_write(tk);	
			log_error("external test failed on the specified machine, cannot acquire a manual ticket");
		}
	}
}
Esempio n. 2
0
static void ext_prog_failed(struct ticket_config *tk,
		int start_election)
{
	/* Give it to somebody else.
	 * Just send a VOTE_FOR message, so the
	 * others can start elections. */
	if (leader_and_valid(tk)) {
		save_committed_tkt(tk);
		reset_ticket(tk);
		ticket_write(tk);
		if (start_election) {
			ticket_broadcast(tk, OP_VOTE_FOR, OP_REQ_VOTE, RLT_SUCCESS, OR_LOCAL_FAIL);
		}
	}
}