MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / probe_grouped_clone

Function probe_grouped_clone

pengine/native.c:2232–2275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2230}
2231
2232static node_t *
2233probe_grouped_clone(resource_t * rsc, node_t * node, pe_working_set_t * data_set)
2234{
2235 node_t *running = NULL;
2236 resource_t *top = uber_parent(rsc);
2237
2238 if (running == NULL && is_set(top->flags, pe_rsc_unique) == FALSE) {
2239 /* Annoyingly we also need to check any other clone instances
2240 * Clumsy, but it will work.
2241 *
2242 * An alternative would be to update known_on for every peer
2243 * during process_rsc_state()
2244 *
2245 * This code desperately needs optimization
2246 * ptest -x with 100 nodes, 100 clones and clone-max=10:
2247 * No probes O(25s)
2248 * Detection without clone loop O(3m)
2249 * Detection with clone loop O(8m)
2250
2251 ptest[32211]: 2010/02/18_14:27:55 CRIT: stage5: Probing for unknown resources
2252 ptest[32211]: 2010/02/18_14:33:39 CRIT: stage5: Done
2253 ptest[32211]: 2010/02/18_14:35:05 CRIT: stage7: Updating action states
2254 ptest[32211]: 2010/02/18_14:35:05 CRIT: stage7: Done
2255
2256 */
2257 char *clone_id = clone_zero(rsc->id);
2258 resource_t *peer = pe_find_resource(top->children, clone_id);
2259
2260 while (peer && running == NULL) {
2261 running = pe_hash_table_lookup(peer->known_on, node->details->id);
2262 if (running != NULL) {
2263 /* we already know the status of the resource on this node */
2264 pe_rsc_trace(rsc, "Skipping active clone: %s", rsc->id);
2265 free(clone_id);
2266 return running;
2267 }
2268 clone_id = increment_clone(clone_id);
2269 peer = pe_find_resource(data_set->resources, clone_id);
2270 }
2271
2272 free(clone_id);
2273 }
2274 return running;
2275}
2276
2277gboolean
2278native_create_probe(resource_t * rsc, node_t * node, action_t * complete,

Callers 1

native_create_probeFunction · 0.85

Calls 6

uber_parentFunction · 0.85
is_setFunction · 0.85
clone_zeroFunction · 0.85
pe_find_resourceFunction · 0.85
pe_hash_table_lookupFunction · 0.85
increment_cloneFunction · 0.85

Tested by

no test coverage detected