static void cpg_confchg_cb(cpg_handle_t handle, const struct cpg_name *group_name, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *joined_list, size_t joined_list_entries) { unsigned int i; for (i = 0; i < left_list_entries; i++) { const struct cpg_address *cpg_node = &left_list[i]; struct corosync_node* node; node = ao2_find(nodes, &cpg_node->nodeid, OBJ_UNLINK | OBJ_SEARCH_KEY); if (!node) { continue; } publish_cluster_discovery_to_stasis_full(node, 0); ao2_ref(node, -1); } /* If any new nodes have joined, dump our cache of events we are publishing * that originated from this server. */ if (!joined_list_entries) { return; } for (i = 0; i < ARRAY_LEN(event_types); i++) { struct ao2_container *messages; ast_rwlock_rdlock(&event_types_lock); if (!event_types[i].publish) { ast_rwlock_unlock(&event_types_lock); continue; } if (!event_types[i].cache_fn || !event_types[i].message_type_fn) { ast_rwlock_unlock(&event_types_lock); continue; } messages = stasis_cache_dump_by_eid(event_types[i].cache_fn(), event_types[i].message_type_fn(), &ast_eid_default); ast_rwlock_unlock(&event_types_lock); ao2_callback(messages, OBJ_NODATA, dump_cache_cb, NULL); ao2_t_ref(messages, -1, "Dispose of dumped cache"); } }
static void cpg_confchg_cb(cpg_handle_t handle, const struct cpg_name *group_name, const struct cpg_address *member_list, size_t member_list_entries, const struct cpg_address *left_list, size_t left_list_entries, const struct cpg_address *joined_list, size_t joined_list_entries) { unsigned int i; /* If any new nodes have joined, dump our cache of events we are publishing * that originated from this server. */ if (!joined_list_entries) { return; } for (i = 0; i < ARRAY_LEN(event_types); i++) { struct ao2_container *messages; ast_rwlock_rdlock(&event_types_lock); if (!event_types[i].publish) { ast_rwlock_unlock(&event_types_lock); continue; } if (!event_types[i].cache_fn || !event_types[i].message_type_fn) { ast_rwlock_unlock(&event_types_lock); continue; } messages = stasis_cache_dump_by_eid(event_types[i].cache_fn(), event_types[i].message_type_fn(), &ast_eid_default); ast_rwlock_unlock(&event_types_lock); ao2_callback(messages, OBJ_NODATA, dump_cache_cb, NULL); ao2_t_ref(messages, -1, "Dispose of dumped cache"); } }