a3470f
From 1ce0b65090c888b0e2b28cab03731674f4988aeb Mon Sep 17 00:00:00 2001
a3470f
From: Milind Changire <mchangir@redhat.com>
a3470f
Date: Tue, 10 Oct 2017 09:58:24 +0530
a3470f
Subject: [PATCH 33/74] build: launch glusterd upgrade after all new bits are
a3470f
 installed
a3470f
a3470f
Problem:
a3470f
glusterd upgrade mode needs new bits from glusterfs-rdma which
a3470f
optional and causes the dependency graph to break since it is
a3470f
not tied into glusterfs-server requirements
a3470f
a3470f
Solution:
a3470f
Run glusterd upgrade mode after all new bits are installed
a3470f
i.e. in %posttrans server section
a3470f
a3470f
Label: DOWNSTREAM ONLY
a3470f
a3470f
Change-Id: I356e02d0bf0eaaef43c20ce07b388262f63093a4
a3470f
Signed-off-by: Milind Changire <mchangir@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/120094
a3470f
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
a3470f
---
a3470f
 glusterfs.spec.in | 56 ++++++++++++++++++++++++++++++++++---------------------
a3470f
 1 file changed, 35 insertions(+), 21 deletions(-)
a3470f
a3470f
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
a3470f
index 600fa6e..f4386de 100644
a3470f
--- a/glusterfs.spec.in
a3470f
+++ b/glusterfs.spec.in
a3470f
@@ -963,27 +963,6 @@ fi
a3470f
     %firewalld_reload
a3470f
 %endif
a3470f
 
a3470f
-pidof -c -o %PPID -x glusterd &> /dev/null
a3470f
-if [ $? -eq 0 ]; then
a3470f
-    kill -9 `pgrep -f gsyncd.py` &> /dev/null
a3470f
-
a3470f
-    killall --wait glusterd &> /dev/null
a3470f
-    glusterd --xlator-option *.upgrade=on -N
a3470f
-
a3470f
-    #Cleaning leftover glusterd socket file which is created by glusterd in
a3470f
-    #rpm_script_t context.
a3470f
-    rm -f %{_rundir}/glusterd.socket
a3470f
-
a3470f
-    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
a3470f
-    # so start it again
a3470f
-    %_init_start glusterd
a3470f
-else
a3470f
-    glusterd --xlator-option *.upgrade=on -N
a3470f
-
a3470f
-    #Cleaning leftover glusterd socket file which is created by glusterd in
a3470f
-    #rpm_script_t context.
a3470f
-    rm -f %{_rundir}/glusterd.socket
a3470f
-fi
a3470f
 %endif
a3470f
 
a3470f
 ##-----------------------------------------------------------------------------
a3470f
@@ -2166,6 +2145,35 @@ os.remove(tmpname)
a3470f
 if not (ok == 0) then
a3470f
    error("Detected running glusterfs processes", ok)
a3470f
 end
a3470f
+
a3470f
+%posttrans server
a3470f
+pidof -c -o %PPID -x glusterd &> /dev/null
a3470f
+if [ $? -eq 0 ]; then
a3470f
+    kill -9 `pgrep -f gsyncd.py` &> /dev/null
a3470f
+
a3470f
+    killall --wait -SIGTERM glusterd &> /dev/null
a3470f
+
a3470f
+    if [ "$?" != "0" ]; then
a3470f
+        echo "killall failed while killing glusterd"
a3470f
+    fi
a3470f
+
a3470f
+    glusterd --xlator-option *.upgrade=on -N
a3470f
+
a3470f
+    #Cleaning leftover glusterd socket file which is created by glusterd in
a3470f
+    #rpm_script_t context.
a3470f
+    rm -rf /var/run/glusterd.socket
a3470f
+
a3470f
+    # glusterd _was_ running, we killed it, it exited after *.upgrade=on,
a3470f
+    # so start it again
a3470f
+    %_init_start glusterd
a3470f
+else
a3470f
+    glusterd --xlator-option *.upgrade=on -N
a3470f
+
a3470f
+    #Cleaning leftover glusterd socket file which is created by glusterd in
a3470f
+    #rpm_script_t context.
a3470f
+    rm -rf /var/run/glusterd.socket
a3470f
+fi
a3470f
+
a3470f
 %endif
a3470f
 
a3470f
 # Events
a3470f
@@ -2190,9 +2198,15 @@ end
a3470f
 %endif
a3470f
 
a3470f
 %changelog
a3470f
+* Tue Oct 10 2017 Milind Changire <mchangir@redhat.com>
a3470f
+- DOWNSTREAM ONLY patch - launch glusterd in upgrade mode after all new bits have been installed
a3470f
+
a3470f
 * Tue Aug 22 2017 Kaleb S. KEITHLEY <kkeithle@redhat.com>
a3470f
 - libibverbs-devel, librdmacm-devel -> rdma-core-devel #1483996
a3470f
 
a3470f
+* Fri Aug 04 2017 Kaleb S. KEITHLEY <kkeithle@rehat.com>
a3470f
+- /var/lib/glusterd/options made config(noreplace) to avoid losing shared state info
a3470f
+
a3470f
 * Thu Jul 20 2017 Aravinda VK <avishwan@redhat.com>
a3470f
 - Added new tool/binary to set the gfid2path xattr on files
a3470f
 
a3470f
-- 
a3470f
1.8.3.1
a3470f