Blame SOURCES/bz720543-pcmk-crm_resource_wait_for_all_replies_when_cleaning_up_resources.patch

ed0026
commit 8da149c887c80b1bcf778089268b060e014159ef
ed0026
Author: Andrew Beekhof <andrew@beekhof.net>
ed0026
Date:   Thu Oct 3 17:01:38 2013 +1000
ed0026
ed0026
    Fix: crm_resource: Wait for all replies when cleaning up resources
ed0026
    
ed0026
    (cherry picked from commit 62e59ab2ad211cef798792632ad7df4f8a5c3418)
ed0026
ed0026
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
ed0026
index 44d96b0..c03501d 100644
ed0026
--- a/tools/crm_resource.c
ed0026
+++ b/tools/crm_resource.c
ed0026
@@ -801,11 +801,15 @@ delete_lrm_rsc(cib_t *cib_conn, crm_ipc_t * crmd_channel, const char *host_uname
ed0026
 
ed0026
     printf("Cleaning up %s on %s\n", rsc->id, host_uname);
ed0026
     rc = send_lrm_rsc_op(crmd_channel, CRM_OP_LRM_DELETE, host_uname, rsc->id, TRUE, data_set);
ed0026
+
ed0026
     if (rc == pcmk_ok) {
ed0026
         char *attr_name = NULL;
ed0026
         const char *id = rsc->id;
ed0026
         node_t *node = pe_find_node(data_set->nodes, host_uname);
ed0026
 
ed0026
+        if(node->details->remote_rsc == NULL) {
ed0026
+            crmd_replies_needed++;
ed0026
+        }
ed0026
         if (rsc->clone_name) {
ed0026
             id = rsc->clone_name;
ed0026
         }
ed0026
@@ -2165,6 +2169,7 @@ main(int argc, char **argv)
ed0026
 
ed0026
         crm_debug("Re-checking the state of %s on %s", rsc_id, host_uname);
ed0026
         if(rsc) {
ed0026
+            crmd_replies_needed = 0;
ed0026
             rc = delete_lrm_rsc(cib_conn, crmd_channel, host_uname, rsc, &data_set);
ed0026
         } else {
ed0026
             rc = -ENODEV;