/** * Accept the current clique. * * \param[in] gen Generation of accepted clique */ static void accept_clique(sup_gen_t gen) { set_state(SUP_STATE_ACCEPT); self->view.accepted = gen; exa_nodeset_copy(&accepted_clique, &self->view.clique); }
/** * Before sending a ping. */ static void sup_pre_ping(void) { update_last_seen(); #ifdef USE_YAOURT if (yaourt_event_wait(EXAMSG_CSUPD_ID, "sup_pre_ping") != 0) self_view_changed = true; #endif if (self_view_changed || other_view_changed) { exa_nodeset_t new_clique; bool clique_changed; exa_nodeid_t coord; __trace("RECALCULATING CLIQUE"); sup_clique_compute(&cluster, &new_clique); clique_changed = !exa_nodeset_equals(&new_clique, &self->view.clique); if (clique_changed) { exa_nodeset_copy(&self->view.clique, &new_clique); coord = exa_nodeset_first(&self->view.clique); if (coord != self->view.coord) { __trace("new coord: %u", coord); self->view.coord = coord; } } #ifdef DEBUG { char clique_str[EXA_MAX_NODES_NUMBER + 1]; exa_nodeset_to_bin(&self->view.clique, clique_str); __trace("Clique: %s %s", clique_str, clique_changed ? "CHANGED" : ""); } #endif } if (self_view_changed || other_view_changed) { __trace("*** SUP_MSHIP_CHANGE ***"); set_state(SUP_STATE_CHANGE); } #ifdef WITH_TRACE dump_view(0); #endif }
/** * Deliver to Evmgr the membership calculated by Csupd. * * \param[in] gen Generation number * \param[in] mship Membership to deliver * * \return 0 if successfull, negative error code otherwise */ int sup_deliver(sup_gen_t gen, const exa_nodeset_t *mship) { int ret; SupEventMshipChange msg; msg.any.type = EXAMSG_SUP_MSHIP_CHANGE; msg.gen = gen; exa_nodeset_copy(&msg.mship, mship); ret = examsgSendNoBlock(sup_mh, EXAMSG_ADMIND_EVMGR_ID, EXAMSG_LOCALHOST, &msg, sizeof(SupEventMshipChange)); EXA_ASSERT_VERBOSE(ret == sizeof(SupEventMshipChange), "Unable to deliver membership to the evmgr (%d)", ret); return 0; }
void vrt_node_set_upnodes(const exa_nodeset_t *new_nodes_up) { exa_nodeset_copy(&nodes_up, new_nodes_up); }
void vrt_node_get_upnodes(exa_nodeset_t *nodeset) { exa_nodeset_copy(nodeset, &nodes_up); }