Blame SOURCES/0059-Ticket-48217-cleanallruv-fix-regression-with-server-.patch

a2f18f
From ac98944372376a0d41a33dfe84a99bfaa151699f Mon Sep 17 00:00:00 2001
a2f18f
From: Mark Reynolds <mreynolds@redhat.com>
a2f18f
Date: Fri, 18 Sep 2015 11:56:29 -0400
a2f18f
Subject: [PATCH 59/61] Ticket 48217 - cleanallruv - fix regression with server
a2f18f
 shutdown
a2f18f
a2f18f
Bug Description:  Recent checks for server shutdown were added to cleanallruv task,
a2f18f
                  but we did not properly check for "shutdown" at the end of the task.
a2f18f
                  This caused the server to think the task successfully finished,
a2f18f
                  when in fact it did not.
a2f18f
a2f18f
Fix Description:  Properly check for shutdown at the end of the task, and handler it
a2f18f
                  appropriately.
a2f18f
a2f18f
https://fedorahosted.org/389/ticket/48217
a2f18f
a2f18f
Reviewed by: nhosoi(Thanks!)
a2f18f
a2f18f
(cherry picked from commit c41d36de0ca438bf23e4e810bfec0fd59cbc790b)
a2f18f
(cherry picked from commit d9f03f5fddfc8ba7009c9dcc584686e43d6339e8)
a2f18f
---
a2f18f
 ldap/servers/plugins/replication/repl5_replica_config.c | 8 ++++----
a2f18f
 1 file changed, 4 insertions(+), 4 deletions(-)
a2f18f
a2f18f
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
a2f18f
index 446da3f..8d3c481 100644
a2f18f
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
a2f18f
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
a2f18f
@@ -1948,7 +1948,7 @@ done:
a2f18f
     /*
a2f18f
      *  If the replicas are cleaned, release the rid
a2f18f
      */
a2f18f
-    if(!aborted){
a2f18f
+    if(!aborted && !slapi_is_shutting_down()){
a2f18f
         delete_cleaned_rid_config(data);
a2f18f
         /* make sure all the replicas have been "pre_cleaned" before finishing */
a2f18f
         check_replicas_are_done_cleaning(data);
a2f18f
@@ -3005,7 +3005,7 @@ replica_abort_task_thread(void *arg)
a2f18f
     }
a2f18f
 
a2f18f
     /*
a2f18f
-     *  Now send the cleanruv extended op to all the agreements
a2f18f
+     *  Now send the abort cleanruv extended op to all the agreements
a2f18f
      */
a2f18f
     while(agmt_not_notified && !slapi_is_shutting_down()){
a2f18f
         agmt_obj = agmtlist_get_first_agreement_for_replica (data->replica);
a2f18f
@@ -3013,7 +3013,7 @@ replica_abort_task_thread(void *arg)
a2f18f
         	agmt_not_notified = 0;
a2f18f
         	break;
a2f18f
         }
a2f18f
-        while (agmt_obj){
a2f18f
+        while (agmt_obj && !slapi_is_shutting_down()){
a2f18f
             agmt = (Repl_Agmt*)object_get_data (agmt_obj);
a2f18f
             if(!agmt_is_enabled(agmt) || get_agmt_agreement_type(agmt) == REPLICA_TYPE_WINDOWS){
a2f18f
                 agmt_obj = agmtlist_get_next_agreement_for_replica (data->replica, agmt_obj);
a2f18f
@@ -3058,7 +3058,7 @@ replica_abort_task_thread(void *arg)
a2f18f
     } /* while */
a2f18f
 
a2f18f
 done:
a2f18f
-    if(agmt_not_notified){
a2f18f
+    if(agmt_not_notified || slapi_is_shutting_down()){
a2f18f
         /* failure */
a2f18f
         cleanruv_log(data->task, data->rid, ABORT_CLEANALLRUV_ID,"Abort task failed, will resume the task at the next server startup.");
a2f18f
     } else {
a2f18f
-- 
a2f18f
1.9.3
a2f18f