autobuild v6.0-2
Resolves: bz#1471742 bz#1652461 bz#1671862 bz#1676495 bz#1691620 Resolves: bz#1696334 bz#1696903 bz#1697820 bz#1698436 bz#1698728 Resolves: bz#1699709 bz#1699835 bz#1702240 Signed-off-by: Milind Changire <mchangir@redhat.com>
This commit is contained in:
parent
66d73904d1
commit
9e3a39e72d
575
0053-Revert-packaging-ganesha-remove-glusterfs-ganesha-su.patch
Normal file
575
0053-Revert-packaging-ganesha-remove-glusterfs-ganesha-su.patch
Normal file
@ -0,0 +1,575 @@
|
||||
From 1fb89973551937f34f24b45e07072a6ce6c30ff9 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Mon, 16 Oct 2017 14:18:31 +0530
|
||||
Subject: [PATCH 053/124] Revert "packaging: (ganesha) remove glusterfs-ganesha
|
||||
subpackage and related files)"
|
||||
|
||||
This reverts commit 0cf2963f12a8b540a7042605d8c79f638fdf6cee.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Id6e7585021bd4dd78a59580cfa4838bdd4e539a0
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167102
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
configure.ac | 3 +
|
||||
extras/Makefile.am | 3 +-
|
||||
extras/ganesha/Makefile.am | 2 +
|
||||
extras/ganesha/config/Makefile.am | 4 +
|
||||
extras/ganesha/config/ganesha-ha.conf.sample | 19 ++++
|
||||
extras/ganesha/scripts/Makefile.am | 4 +
|
||||
extras/ganesha/scripts/create-export-ganesha.sh | 91 +++++++++++++++
|
||||
extras/ganesha/scripts/dbus-send.sh | 60 ++++++++++
|
||||
extras/ganesha/scripts/generate-epoch.py | 48 ++++++++
|
||||
extras/hook-scripts/start/post/Makefile.am | 2 +-
|
||||
extras/hook-scripts/start/post/S31ganesha-start.sh | 122 +++++++++++++++++++++
|
||||
glusterfs.spec.in | 44 +++++++-
|
||||
12 files changed, 396 insertions(+), 6 deletions(-)
|
||||
create mode 100644 extras/ganesha/Makefile.am
|
||||
create mode 100644 extras/ganesha/config/Makefile.am
|
||||
create mode 100644 extras/ganesha/config/ganesha-ha.conf.sample
|
||||
create mode 100644 extras/ganesha/scripts/Makefile.am
|
||||
create mode 100755 extras/ganesha/scripts/create-export-ganesha.sh
|
||||
create mode 100755 extras/ganesha/scripts/dbus-send.sh
|
||||
create mode 100755 extras/ganesha/scripts/generate-epoch.py
|
||||
create mode 100755 extras/hook-scripts/start/post/S31ganesha-start.sh
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 0d06f5a..125ae29 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -196,6 +196,9 @@ AC_CONFIG_FILES([Makefile
|
||||
extras/init.d/glustereventsd-Debian
|
||||
extras/init.d/glustereventsd-Redhat
|
||||
extras/init.d/glustereventsd-FreeBSD
|
||||
+ extras/ganesha/Makefile
|
||||
+ extras/ganesha/config/Makefile
|
||||
+ extras/ganesha/scripts/Makefile
|
||||
extras/systemd/Makefile
|
||||
extras/systemd/glusterd.service
|
||||
extras/systemd/glustereventsd.service
|
||||
diff --git a/extras/Makefile.am b/extras/Makefile.am
|
||||
index ff5ca9b..983f014 100644
|
||||
--- a/extras/Makefile.am
|
||||
+++ b/extras/Makefile.am
|
||||
@@ -11,7 +11,8 @@ EditorModedir = $(docdir)
|
||||
EditorMode_DATA = glusterfs-mode.el glusterfs.vim
|
||||
|
||||
SUBDIRS = init.d systemd benchmarking hook-scripts $(OCF_SUBDIR) LinuxRPM \
|
||||
- $(GEOREP_EXTRAS_SUBDIR) snap_scheduler firewalld cliutils python
|
||||
+ $(GEOREP_EXTRAS_SUBDIR) snap_scheduler firewalld cliutils python \
|
||||
+ ganesha
|
||||
|
||||
confdir = $(sysconfdir)/glusterfs
|
||||
if WITH_SERVER
|
||||
diff --git a/extras/ganesha/Makefile.am b/extras/ganesha/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..542de68
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/Makefile.am
|
||||
@@ -0,0 +1,2 @@
|
||||
+SUBDIRS = scripts config
|
||||
+CLEANFILES =
|
||||
diff --git a/extras/ganesha/config/Makefile.am b/extras/ganesha/config/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..c729273
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/config/Makefile.am
|
||||
@@ -0,0 +1,4 @@
|
||||
+EXTRA_DIST= ganesha-ha.conf.sample
|
||||
+
|
||||
+confdir = $(sysconfdir)/ganesha
|
||||
+conf_DATA = ganesha-ha.conf.sample
|
||||
diff --git a/extras/ganesha/config/ganesha-ha.conf.sample b/extras/ganesha/config/ganesha-ha.conf.sample
|
||||
new file mode 100644
|
||||
index 0000000..c22892b
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/config/ganesha-ha.conf.sample
|
||||
@@ -0,0 +1,19 @@
|
||||
+# Name of the HA cluster created.
|
||||
+# must be unique within the subnet
|
||||
+HA_NAME="ganesha-ha-360"
|
||||
+#
|
||||
+# N.B. you may use short names or long names; you may not use IP addrs.
|
||||
+# Once you select one, stay with it as it will be mildly unpleasant to
|
||||
+# clean up if you switch later on. Ensure that all names - short and/or
|
||||
+# long - are in DNS or /etc/hosts on all machines in the cluster.
|
||||
+#
|
||||
+# The subset of nodes of the Gluster Trusted Pool that form the ganesha
|
||||
+# HA cluster. Hostname is specified.
|
||||
+HA_CLUSTER_NODES="server1,server2,..."
|
||||
+#HA_CLUSTER_NODES="server1.lab.redhat.com,server2.lab.redhat.com,..."
|
||||
+#
|
||||
+# Virtual IPs for each of the nodes specified above.
|
||||
+VIP_server1="10.0.2.1"
|
||||
+VIP_server2="10.0.2.2"
|
||||
+#VIP_server1_lab_redhat_com="10.0.2.1"
|
||||
+#VIP_server2_lab_redhat_com="10.0.2.2"
|
||||
diff --git a/extras/ganesha/scripts/Makefile.am b/extras/ganesha/scripts/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..00a2c45
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/scripts/Makefile.am
|
||||
@@ -0,0 +1,4 @@
|
||||
+EXTRA_DIST= create-export-ganesha.sh generate-epoch.py dbus-send.sh
|
||||
+
|
||||
+scriptsdir = $(libexecdir)/ganesha
|
||||
+scripts_SCRIPTS = create-export-ganesha.sh dbus-send.sh generate-epoch.py
|
||||
diff --git a/extras/ganesha/scripts/create-export-ganesha.sh b/extras/ganesha/scripts/create-export-ganesha.sh
|
||||
new file mode 100755
|
||||
index 0000000..1ffba42
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/scripts/create-export-ganesha.sh
|
||||
@@ -0,0 +1,91 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+#This script is called by glusterd when the user
|
||||
+#tries to export a volume via NFS-Ganesha.
|
||||
+#An export file specific to a volume
|
||||
+#is created in GANESHA_DIR/exports.
|
||||
+
|
||||
+# Try loading the config from any of the distro
|
||||
+# specific configuration locations
|
||||
+if [ -f /etc/sysconfig/ganesha ]
|
||||
+ then
|
||||
+ . /etc/sysconfig/ganesha
|
||||
+fi
|
||||
+if [ -f /etc/conf.d/ganesha ]
|
||||
+ then
|
||||
+ . /etc/conf.d/ganesha
|
||||
+fi
|
||||
+if [ -f /etc/default/ganesha ]
|
||||
+ then
|
||||
+ . /etc/default/ganesha
|
||||
+fi
|
||||
+
|
||||
+GANESHA_DIR=${1%/}
|
||||
+OPTION=$2
|
||||
+VOL=$3
|
||||
+CONF=$GANESHA_DIR"/ganesha.conf"
|
||||
+declare -i EXPORT_ID
|
||||
+
|
||||
+function check_cmd_status()
|
||||
+{
|
||||
+ if [ "$1" != "0" ]
|
||||
+ then
|
||||
+ rm -rf $GANESHA_DIR/exports/export.$VOL.conf
|
||||
+ sed -i /$VOL.conf/d $CONF
|
||||
+ exit 1
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+
|
||||
+if [ ! -d "$GANESHA_DIR/exports" ];
|
||||
+ then
|
||||
+ mkdir $GANESHA_DIR/exports
|
||||
+ check_cmd_status `echo $?`
|
||||
+fi
|
||||
+
|
||||
+function write_conf()
|
||||
+{
|
||||
+echo -e "# WARNING : Using Gluster CLI will overwrite manual
|
||||
+# changes made to this file. To avoid it, edit the
|
||||
+# file and run ganesha-ha.sh --refresh-config."
|
||||
+
|
||||
+echo "EXPORT{"
|
||||
+echo " Export_Id = 2;"
|
||||
+echo " Path = \"/$VOL\";"
|
||||
+echo " FSAL {"
|
||||
+echo " name = "GLUSTER";"
|
||||
+echo " hostname=\"localhost\";"
|
||||
+echo " volume=\"$VOL\";"
|
||||
+echo " }"
|
||||
+echo " Access_type = RW;"
|
||||
+echo " Disable_ACL = true;"
|
||||
+echo ' Squash="No_root_squash";'
|
||||
+echo " Pseudo=\"/$VOL\";"
|
||||
+echo ' Protocols = "3", "4" ;'
|
||||
+echo ' Transports = "UDP","TCP";'
|
||||
+echo ' SecType = "sys";'
|
||||
+echo " }"
|
||||
+}
|
||||
+if [ "$OPTION" = "on" ];
|
||||
+then
|
||||
+ if ! (cat $CONF | grep $VOL.conf\"$ )
|
||||
+ then
|
||||
+ write_conf $@ > $GANESHA_DIR/exports/export.$VOL.conf
|
||||
+ echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF
|
||||
+ count=`ls -l $GANESHA_DIR/exports/*.conf | wc -l`
|
||||
+ if [ "$count" = "1" ] ; then
|
||||
+ EXPORT_ID=2
|
||||
+ else
|
||||
+ EXPORT_ID=`cat $GANESHA_DIR/.export_added`
|
||||
+ check_cmd_status `echo $?`
|
||||
+ EXPORT_ID=EXPORT_ID+1
|
||||
+ sed -i s/Export_Id.*/"Export_Id= $EXPORT_ID ;"/ \
|
||||
+ $GANESHA_DIR/exports/export.$VOL.conf
|
||||
+ check_cmd_status `echo $?`
|
||||
+ fi
|
||||
+ echo $EXPORT_ID > $GANESHA_DIR/.export_added
|
||||
+ fi
|
||||
+else
|
||||
+ rm -rf $GANESHA_DIR/exports/export.$VOL.conf
|
||||
+ sed -i /$VOL.conf/d $CONF
|
||||
+fi
|
||||
diff --git a/extras/ganesha/scripts/dbus-send.sh b/extras/ganesha/scripts/dbus-send.sh
|
||||
new file mode 100755
|
||||
index 0000000..ec8d948
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/scripts/dbus-send.sh
|
||||
@@ -0,0 +1,60 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+# Try loading the config from any of the distro
|
||||
+# specific configuration locations
|
||||
+if [ -f /etc/sysconfig/ganesha ]
|
||||
+ then
|
||||
+ . /etc/sysconfig/ganesha
|
||||
+fi
|
||||
+if [ -f /etc/conf.d/ganesha ]
|
||||
+ then
|
||||
+ . /etc/conf.d/ganesha
|
||||
+fi
|
||||
+if [ -f /etc/default/ganesha ]
|
||||
+ then
|
||||
+ . /etc/default/ganesha
|
||||
+fi
|
||||
+
|
||||
+GANESHA_DIR=${1%/}
|
||||
+OPTION=$2
|
||||
+VOL=$3
|
||||
+CONF=$GANESHA_DIR"/ganesha.conf"
|
||||
+
|
||||
+function check_cmd_status()
|
||||
+{
|
||||
+ if [ "$1" != "0" ]
|
||||
+ then
|
||||
+ logger "dynamic export failed on node :${hostname -s}"
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+#This function keeps track of export IDs and increments it with every new entry
|
||||
+function dynamic_export_add()
|
||||
+{
|
||||
+ dbus-send --system \
|
||||
+--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
|
||||
+org.ganesha.nfsd.exportmgr.AddExport string:$GANESHA_DIR/exports/export.$VOL.conf \
|
||||
+string:"EXPORT(Path=/$VOL)"
|
||||
+ check_cmd_status `echo $?`
|
||||
+}
|
||||
+
|
||||
+#This function removes an export dynamically(uses the export_id of the export)
|
||||
+function dynamic_export_remove()
|
||||
+{
|
||||
+ removed_id=`cat $GANESHA_DIR/exports/export.$VOL.conf |\
|
||||
+grep Export_Id | awk -F"[=,;]" '{print$2}'| tr -d '[[:space:]]'`
|
||||
+ dbus-send --print-reply --system \
|
||||
+--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
|
||||
+org.ganesha.nfsd.exportmgr.RemoveExport uint16:$removed_id
|
||||
+ check_cmd_status `echo $?`
|
||||
+}
|
||||
+
|
||||
+if [ "$OPTION" = "on" ];
|
||||
+then
|
||||
+ dynamic_export_add $@
|
||||
+fi
|
||||
+
|
||||
+if [ "$OPTION" = "off" ];
|
||||
+then
|
||||
+ dynamic_export_remove $@
|
||||
+fi
|
||||
diff --git a/extras/ganesha/scripts/generate-epoch.py b/extras/ganesha/scripts/generate-epoch.py
|
||||
new file mode 100755
|
||||
index 0000000..5db5e56
|
||||
--- /dev/null
|
||||
+++ b/extras/ganesha/scripts/generate-epoch.py
|
||||
@@ -0,0 +1,48 @@
|
||||
+#!/usr/bin/python
|
||||
+#
|
||||
+# Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
|
||||
+# This file is part of GlusterFS.
|
||||
+#
|
||||
+# This file is licensed to you under your choice of the GNU Lesser
|
||||
+# General Public License, version 3 or any later version (LGPLv3 or
|
||||
+# later), or the GNU General Public License, version 2 (GPLv2), in all
|
||||
+# cases as published by the Free Software Foundation.
|
||||
+#
|
||||
+# Generates unique epoch value on each gluster node to be used by
|
||||
+# nfs-ganesha service on that node.
|
||||
+#
|
||||
+# Configure 'EPOCH_EXEC' option to this script path in
|
||||
+# '/etc/sysconfig/ganesha' file used by nfs-ganesha service.
|
||||
+#
|
||||
+# Construct epoch as follows -
|
||||
+# first 32-bit contains the now() time
|
||||
+# rest 32-bit value contains the local glusterd node uuid
|
||||
+
|
||||
+import time
|
||||
+import binascii
|
||||
+
|
||||
+# Calculate the now() time into a 64-bit integer value
|
||||
+def epoch_now():
|
||||
+ epoch_time = int(time.mktime(time.localtime())) << 32
|
||||
+ return epoch_time
|
||||
+
|
||||
+# Read glusterd UUID and extract first 32-bit of it
|
||||
+def epoch_uuid():
|
||||
+ file_name = '/var/lib/glusterd/glusterd.info'
|
||||
+
|
||||
+ for line in open(file_name):
|
||||
+ if "UUID" in line:
|
||||
+ glusterd_uuid = line.split('=')[1].strip()
|
||||
+
|
||||
+ uuid_bin = binascii.unhexlify(glusterd_uuid.replace("-",""))
|
||||
+
|
||||
+ epoch_uuid = int(uuid_bin.encode('hex'), 32) & 0xFFFF0000
|
||||
+ return epoch_uuid
|
||||
+
|
||||
+# Construct epoch as follows -
|
||||
+# first 32-bit contains the now() time
|
||||
+# rest 32-bit value contains the local glusterd node uuid
|
||||
+epoch = (epoch_now() | epoch_uuid())
|
||||
+print str(epoch)
|
||||
+
|
||||
+exit(0)
|
||||
diff --git a/extras/hook-scripts/start/post/Makefile.am b/extras/hook-scripts/start/post/Makefile.am
|
||||
index e32546d..792019d 100644
|
||||
--- a/extras/hook-scripts/start/post/Makefile.am
|
||||
+++ b/extras/hook-scripts/start/post/Makefile.am
|
||||
@@ -1,4 +1,4 @@
|
||||
-EXTRA_DIST = S29CTDBsetup.sh S30samba-start.sh
|
||||
+EXTRA_DIST = S29CTDBsetup.sh S30samba-start.sh S31ganesha-start.sh
|
||||
|
||||
hookdir = $(GLUSTERD_WORKDIR)/hooks/1/start/post/
|
||||
if WITH_SERVER
|
||||
diff --git a/extras/hook-scripts/start/post/S31ganesha-start.sh b/extras/hook-scripts/start/post/S31ganesha-start.sh
|
||||
new file mode 100755
|
||||
index 0000000..90ba6bc
|
||||
--- /dev/null
|
||||
+++ b/extras/hook-scripts/start/post/S31ganesha-start.sh
|
||||
@@ -0,0 +1,122 @@
|
||||
+#!/bin/bash
|
||||
+PROGNAME="Sganesha-start"
|
||||
+OPTSPEC="volname:,gd-workdir:"
|
||||
+VOL=
|
||||
+declare -i EXPORT_ID
|
||||
+ganesha_key="ganesha.enable"
|
||||
+GANESHA_DIR="/var/run/gluster/shared_storage/nfs-ganesha"
|
||||
+CONF1="$GANESHA_DIR/ganesha.conf"
|
||||
+GLUSTERD_WORKDIR=
|
||||
+
|
||||
+function parse_args ()
|
||||
+{
|
||||
+ ARGS=$(getopt -l $OPTSPEC -o "o" -name $PROGNAME $@)
|
||||
+ eval set -- "$ARGS"
|
||||
+
|
||||
+ while true; do
|
||||
+ case $1 in
|
||||
+ --volname)
|
||||
+ shift
|
||||
+ VOL=$1
|
||||
+ ;;
|
||||
+ --gd-workdir)
|
||||
+ shift
|
||||
+ GLUSTERD_WORKDIR=$1
|
||||
+ ;;
|
||||
+ *)
|
||||
+ shift
|
||||
+ break
|
||||
+ ;;
|
||||
+ esac
|
||||
+ shift
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
+#This function generates a new export entry as export.volume_name.conf
|
||||
+function write_conf()
|
||||
+{
|
||||
+echo -e "# WARNING : Using Gluster CLI will overwrite manual
|
||||
+# changes made to this file. To avoid it, edit the
|
||||
+# file, copy it over to all the NFS-Ganesha nodes
|
||||
+# and run ganesha-ha.sh --refresh-config."
|
||||
+
|
||||
+echo "EXPORT{"
|
||||
+echo " Export_Id = 2;"
|
||||
+echo " Path = \"/$VOL\";"
|
||||
+echo " FSAL {"
|
||||
+echo " name = \"GLUSTER\";"
|
||||
+echo " hostname=\"localhost\";"
|
||||
+echo " volume=\"$VOL\";"
|
||||
+echo " }"
|
||||
+echo " Access_type = RW;"
|
||||
+echo " Disable_ACL = true;"
|
||||
+echo " Squash=\"No_root_squash\";"
|
||||
+echo " Pseudo=\"/$VOL\";"
|
||||
+echo " Protocols = \"3\", \"4\" ;"
|
||||
+echo " Transports = \"UDP\",\"TCP\";"
|
||||
+echo " SecType = \"sys\";"
|
||||
+echo "}"
|
||||
+}
|
||||
+
|
||||
+#It adds the export dynamically by sending dbus signals
|
||||
+function export_add()
|
||||
+{
|
||||
+ dbus-send --print-reply --system --dest=org.ganesha.nfsd \
|
||||
+/org/ganesha/nfsd/ExportMgr org.ganesha.nfsd.exportmgr.AddExport \
|
||||
+string:$GANESHA_DIR/exports/export.$VOL.conf string:"EXPORT(Export_Id=$EXPORT_ID)"
|
||||
+
|
||||
+}
|
||||
+
|
||||
+# based on src/scripts/ganeshactl/Ganesha/export_mgr.py
|
||||
+function is_exported()
|
||||
+{
|
||||
+ local volume="${1}"
|
||||
+
|
||||
+ dbus-send --type=method_call --print-reply --system \
|
||||
+ --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
|
||||
+ org.ganesha.nfsd.exportmgr.ShowExports \
|
||||
+ | grep -w -q "/${volume}"
|
||||
+
|
||||
+ return $?
|
||||
+}
|
||||
+
|
||||
+# Check the info file (contains the volume options) to see if Ganesha is
|
||||
+# enabled for this volume.
|
||||
+function ganesha_enabled()
|
||||
+{
|
||||
+ local volume="${1}"
|
||||
+ local info_file="${GLUSTERD_WORKDIR}/vols/${VOL}/info"
|
||||
+ local enabled="off"
|
||||
+
|
||||
+ enabled=$(grep -w ${ganesha_key} ${info_file} | cut -d"=" -f2)
|
||||
+
|
||||
+ [ "${enabled}" == "on" ]
|
||||
+
|
||||
+ return $?
|
||||
+}
|
||||
+
|
||||
+parse_args $@
|
||||
+
|
||||
+if ganesha_enabled ${VOL} && ! is_exported ${VOL}
|
||||
+then
|
||||
+ if [ ! -e ${GANESHA_DIR}/exports/export.${VOL}.conf ]
|
||||
+ then
|
||||
+ #Remove export entry from nfs-ganesha.conf
|
||||
+ sed -i /$VOL.conf/d $CONF1
|
||||
+ write_conf ${VOL} > ${GANESHA_DIR}/exports/export.${VOL}.conf
|
||||
+ EXPORT_ID=`cat $GANESHA_DIR/.export_added`
|
||||
+ EXPORT_ID=EXPORT_ID+1
|
||||
+ echo $EXPORT_ID > $GANESHA_DIR/.export_added
|
||||
+ sed -i s/Export_Id.*/"Export_Id=$EXPORT_ID;"/ \
|
||||
+ $GANESHA_DIR/exports/export.$VOL.conf
|
||||
+ echo "%include \"$GANESHA_DIR/exports/export.$VOL.conf\"" >> $CONF1
|
||||
+ else
|
||||
+ EXPORT_ID=$(grep ^[[:space:]]*Export_Id $GANESHA_DIR/exports/export.$VOL.conf |\
|
||||
+ awk -F"[=,;]" '{print $2}' | tr -d '[[:space:]]')
|
||||
+ fi
|
||||
+ export_add $VOL
|
||||
+fi
|
||||
+
|
||||
+exit 0
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index 0d57b49..dd7438c 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -299,7 +299,6 @@ Obsoletes: hekafs
|
||||
Obsoletes: %{name}-common < %{version}-%{release}
|
||||
Obsoletes: %{name}-core < %{version}-%{release}
|
||||
Obsoletes: %{name}-ufo
|
||||
-Obsoletes: %{name}-ganesha
|
||||
%if ( 0%{!?_with_gnfs:1} )
|
||||
Obsoletes: %{name}-gnfs
|
||||
%endif
|
||||
@@ -455,6 +454,30 @@ is in user space and easily manageable.
|
||||
This package provides support to FUSE based clients and inlcudes the
|
||||
glusterfs(d) binary.
|
||||
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%package ganesha
|
||||
+Summary: NFS-Ganesha configuration
|
||||
+Group: Applications/File
|
||||
+
|
||||
+Requires: %{name}-server%{?_isa} = %{version}-%{release}
|
||||
+Requires: nfs-ganesha-gluster, pcs, dbus
|
||||
+%if ( 0%{?rhel} && 0%{?rhel} == 6 )
|
||||
+Requires: cman, pacemaker, corosync
|
||||
+%endif
|
||||
+
|
||||
+%description ganesha
|
||||
+GlusterFS is a distributed file-system capable of scaling to several
|
||||
+petabytes. It aggregates various storage bricks over Infiniband RDMA
|
||||
+or TCP/IP interconnect into one large parallel network file
|
||||
+system. GlusterFS is one of the most sophisticated file systems in
|
||||
+terms of features and extensibility. It borrows a powerful concept
|
||||
+called Translators from GNU Hurd kernel. Much of the code in GlusterFS
|
||||
+is in user space and easily manageable.
|
||||
+
|
||||
+This package provides the configuration and related files for using
|
||||
+NFS-Ganesha as the NFS server using GlusterFS
|
||||
+%endif
|
||||
+
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
%package geo-replication
|
||||
Summary: GlusterFS Geo-replication
|
||||
@@ -1111,6 +1134,12 @@ exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
+%if ( 0%{?_without_server:1} )
|
||||
+#exclude ganesha related files
|
||||
+%exclude %{_sysconfdir}/ganesha/*
|
||||
+%exclude %{_libexecdir}/ganesha/*
|
||||
+%endif
|
||||
+
|
||||
%files api
|
||||
%exclude %{_libdir}/*.so
|
||||
# libgfapi files
|
||||
@@ -1273,6 +1302,12 @@ exit 0
|
||||
%exclude %{_datadir}/glusterfs/tests/vagrant
|
||||
%endif
|
||||
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%files ganesha
|
||||
+%{_sysconfdir}/ganesha/*
|
||||
+%{_libexecdir}/ganesha/*
|
||||
+%endif
|
||||
+
|
||||
%if ( 0%{!?_without_ocf:1} )
|
||||
%files resource-agents
|
||||
# /usr/lib is the standard for OCF, also on x86_64
|
||||
@@ -1396,6 +1431,7 @@ exit 0
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S29CTDBsetup.sh
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S30samba-start.sh
|
||||
+ %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/pre
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/post
|
||||
@@ -1868,6 +1904,9 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
+* Fri Apr 5 2019 Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
+- Adding ganesha bits back in gluster repository
|
||||
+
|
||||
* Wed Mar 6 2019 Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
- remove unneeded ldconfig in scriptlets
|
||||
- reported by Igor Gnatenko in Fedora
|
||||
@@ -1960,9 +1999,6 @@ fi
|
||||
* Thu Feb 16 2017 Niels de Vos <ndevos@redhat.com>
|
||||
- Obsolete and Provide python-gluster for upgrading from glusterfs < 3.10
|
||||
|
||||
-* Tue Feb 7 2017 Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
-- remove ganesha (#1418417)
|
||||
-
|
||||
* Wed Feb 1 2017 Poornima G <pgurusid@redhat.com>
|
||||
- Install /var/lib/glusterd/groups/metadata-cache by default
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
1912
0054-Revert-glusterd-storhaug-remove-ganesha.patch
Normal file
1912
0054-Revert-glusterd-storhaug-remove-ganesha.patch
Normal file
File diff suppressed because it is too large
Load Diff
1897
0055-Revert-storhaug-HA-first-step-remove-resource-agents.patch
Normal file
1897
0055-Revert-storhaug-HA-first-step-remove-resource-agents.patch
Normal file
File diff suppressed because it is too large
Load Diff
229
0056-common-ha-fixes-for-Debian-based-systems.patch
Normal file
229
0056-common-ha-fixes-for-Debian-based-systems.patch
Normal file
@ -0,0 +1,229 @@
|
||||
From 2c1a83920b959a1ec170243d1eec71b1e2c074b0 Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Fri, 7 Apr 2017 09:09:29 -0400
|
||||
Subject: [PATCH 056/124] common-ha: fixes for Debian-based systems
|
||||
|
||||
1) Debian-based systems don't have /usr/libexec/... and there is
|
||||
a hard-coded invocation of /usr/libexec/ganesha/ganesha-ha.sh within
|
||||
ganesha-ha.sh itself.
|
||||
Fix: save $0 and use it instead for further invocations of self.
|
||||
|
||||
2) default shell is /bin/dash (not /bin/bash). Various runner_run()
|
||||
invocations for ganesha used what amounts to
|
||||
exec("sh /usr/$libexec/ganesha/ganesha-ha.sh ...);
|
||||
which executes the script using the default shell, but there are
|
||||
some bash-specific idioms that don't work if the shell is dash.
|
||||
Fix: change to exec("/usr/$libexec/ganesha/ganesha-ha.sh ...); so that
|
||||
the shebang forces the use of /bin/bash
|
||||
|
||||
3) Fedora and RHEL7 have merged /bin/ and /usr/bin, /bin is a symlink
|
||||
to /usr/bin. Debian-based systems are not merged, and systemd systems
|
||||
have /bin/systemctl. The logic to find .../bin/systemctl is backwards.
|
||||
If the logic looks for /usr/bin/systemctl it will not find it on
|
||||
Debian-based systems; if it looks for /bin/systemctl it will find it
|
||||
on Fedora and RHEL by virtue of the symlink. (RHEL6 and others will
|
||||
find their respective init regardless.)
|
||||
Fix: change the logic to look for /bin/systemctl instead.
|
||||
|
||||
4) The logic for deciding to run systemctl (or not) is a bit silly.
|
||||
Fix: simply invoke the found method via the function pointer in the
|
||||
table.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I33681b296a73aebb078bda6ac0d3a1d3b9770a21
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17013
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167141
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 21 +++++++++---------
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 32 +++++++++++-----------------
|
||||
2 files changed, 23 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 6b011be..4b93f95 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -20,6 +20,7 @@
|
||||
# ensure that the NFS GRACE DBUS signal is sent after the VIP moves to
|
||||
# the new host.
|
||||
|
||||
+GANESHA_HA_SH=$(realpath $0)
|
||||
HA_NUM_SERVERS=0
|
||||
HA_SERVERS=""
|
||||
HA_VOL_NAME="gluster_shared_storage"
|
||||
@@ -68,9 +69,9 @@ function find_rhel7_conf
|
||||
done
|
||||
}
|
||||
|
||||
-if [ -z $CONFFILE ]
|
||||
+if [ -z ${CONFFILE} ]
|
||||
then
|
||||
- find_rhel7_conf $OPTIONS
|
||||
+ find_rhel7_conf ${OPTIONS}
|
||||
|
||||
fi
|
||||
|
||||
@@ -90,9 +91,9 @@ usage() {
|
||||
|
||||
determine_service_manager () {
|
||||
|
||||
- if [ -e "/usr/bin/systemctl" ];
|
||||
+ if [ -e "/bin/systemctl" ];
|
||||
then
|
||||
- SERVICE_MAN="/usr/bin/systemctl"
|
||||
+ SERVICE_MAN="/bin/systemctl"
|
||||
elif [ -e "/sbin/invoke-rc.d" ];
|
||||
then
|
||||
SERVICE_MAN="/sbin/invoke-rc.d"
|
||||
@@ -100,7 +101,7 @@ determine_service_manager () {
|
||||
then
|
||||
SERVICE_MAN="/sbin/service"
|
||||
fi
|
||||
- if [ "$SERVICE_MAN" == "DISTRO_NOT_FOUND" ]
|
||||
+ if [ "${SERVICE_MAN}" == "DISTRO_NOT_FOUND" ]
|
||||
then
|
||||
echo "Service manager not recognized, exiting"
|
||||
exit 1
|
||||
@@ -113,21 +114,21 @@ manage_service ()
|
||||
local new_node=${2}
|
||||
local option=
|
||||
|
||||
- if [ "$action" == "start" ]; then
|
||||
+ if [ "${action}" == "start" ]; then
|
||||
option="yes"
|
||||
else
|
||||
option="no"
|
||||
fi
|
||||
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
-${SECRET_PEM} root@${new_node} "/usr/libexec/ganesha/ganesha-ha.sh --setup-ganesha-conf-files $HA_CONFDIR $option"
|
||||
+${SECRET_PEM} root@${new_node} "${GANESHA_HA_SH} --setup-ganesha-conf-files $HA_CONFDIR $option"
|
||||
|
||||
- if [ "$SERVICE_MAN" == "/usr/bin/systemctl" ]
|
||||
+ if [ "${SERVICE_MAN}" == "/bin/systemctl" ]
|
||||
then
|
||||
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
-${SECRET_PEM} root@${new_node} "$SERVICE_MAN ${action} nfs-ganesha"
|
||||
+${SECRET_PEM} root@${new_node} "${SERVICE_MAN} ${action} nfs-ganesha"
|
||||
else
|
||||
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
-${SECRET_PEM} root@${new_node} "$SERVICE_MAN nfs-ganesha ${action}"
|
||||
+${SECRET_PEM} root@${new_node} "${SERVICE_MAN} nfs-ganesha ${action}"
|
||||
fi
|
||||
}
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index fac16e6..81f794d 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -122,12 +122,9 @@ sc_service_action(struct service_command *sc, char *command)
|
||||
static int
|
||||
manage_service(char *action)
|
||||
{
|
||||
- struct stat stbuf = {
|
||||
- 0,
|
||||
- };
|
||||
int i = 0;
|
||||
int ret = 0;
|
||||
- struct service_command sc_list[] = {{.binary = "/usr/bin/systemctl",
|
||||
+ struct service_command sc_list[] = {{.binary = "/bin/systemctl",
|
||||
.service = "nfs-ganesha",
|
||||
.action = sc_systemctl_action},
|
||||
{.binary = "/sbin/invoke-rc.d",
|
||||
@@ -139,15 +136,10 @@ manage_service(char *action)
|
||||
{.binary = NULL}};
|
||||
|
||||
while (sc_list[i].binary != NULL) {
|
||||
- ret = sys_stat(sc_list[i].binary, &stbuf);
|
||||
+ ret = sys_access(sc_list[i].binary, X_OK);
|
||||
if (ret == 0) {
|
||||
gf_msg_debug(THIS->name, 0, "%s found.", sc_list[i].binary);
|
||||
- if (strcmp(sc_list[i].binary, "/usr/bin/systemctl") == 0)
|
||||
- ret = sc_systemctl_action(&sc_list[i], action);
|
||||
- else
|
||||
- ret = sc_service_action(&sc_list[i], action);
|
||||
-
|
||||
- return ret;
|
||||
+ return sc_list[i].action(&sc_list[i], action);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
@@ -449,7 +441,7 @@ manage_export_config(char *volname, char *value, char **op_errstr)
|
||||
|
||||
GF_ASSERT(volname);
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/create-export-ganesha.sh",
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/create-export-ganesha.sh",
|
||||
CONFDIR, value, volname, NULL);
|
||||
ret = runner_run(&runner);
|
||||
|
||||
@@ -558,8 +550,8 @@ ganesha_manage_export(dict_t *dict, char *value, char **op_errstr)
|
||||
}
|
||||
|
||||
if (check_host_list()) {
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/dbus-send.sh", CONFDIR,
|
||||
- value, volname, NULL);
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/dbus-send.sh", CONFDIR, value,
|
||||
+ volname, NULL);
|
||||
ret = runner_run(&runner);
|
||||
if (ret) {
|
||||
gf_asprintf(op_errstr,
|
||||
@@ -610,8 +602,8 @@ tear_down_cluster(gf_boolean_t run_teardown)
|
||||
|
||||
if (run_teardown) {
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
- "teardown", CONFDIR, NULL);
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh", "teardown",
|
||||
+ CONFDIR, NULL);
|
||||
ret = runner_run(&runner);
|
||||
/* *
|
||||
* Remove all the entries in CONFDIR expect ganesha.conf and
|
||||
@@ -685,7 +677,7 @@ setup_cluster(gf_boolean_t run_setup)
|
||||
|
||||
if (run_setup) {
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/ganesha-ha.sh", "setup",
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh", "setup",
|
||||
CONFDIR, NULL);
|
||||
ret = runner_run(&runner);
|
||||
}
|
||||
@@ -714,7 +706,7 @@ teardown(gf_boolean_t run_teardown, char **op_errstr)
|
||||
}
|
||||
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/ganesha-ha.sh", "cleanup",
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh", "cleanup",
|
||||
CONFDIR, NULL);
|
||||
ret = runner_run(&runner);
|
||||
if (ret)
|
||||
@@ -759,7 +751,7 @@ stop_ganesha(char **op_errstr)
|
||||
};
|
||||
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
"--setup-ganesha-conf-files", CONFDIR, "no", NULL);
|
||||
ret = runner_run(&runner);
|
||||
if (ret) {
|
||||
@@ -828,7 +820,7 @@ start_ganesha(char **op_errstr)
|
||||
|
||||
if (check_host_list()) {
|
||||
runinit(&runner);
|
||||
- runner_add_args(&runner, "sh", GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
"--setup-ganesha-conf-files", CONFDIR, "yes", NULL);
|
||||
ret = runner_run(&runner);
|
||||
if (ret) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,40 @@
|
||||
From 16d298584c70138fd639281bc900838d7938aec9 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 22 Feb 2017 14:37:04 +0530
|
||||
Subject: [PATCH 057/124] ganesha/scripts : Remove export entries from
|
||||
ganesha.conf during cleanup
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I288f7c9ced23d258a7ce1242d8efe03a4bf6f746
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16708
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167142
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 4b93f95..7ba80b5 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -342,6 +342,7 @@ cleanup_ganesha_config ()
|
||||
rm -f /etc/corosync/corosync.conf
|
||||
rm -rf /etc/cluster/cluster.conf*
|
||||
rm -rf /var/lib/pacemaker/cib/*
|
||||
+ sed -r -i -e '/^%include[[:space:]]+".+\.conf"$/d' $HA_CONFDIR/ganesha.conf
|
||||
}
|
||||
|
||||
do_create_virt_ip_constraints()
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,62 @@
|
||||
From 172f32058b1a7d2e42f373490853aef5dd72f02f Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 22 Feb 2017 14:20:41 +0530
|
||||
Subject: [PATCH 058/124] glusterd/ganesha : During volume delete remove the
|
||||
ganesha export configuration file
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I0363e7f4d7cefd3f1b3c4f91e495767ec52e230e
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16707
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167143
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 2 +-
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 9 +++++++++
|
||||
2 files changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index 81f794d..6d72fda 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -445,7 +445,7 @@ manage_export_config(char *volname, char *value, char **op_errstr)
|
||||
CONFDIR, value, volname, NULL);
|
||||
ret = runner_run(&runner);
|
||||
|
||||
- if (ret)
|
||||
+ if (ret && !(*op_errstr))
|
||||
gf_asprintf(op_errstr,
|
||||
"Failed to create"
|
||||
" NFS-Ganesha export config file.");
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
index a0417ca..81c668c 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
@@ -2936,6 +2936,15 @@ glusterd_op_delete_volume(dict_t *dict)
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (glusterd_check_ganesha_export(volinfo)) {
|
||||
+ ret = manage_export_config(volname, "off", NULL);
|
||||
+ if (ret)
|
||||
+ gf_msg(this->name, GF_LOG_WARNING, 0, 0,
|
||||
+ "Could not delete ganesha export conf file "
|
||||
+ "for %s",
|
||||
+ volname);
|
||||
+ }
|
||||
+
|
||||
ret = glusterd_delete_volume(volinfo);
|
||||
out:
|
||||
gf_msg_debug(this->name, 0, "returning %d", ret);
|
||||
--
|
||||
1.8.3.1
|
||||
|
132
0059-glusterd-ganesha-throw-proper-error-for-gluster-nfs-.patch
Normal file
132
0059-glusterd-ganesha-throw-proper-error-for-gluster-nfs-.patch
Normal file
@ -0,0 +1,132 @@
|
||||
From 8b501d9dfbeecb3ffdc3cd11b7c74aa929356ed6 Mon Sep 17 00:00:00 2001
|
||||
From: jiffin tony thottan <jthottan@redhat.com>
|
||||
Date: Mon, 7 Dec 2015 14:38:54 +0530
|
||||
Subject: [PATCH 059/124] glusterd/ganesha : throw proper error for "gluster
|
||||
nfs-ganesha disable"
|
||||
|
||||
For first time or if "gluster nfs-ganesha enable" fails the global option
|
||||
"nfs-ganesha" won't be stored in glusterd's dictionary. In both cases the
|
||||
"gluster nfs-ganesha disable" throws following error :
|
||||
"nfs-ganesha: failed: nfs-ganesha is already (null)d."
|
||||
|
||||
Also this patch provides the missing prompt for nfs-ganesha disable in 3.10
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I7c9fd6dabedc0cfb14c5190b3554bc63a6bc0340
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16791
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167144
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
cli/src/cli-cmd-parser.c | 33 +++++++++++++++++-----------
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 22 +++++--------------
|
||||
2 files changed, 26 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
|
||||
index cd9c445..f85958b 100644
|
||||
--- a/cli/src/cli-cmd-parser.c
|
||||
+++ b/cli/src/cli-cmd-parser.c
|
||||
@@ -5908,20 +5908,27 @@ cli_cmd_ganesha_parse(struct cli_state *state, const char **words,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- question =
|
||||
- "Enabling NFS-Ganesha requires Gluster-NFS to be"
|
||||
- " disabled across the trusted pool. Do you "
|
||||
- "still want to continue?\n";
|
||||
-
|
||||
if (strcmp(value, "enable") == 0) {
|
||||
- answer = cli_cmd_get_confirmation(state, question);
|
||||
- if (GF_ANSWER_NO == answer) {
|
||||
- gf_log("cli", GF_LOG_ERROR,
|
||||
- "Global operation "
|
||||
- "cancelled, exiting");
|
||||
- ret = -1;
|
||||
- goto out;
|
||||
- }
|
||||
+ question =
|
||||
+ "Enabling NFS-Ganesha requires Gluster-NFS to be "
|
||||
+ "disabled across the trusted pool. Do you "
|
||||
+ "still want to continue?\n";
|
||||
+ } else if (strcmp(value, "disable") == 0) {
|
||||
+ question =
|
||||
+ "Disabling NFS-Ganesha will tear down the entire "
|
||||
+ "ganesha cluster across the trusted pool. Do you "
|
||||
+ "still want to continue?\n";
|
||||
+ } else {
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ answer = cli_cmd_get_confirmation(state, question);
|
||||
+ if (GF_ANSWER_NO == answer) {
|
||||
+ gf_log("cli", GF_LOG_ERROR,
|
||||
+ "Global operation "
|
||||
+ "cancelled, exiting");
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
}
|
||||
cli_out("This will take a few minutes to complete. Please wait ..");
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index 6d72fda..1d17a33 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -252,8 +252,7 @@ int
|
||||
glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr)
|
||||
{
|
||||
int ret = -1;
|
||||
- int value = -1;
|
||||
- gf_boolean_t option = _gf_false;
|
||||
+ char *value = NULL;
|
||||
char *str = NULL;
|
||||
glusterd_conf_t *priv = NULL;
|
||||
xlator_t *this = NULL;
|
||||
@@ -264,8 +263,8 @@ glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr)
|
||||
priv = this->private;
|
||||
GF_ASSERT(priv);
|
||||
|
||||
- value = dict_get_str_boolean(dict, "value", _gf_false);
|
||||
- if (value == -1) {
|
||||
+ ret = dict_get_str(dict, "value", &value);
|
||||
+ if (value == NULL) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_GET_FAILED,
|
||||
"value not present.");
|
||||
goto out;
|
||||
@@ -273,22 +272,13 @@ glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr)
|
||||
/* This dict_get will fail if the user had never set the key before */
|
||||
/*Ignoring the ret value and proceeding */
|
||||
ret = dict_get_str(priv->opts, GLUSTERD_STORE_KEY_GANESHA_GLOBAL, &str);
|
||||
- if (ret == -1) {
|
||||
- gf_msg(this->name, GF_LOG_WARNING, errno, GD_MSG_DICT_GET_FAILED,
|
||||
- "Global dict not present.");
|
||||
- ret = 0;
|
||||
- goto out;
|
||||
- }
|
||||
- /* Validity of the value is already checked */
|
||||
- ret = gf_string2boolean(str, &option);
|
||||
- /* Check if the feature is already enabled, fail in that case */
|
||||
- if (value == option) {
|
||||
- gf_asprintf(op_errstr, "nfs-ganesha is already %sd.", str);
|
||||
+ if (str ? strcmp(value, str) == 0 : strcmp(value, "disable") == 0) {
|
||||
+ gf_asprintf(op_errstr, "nfs-ganesha is already %sd.", value);
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (value) {
|
||||
+ if (strcmp(value, "enable")) {
|
||||
ret = start_ganesha(op_errstr);
|
||||
if (ret) {
|
||||
gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_NFS_GNS_START_FAIL,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,61 @@
|
||||
From 93635333d17a03078a6bf72771445e1bd9ebdc15 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Thu, 2 Mar 2017 12:22:30 +0530
|
||||
Subject: [PATCH 060/124] ganesha/scripts : Stop ganesha process on all nodes
|
||||
if cluster setup fails
|
||||
|
||||
During staging phase of volume option "nfs-ganesha", symlink "ganesha.conf"
|
||||
will be created plus ganesha process will be started. The cluster setup
|
||||
happens during commit phase of that option. So if cluster set up fails, the
|
||||
ganesha process will be running on all cluster nodes.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Ib2cb85364b7ef5b702acb4826ffdf8e6f31a2acd
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16823
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167145
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 7ba80b5..db3f921 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -175,6 +175,13 @@ determine_servers()
|
||||
fi
|
||||
}
|
||||
|
||||
+stop_ganesha_all()
|
||||
+{
|
||||
+ local serverlist=${1}
|
||||
+ for node in ${serverlist} ; do
|
||||
+ manage_service "stop" ${node}
|
||||
+ done
|
||||
+}
|
||||
|
||||
setup_cluster()
|
||||
{
|
||||
@@ -191,6 +198,8 @@ setup_cluster()
|
||||
pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --transport udpu ${servers}
|
||||
if [ $? -ne 0 ]; then
|
||||
logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} ${servers} failed"
|
||||
+ #set up failed stop all ganesha process and clean up symlinks in cluster
|
||||
+ stop_ganesha_all ${servers}
|
||||
exit 1;
|
||||
fi
|
||||
pcs cluster start --all
|
||||
--
|
||||
1.8.3.1
|
||||
|
106
0061-ganesha-allow-refresh-config-and-volume-export-unexp.patch
Normal file
106
0061-ganesha-allow-refresh-config-and-volume-export-unexp.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From a766878e11a984680ed29f13aae713d464ec985e Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 19 Apr 2017 16:12:10 +0530
|
||||
Subject: [PATCH 061/124] ganesha : allow refresh-config and volume
|
||||
export/unexport in failover state
|
||||
|
||||
If ganesha is not running on one of nodes in HA cluster, then alli dbus
|
||||
commands send to that ganesha server will fail. This results in both
|
||||
refresh-config and volume export/unepxort failure. This change will
|
||||
gracefully handle those scenarios.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I3f1b7b7ca98e54c273c266e56357d8e24dd1b14b
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17081
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167146
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 6 ++----
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 24 +++++++++++++++---------
|
||||
xlators/mgmt/glusterd/src/glusterd-messages.h | 2 +-
|
||||
3 files changed, 18 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index db3f921..f040ef6 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -275,8 +275,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
|
||||
ret=$?
|
||||
logger <<< "${output}"
|
||||
if [ ${ret} -ne 0 ]; then
|
||||
- echo "Error: refresh-config failed on ${current_host}."
|
||||
- exit 1
|
||||
+ echo "Refresh-config failed on ${current_host}"
|
||||
else
|
||||
echo "Refresh-config completed on ${current_host}."
|
||||
fi
|
||||
@@ -297,8 +296,7 @@ string:"EXPORT(Export_Id=$export_id)" 2>&1)
|
||||
ret=$?
|
||||
logger <<< "${output}"
|
||||
if [ ${ret} -ne 0 ] ; then
|
||||
- echo "Error: refresh-config failed on localhost."
|
||||
- exit 1
|
||||
+ echo "Refresh-config failed on localhost."
|
||||
else
|
||||
echo "Success: refresh-config completed."
|
||||
fi
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index 1d17a33..ee8b588 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -540,15 +540,21 @@ ganesha_manage_export(dict_t *dict, char *value, char **op_errstr)
|
||||
}
|
||||
|
||||
if (check_host_list()) {
|
||||
- runner_add_args(&runner, GANESHA_PREFIX "/dbus-send.sh", CONFDIR, value,
|
||||
- volname, NULL);
|
||||
- ret = runner_run(&runner);
|
||||
- if (ret) {
|
||||
- gf_asprintf(op_errstr,
|
||||
- "Dynamic export"
|
||||
- " addition/deletion failed."
|
||||
- " Please see log file for details");
|
||||
- goto out;
|
||||
+ /* Check whether ganesha is running on this node */
|
||||
+ if (manage_service("status")) {
|
||||
+ gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_GANESHA_NOT_RUNNING,
|
||||
+ "Export failed, NFS-Ganesha is not running");
|
||||
+ } else {
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/dbus-send.sh", CONFDIR,
|
||||
+ value, volname, NULL);
|
||||
+ ret = runner_run(&runner);
|
||||
+ if (ret) {
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "Dynamic export"
|
||||
+ " addition/deletion failed."
|
||||
+ " Please see log file for details");
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-messages.h b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
||||
index 9558480..c7b3ca8 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-messages.h
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-messages.h
|
||||
@@ -298,6 +298,6 @@ GLFS_MSGID(
|
||||
GD_MSG_LOCALTIME_LOGGING_ENABLE, GD_MSG_LOCALTIME_LOGGING_DISABLE,
|
||||
GD_MSG_PORTS_EXHAUSTED, GD_MSG_CHANGELOG_GET_FAIL,
|
||||
GD_MSG_MANAGER_FUNCTION_FAILED, GD_MSG_NFS_GANESHA_DISABLED,
|
||||
- GD_MSG_DAEMON_LOG_LEVEL_VOL_OPT_VALIDATE_FAIL);
|
||||
+ GD_MSG_GANESHA_NOT_RUNNING, GD_MSG_DAEMON_LOG_LEVEL_VOL_OPT_VALIDATE_FAIL);
|
||||
|
||||
#endif /* !_GLUSTERD_MESSAGES_H_ */
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,59 @@
|
||||
From eb784a40a4f72e347945e0d66ac1a28389bb076c Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Fri, 28 Apr 2017 17:27:46 +0530
|
||||
Subject: [PATCH 062/124] glusterd/ganesha : perform removal of ganesha.conf on
|
||||
nodes only in ganesha cluster
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I864ecd9391adf80fb1fa6ad2f9891a9ce77135e7
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17138
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167147
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 19 +++++++++----------
|
||||
1 file changed, 9 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index ee8b588..b743216 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -746,17 +746,16 @@ stop_ganesha(char **op_errstr)
|
||||
0,
|
||||
};
|
||||
|
||||
- runinit(&runner);
|
||||
- runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
- "--setup-ganesha-conf-files", CONFDIR, "no", NULL);
|
||||
- ret = runner_run(&runner);
|
||||
- if (ret) {
|
||||
- gf_asprintf(op_errstr,
|
||||
- "removal of symlink ganesha.conf "
|
||||
- "in /etc/ganesha failed");
|
||||
- }
|
||||
-
|
||||
if (check_host_list()) {
|
||||
+ runinit(&runner);
|
||||
+ runner_add_args(&runner, GANESHA_PREFIX "/ganesha-ha.sh",
|
||||
+ "--setup-ganesha-conf-files", CONFDIR, "no", NULL);
|
||||
+ ret = runner_run(&runner);
|
||||
+ if (ret) {
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "removal of symlink ganesha.conf "
|
||||
+ "in /etc/ganesha failed");
|
||||
+ }
|
||||
ret = manage_service("stop");
|
||||
if (ret)
|
||||
gf_asprintf(op_errstr,
|
||||
--
|
||||
1.8.3.1
|
||||
|
144
0063-glusterd-ganesha-update-cache-invalidation-properly-.patch
Normal file
144
0063-glusterd-ganesha-update-cache-invalidation-properly-.patch
Normal file
@ -0,0 +1,144 @@
|
||||
From e5450c639915f4c29ae2ad480e4128b5845254cc Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Tue, 25 Apr 2017 16:36:40 +0530
|
||||
Subject: [PATCH 063/124] glusterd/ganesha : update cache invalidation properly
|
||||
during volume stop
|
||||
|
||||
As per current code, during volume stop for ganesha enabled volume the
|
||||
feature.cache-invalidation was turned "off" in ganesha_manage_export().
|
||||
And it never turn back to "on" when volume is started. It is not desire
|
||||
to modify the volume options during stop, this patch fixes above mentioned
|
||||
issue.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Iea9c62e5cda4f54805b41ea6055cf0c3652a634c
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17111
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167148
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 33 ++++++++++++++-----------
|
||||
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 4 +--
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 2 +-
|
||||
xlators/mgmt/glusterd/src/glusterd.h | 3 ++-
|
||||
4 files changed, 23 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index b743216..1c2ba7a 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -445,7 +445,8 @@ manage_export_config(char *volname, char *value, char **op_errstr)
|
||||
|
||||
/* Exports and unexports a particular volume via NFS-Ganesha */
|
||||
int
|
||||
-ganesha_manage_export(dict_t *dict, char *value, char **op_errstr)
|
||||
+ganesha_manage_export(dict_t *dict, char *value,
|
||||
+ gf_boolean_t update_cache_invalidation, char **op_errstr)
|
||||
{
|
||||
runner_t runner = {
|
||||
0,
|
||||
@@ -558,19 +559,21 @@ ganesha_manage_export(dict_t *dict, char *value, char **op_errstr)
|
||||
}
|
||||
}
|
||||
|
||||
- vol_opts = volinfo->dict;
|
||||
- ret = dict_set_dynstr_with_alloc(vol_opts, "features.cache-invalidation",
|
||||
- value);
|
||||
- if (ret)
|
||||
- gf_asprintf(op_errstr,
|
||||
- "Cache-invalidation could not"
|
||||
- " be set to %s.",
|
||||
- value);
|
||||
- ret = glusterd_store_volinfo(volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
|
||||
- if (ret)
|
||||
- gf_asprintf(op_errstr, "failed to store volinfo for %s",
|
||||
- volinfo->volname);
|
||||
-
|
||||
+ if (update_cache_invalidation) {
|
||||
+ vol_opts = volinfo->dict;
|
||||
+ ret = dict_set_dynstr_with_alloc(vol_opts,
|
||||
+ "features.cache-invalidation", value);
|
||||
+ if (ret)
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "Cache-invalidation could not"
|
||||
+ " be set to %s.",
|
||||
+ value);
|
||||
+ ret = glusterd_store_volinfo(volinfo,
|
||||
+ GLUSTERD_VOLINFO_VER_AC_INCREMENT);
|
||||
+ if (ret)
|
||||
+ gf_asprintf(op_errstr, "failed to store volinfo for %s",
|
||||
+ volinfo->volname);
|
||||
+ }
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
@@ -867,7 +870,7 @@ glusterd_handle_ganesha_op(dict_t *dict, char **op_errstr, char *key,
|
||||
GF_ASSERT(value);
|
||||
|
||||
if (strcmp(key, "ganesha.enable") == 0) {
|
||||
- ret = ganesha_manage_export(dict, value, op_errstr);
|
||||
+ ret = ganesha_manage_export(dict, value, _gf_true, op_errstr);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
}
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
index a630c48..52809a8 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
@@ -1178,7 +1178,7 @@ glusterd_op_stage_set_volume(dict_t *dict, char **op_errstr)
|
||||
|
||||
if ((strcmp(key, "ganesha.enable") == 0) &&
|
||||
(strcmp(value, "off") == 0)) {
|
||||
- ret = ganesha_manage_export(dict, "off", op_errstr);
|
||||
+ ret = ganesha_manage_export(dict, "off", _gf_true, op_errstr);
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
@@ -1691,7 +1691,7 @@ glusterd_op_stage_reset_volume(dict_t *dict, char **op_errstr)
|
||||
*/
|
||||
if (volinfo && (!strcmp(key, "all") || !strcmp(key, "ganesha.enable"))) {
|
||||
if (glusterd_check_ganesha_export(volinfo)) {
|
||||
- ret = ganesha_manage_export(dict, "off", op_errstr);
|
||||
+ ret = ganesha_manage_export(dict, "off", _gf_true, op_errstr);
|
||||
if (ret)
|
||||
gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_NFS_GNS_RESET_FAIL,
|
||||
"Could not reset ganesha.enable key");
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
index 81c668c..de4eccb 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
@@ -1825,7 +1825,7 @@ glusterd_op_stage_stop_volume(dict_t *dict, char **op_errstr)
|
||||
|
||||
ret = glusterd_check_ganesha_export(volinfo);
|
||||
if (ret) {
|
||||
- ret = ganesha_manage_export(dict, "off", op_errstr);
|
||||
+ ret = ganesha_manage_export(dict, "off", _gf_false, op_errstr);
|
||||
if (ret) {
|
||||
gf_msg(THIS->name, GF_LOG_WARNING, 0,
|
||||
GD_MSG_NFS_GNS_UNEXPRT_VOL_FAIL,
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
|
||||
index 5135181..e858ce4 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd.h
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd.h
|
||||
@@ -1368,7 +1368,8 @@ glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr);
|
||||
int
|
||||
glusterd_op_set_ganesha(dict_t *dict, char **errstr);
|
||||
int
|
||||
-ganesha_manage_export(dict_t *dict, char *value, char **op_errstr);
|
||||
+ganesha_manage_export(dict_t *dict, char *value,
|
||||
+ gf_boolean_t update_cache_invalidation, char **op_errstr);
|
||||
gf_boolean_t
|
||||
glusterd_is_ganesha_cluster();
|
||||
gf_boolean_t
|
||||
--
|
||||
1.8.3.1
|
||||
|
52
0064-glusterd-ganesha-return-proper-value-in-pre_setup.patch
Normal file
52
0064-glusterd-ganesha-return-proper-value-in-pre_setup.patch
Normal file
@ -0,0 +1,52 @@
|
||||
From 37bf4daca164cfcb260760ee2fd25d66f920dc7f Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 22 Feb 2017 18:26:30 +0530
|
||||
Subject: [PATCH 064/124] glusterd/ganesha : return proper value in pre_setup()
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I6f7ce82488904c7d418ee078162f26f1ec81e9d9
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16733
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
|
||||
Tested-by: Raghavendra Talur <rtalur@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167149
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index 1c2ba7a..d9fdfc6 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -843,16 +843,15 @@ pre_setup(gf_boolean_t run_setup, char **op_errstr)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
- ret = check_host_list();
|
||||
-
|
||||
- if (ret) {
|
||||
+ if (check_host_list()) {
|
||||
ret = setup_cluster(run_setup);
|
||||
if (ret == -1)
|
||||
gf_asprintf(op_errstr,
|
||||
"Failed to set up HA "
|
||||
"config for NFS-Ganesha. "
|
||||
"Please check the log file for details");
|
||||
- }
|
||||
+ } else
|
||||
+ ret = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,58 @@
|
||||
From 7a47c004b907ed5469b78d559cae6d151e4d626b Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Thu, 23 Feb 2017 16:21:52 +0530
|
||||
Subject: [PATCH 065/124] ganesha/scripts : remove dependency over export
|
||||
configuration file for unexport
|
||||
|
||||
Currently unexport is performed by reading export id from volume configuration
|
||||
file. So unexport has dependency over that file. This patch will unexport with
|
||||
help of dbus command ShowExport. And it will only unexport the share which is
|
||||
added via cli.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I6f3c9b2bb48f0328b18e9cc0e4b9356174afd596
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/16771
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167150
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/dbus-send.sh | 14 ++++++++++++--
|
||||
1 file changed, 12 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/dbus-send.sh b/extras/ganesha/scripts/dbus-send.sh
|
||||
index ec8d948..9d613a0 100755
|
||||
--- a/extras/ganesha/scripts/dbus-send.sh
|
||||
+++ b/extras/ganesha/scripts/dbus-send.sh
|
||||
@@ -41,8 +41,18 @@ string:"EXPORT(Path=/$VOL)"
|
||||
#This function removes an export dynamically(uses the export_id of the export)
|
||||
function dynamic_export_remove()
|
||||
{
|
||||
- removed_id=`cat $GANESHA_DIR/exports/export.$VOL.conf |\
|
||||
-grep Export_Id | awk -F"[=,;]" '{print$2}'| tr -d '[[:space:]]'`
|
||||
+ # Below bash fetch all the export from ShowExport command and search
|
||||
+ # export entry based on path and then get its export entry.
|
||||
+ # There are two possiblities for path, either entire volume will be
|
||||
+ # exported or subdir. It handles both cases. But it remove only first
|
||||
+ # entry from the list based on assumption that entry exported via cli
|
||||
+ # has lowest export id value
|
||||
+ removed_id=$(dbus-send --type=method_call --print-reply --system \
|
||||
+ --dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
|
||||
+ org.ganesha.nfsd.exportmgr.ShowExports | grep -B 1 -we \
|
||||
+ "/"$VOL -e "/"$VOL"/" | grep uint16 | awk '{print $2}' \
|
||||
+ | head -1)
|
||||
+
|
||||
dbus-send --print-reply --system \
|
||||
--dest=org.ganesha.nfsd /org/ganesha/nfsd/ExportMgr \
|
||||
org.ganesha.nfsd.exportmgr.RemoveExport uint16:$removed_id
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From d91eadbbb3e2d02e7297214da394b0e232544386 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Tue, 2 May 2017 14:06:00 +0530
|
||||
Subject: [PATCH 066/124] glusterd/ganesha : add proper NULL check in
|
||||
manage_export_config
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I872b2b6b027f04e61f60ad85588f50e1ef2f988c
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17150
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167151
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index d9fdfc6..fe0bffc 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -435,7 +435,7 @@ manage_export_config(char *volname, char *value, char **op_errstr)
|
||||
CONFDIR, value, volname, NULL);
|
||||
ret = runner_run(&runner);
|
||||
|
||||
- if (ret && !(*op_errstr))
|
||||
+ if (ret && op_errstr)
|
||||
gf_asprintf(op_errstr,
|
||||
"Failed to create"
|
||||
" NFS-Ganesha export config file.");
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,41 @@
|
||||
From 1e5c6bb28894a57e5ca5ed7b4b3b5e05efecf7cd Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 3 May 2017 12:47:14 +0530
|
||||
Subject: [PATCH 067/124] ganesha : minor improvments for commit e91cdf4
|
||||
(17081)
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I3af13e081c5e46cc6f2c132e7a5106ac3355c850
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17152
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167152
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index f040ef6..cedc3fa 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -275,7 +275,7 @@ string:\"EXPORT(Export_Id=$export_id)\" 2>&1")
|
||||
ret=$?
|
||||
logger <<< "${output}"
|
||||
if [ ${ret} -ne 0 ]; then
|
||||
- echo "Refresh-config failed on ${current_host}"
|
||||
+ echo "Refresh-config failed on ${current_host}. Please check logs on ${current_host}"
|
||||
else
|
||||
echo "Refresh-config completed on ${current_host}."
|
||||
fi
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,58 @@
|
||||
From aabc623f99d22a2a9e1d52f3ca7de1dc5b49946d Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Tue, 13 Jun 2017 07:36:50 -0400
|
||||
Subject: [PATCH 068/124] common-ha: surviving ganesha.nfsd not put in grace on
|
||||
fail-over
|
||||
|
||||
Behavior change is seen in new HA in RHEL 7.4 Beta. Up to now clone
|
||||
RAs have been created with "pcs resource create ... meta notify=true".
|
||||
Their notify method is invoked with pre-start or post-stop when one of
|
||||
the clone RAs is started or stopped.
|
||||
|
||||
In 7.4 Beta the notify method we observe that the notify method is not
|
||||
invoked when one of the clones is stopped (or started).
|
||||
|
||||
Ken Gaillot, one of the pacemaker devs, wrote:
|
||||
With the above command, pcs puts the notify=true meta-attribute
|
||||
on the primitive instead of the clone. Looking at the pcs help,
|
||||
that seems expected (--clone notify=true would put it on the clone,
|
||||
meta notify=true puts it on the primitive). If you drop the "meta"
|
||||
above, I think it will work again.
|
||||
|
||||
And indeed his suggested fix does work on both RHEL 7.4 Beta and RHEL
|
||||
7.3 and presumably Fedora.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Idbb539f1366df6d39f77431c357dff4e53a2df6d
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17534
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167153
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index cedc3fa..537c965 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -445,7 +445,7 @@ setup_create_resources()
|
||||
# ganesha-active crm_attribute
|
||||
sleep 5
|
||||
|
||||
- pcs resource create nfs-grace ocf:heartbeat:ganesha_grace --clone meta notify=true
|
||||
+ pcs resource create nfs-grace ocf:heartbeat:ganesha_grace --clone notify=true
|
||||
if [ $? -ne 0 ]; then
|
||||
logger "warning: pcs resource create nfs-grace ocf:heartbeat:ganesha_grace --clone failed"
|
||||
fi
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,96 @@
|
||||
From 916a79ea78db264ceedd4ebdba794e488b82eceb Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Wed, 21 Jun 2017 10:01:20 -0400
|
||||
Subject: [PATCH 069/124] common-ha: enable and disable selinux
|
||||
ganesha_use_fusefs
|
||||
|
||||
Starting in Fedora 26 and RHEL 7.4 there are new targeted policies
|
||||
in selinux which include a tuneable to allow ganesha.nfsd to access
|
||||
the gluster (FUSE) shared_storage volume where ganesha maintains its
|
||||
state.
|
||||
|
||||
N.B. rpm doesn't have a way to distinguish between RHEL 7.3 or 7.4
|
||||
so it can't be enabled for RHEL at this time. /usr/sbin/semanage is
|
||||
in policycoreutils-python in RHEL (versus policycoreutils-python-utils
|
||||
in Fedora.) Once RHEL 7.4 GAs we may also wish to specify the version
|
||||
for RHEL 7 explicitly, i.e.
|
||||
Requires: selinux-policy >= 3.13.1-160.
|
||||
But beware, the corresponding version in Fedora 26 seems to be
|
||||
selinux-policy-3.13.1.258 or so. (Maybe earlier versions, but that's
|
||||
what's currently in the F26 beta.
|
||||
|
||||
release-3.10 is the upstream master branch for glusterfs-ganesha. For
|
||||
release-3.11 and later storhaug needs a similar change, which is
|
||||
tracked by https://github.com/linux-ha-storage/storhaug/issues/11
|
||||
|
||||
Maybe at some point we would want to consider migrating the targeted
|
||||
policies for glusterfs (and nfs-ganesha) from selinux-policy to a
|
||||
glusterfs-selinux (and nfs-ganesha-selinux) subpackage?
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I04a5443edd00636cbded59a2baddfa98095bf7ac
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17597
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
||||
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167154
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index d748ebc..b01c94f 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -466,6 +466,11 @@ Requires: pcs, dbus
|
||||
Requires: cman, pacemaker, corosync
|
||||
%endif
|
||||
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+Requires(post): policycoreutils-python-utils
|
||||
+Requires(postun): policycoreutils-python-utils
|
||||
+%endif
|
||||
+
|
||||
%description ganesha
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
petabytes. It aggregates various storage bricks over Infiniband RDMA
|
||||
@@ -923,6 +928,14 @@ exit 0
|
||||
%systemd_post glustereventsd
|
||||
%endif
|
||||
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%post ganesha
|
||||
+semanage boolean -m ganesha_use_fusefs --on
|
||||
+exit 0
|
||||
+%endif
|
||||
+%endif
|
||||
+
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
%post geo-replication
|
||||
if [ $1 -ge 1 ]; then
|
||||
@@ -1055,6 +1068,14 @@ fi
|
||||
exit 0
|
||||
%endif
|
||||
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%postun ganesha
|
||||
+semanage boolean -m ganesha_use_fusefs --off
|
||||
+exit 0
|
||||
+%endif
|
||||
+%endif
|
||||
+
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%files should be placed here and keep them grouped
|
||||
##
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,76 @@
|
||||
From f410cd9f9b9455373a9612423558d8d0f83cd0fc Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Wed, 12 Jul 2017 07:43:51 -0400
|
||||
Subject: [PATCH 070/124] packaging: glusterfs-ganesha update sometimes fails
|
||||
semanage
|
||||
|
||||
Depending on how dnf orders updates, the updated version of
|
||||
selinux-policy-targeted with ganesha_use_fusefs may not be updated
|
||||
before the glusterfs-ganesha update execute its %post scriptlet
|
||||
containing the `semanage ganesha_use_fusefs ...` command. In such
|
||||
situations the semanage command (silently) fails.
|
||||
|
||||
Use a %trigger (and %triggerun) to run the scriptlet (again) after
|
||||
selinux-policy-targeted with ganesha_use_fusefs has been installed
|
||||
or updated.
|
||||
|
||||
Note: the %triggerun is probably unnecessary, but it doesn't hurt.
|
||||
|
||||
The release-3.10 branch is the "upstream master" for the glusterfs-
|
||||
ganesha subpackage.
|
||||
|
||||
Note: to be merged after https://review.gluster.org/17806
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I1ad06d79fa1711e4abf038baf9f0a5b7bb665934
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17756
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167155
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 22 ++++++++++++++++++++++
|
||||
1 file changed, 22 insertions(+)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index b01c94f..1d99a3d 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -1077,6 +1077,28 @@ exit 0
|
||||
%endif
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
+## All %%trigger should be placed here and keep them sorted
|
||||
+##
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%trigger ganesha -- selinux-policy-targeted
|
||||
+semanage boolean -m ganesha_use_fusefs --on
|
||||
+exit 0
|
||||
+%endif
|
||||
+%endif
|
||||
+
|
||||
+##-----------------------------------------------------------------------------
|
||||
+## All %%triggerun should be placed here and keep them sorted
|
||||
+##
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%triggerun ganesha -- selinux-policy-targeted
|
||||
+semanage boolean -m ganesha_use_fusefs --off
|
||||
+exit 0
|
||||
+%endif
|
||||
+%endif
|
||||
+
|
||||
+##-----------------------------------------------------------------------------
|
||||
## All %%files should be placed here and keep them grouped
|
||||
##
|
||||
%files
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,66 @@
|
||||
From 662c94f3b3173bf78465644e2e42e03efd9ea493 Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Mon, 17 Jul 2017 11:07:40 -0400
|
||||
Subject: [PATCH 071/124] common-ha: enable and disable selinux
|
||||
gluster_use_execmem
|
||||
|
||||
Starting in Fedora 26 and RHEL 7.4 there are new targeted policies in
|
||||
selinux which include a tuneable to allow glusterd->ganesha-ha.sh->pcs
|
||||
to access the pcs config, i.e. gluster-use-execmem.
|
||||
|
||||
Note. rpm doesn't have a way to distinguish between RHEL 7.3 or 7.4
|
||||
or between 3.13.1-X and 3.13.1-Y so it can't be enabled for RHEL at
|
||||
this time.
|
||||
|
||||
/usr/sbin/semanage is in policycoreutils-python in RHEL (versus
|
||||
policycoreutils-python-utils in Fedora.)
|
||||
|
||||
Requires selinux-policy >= 3.13.1-160 in RHEL7. The corresponding
|
||||
version in Fedora 26 seems to be selinux-policy-3.13.1-259 or so. (Maybe
|
||||
earlier versions, but that's what was in F26 when I checked.)
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Ic474b3f7739ff5be1e99d94d00b55caae4ceb5a0
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/17806
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: soumya k <skoduri@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167156
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 537c965..f4400af 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -984,6 +984,9 @@ main()
|
||||
usage
|
||||
exit 0
|
||||
fi
|
||||
+
|
||||
+ semanage boolean -m gluster_use_execmem --on
|
||||
+
|
||||
HA_CONFDIR=${1%/}; shift
|
||||
local ha_conf=${HA_CONFDIR}/ganesha-ha.conf
|
||||
local node=""
|
||||
@@ -1129,6 +1132,9 @@ $HA_CONFDIR/ganesha-ha.conf
|
||||
;;
|
||||
|
||||
esac
|
||||
+
|
||||
+ semanage boolean -m gluster_use_execmem --off
|
||||
+
|
||||
}
|
||||
|
||||
main $*
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,60 @@
|
||||
From c147bbec10fc72b85301ab6a7580f15713b8a974 Mon Sep 17 00:00:00 2001
|
||||
From: Ambarish <asoman@redhat.com>
|
||||
Date: Tue, 12 Sep 2017 18:34:29 +0530
|
||||
Subject: [PATCH 072/124] ganesha-ha: don't set SELinux booleans if SELinux is
|
||||
disabled
|
||||
|
||||
semanage commands inside ganesha-ha.sh script will fail if selinux is
|
||||
Disabled. This patch introduces a check if selinux is enabled or not,
|
||||
and subsequently run semange commands only on selinux enabled systems.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Ibee61cbb1d51a73e6c326b49bac5c7ce06feb310
|
||||
Signed-off-by: Ambarish <asoman@redhat.com>
|
||||
Reviewed-on: https://review.gluster.org/18264
|
||||
Reviewed-by: Niels de Vos <ndevos@redhat.com>
|
||||
Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
|
||||
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167157
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index f4400af..e1d3ea0 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -985,7 +985,9 @@ main()
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- semanage boolean -m gluster_use_execmem --on
|
||||
+ if (selinuxenabled) ;then
|
||||
+ semanage boolean -m gluster_use_execmem --on
|
||||
+ fi
|
||||
|
||||
HA_CONFDIR=${1%/}; shift
|
||||
local ha_conf=${HA_CONFDIR}/ganesha-ha.conf
|
||||
@@ -1133,8 +1135,9 @@ $HA_CONFDIR/ganesha-ha.conf
|
||||
|
||||
esac
|
||||
|
||||
- semanage boolean -m gluster_use_execmem --off
|
||||
-
|
||||
+ if (selinuxenabled) ;then
|
||||
+ semanage boolean -m gluster_use_execmem --off
|
||||
+ fi
|
||||
}
|
||||
|
||||
main $*
|
||||
--
|
||||
1.8.3.1
|
||||
|
45
0073-build-remove-ganesha-dependency-on-selinux-policy.patch
Normal file
45
0073-build-remove-ganesha-dependency-on-selinux-policy.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 52279c877264f41b522f747a986b937e6f054e2a Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Fri, 23 Jun 2017 20:43:16 +0530
|
||||
Subject: [PATCH 073/124] build: remove ganesha dependency on selinux-policy
|
||||
|
||||
Problem:
|
||||
Puddle creation fails with unresolved dependencies
|
||||
unresolved deps:
|
||||
*** selinux-policy >= 0:3.13.1-160
|
||||
|
||||
Solution:
|
||||
We know a priori about the version at RHEL 7.4 is already the desired
|
||||
version. So removing this explicit dependency *should* not be a gluster
|
||||
test blocker.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Id53ac0e41adc14704932787ee0dd3143e6615aaf
|
||||
Signed-off-by: Milind Changire <mchangir@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/109945
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167158
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index 1d99a3d..e55e255 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -467,6 +467,7 @@ Requires: cman, pacemaker, corosync
|
||||
%endif
|
||||
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+Requires: selinux-policy >= 3.13.1-160
|
||||
Requires(post): policycoreutils-python-utils
|
||||
Requires(postun): policycoreutils-python-utils
|
||||
%endif
|
||||
--
|
||||
1.8.3.1
|
||||
|
67
0074-common-ha-enable-pacemaker-at-end-of-setup.patch
Normal file
67
0074-common-ha-enable-pacemaker-at-end-of-setup.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From bfbda24746bf11573b485baf534a5cf1373c6c89 Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Wed, 7 Jun 2017 08:15:48 -0400
|
||||
Subject: [PATCH 074/124] common-ha: enable pacemaker at end of setup
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I3ccd59b67ed364bfc5d27e88321ab5b9f8d471fd
|
||||
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/108431
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167159
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index e1d3ea0..d7dfb87 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -787,6 +787,22 @@ setup_state_volume()
|
||||
}
|
||||
|
||||
|
||||
+enable_pacemaker()
|
||||
+{
|
||||
+ while [[ ${1} ]]; do
|
||||
+ if [ "${SERVICE_MAN}" == "/usr/bin/systemctl" ]; then
|
||||
+${SECRET_PEM} root@${1} ${SERVICE_MAN} enable pacemaker"
|
||||
+ ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
+${SECRET_PEM} root@${1} "${SERVICE_MAN} enable pacemaker"
|
||||
+ else
|
||||
+ ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
+${SECRET_PEM} root@${1} "${SERVICE_MAN} pacemaker enable"
|
||||
+ fi
|
||||
+ shift
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
+
|
||||
addnode_state_volume()
|
||||
{
|
||||
local newnode=${1}; shift
|
||||
@@ -1011,6 +1027,8 @@ main()
|
||||
|
||||
if [ "X${HA_NUM_SERVERS}X" != "X1X" ]; then
|
||||
|
||||
+ determine_service_manager
|
||||
+
|
||||
setup_cluster ${HA_NAME} ${HA_NUM_SERVERS} "${HA_SERVERS}"
|
||||
|
||||
setup_create_resources ${HA_SERVERS}
|
||||
@@ -1019,6 +1037,8 @@ main()
|
||||
|
||||
setup_state_volume ${HA_SERVERS}
|
||||
|
||||
+ enable_pacemaker ${HA_SERVERS}
|
||||
+
|
||||
else
|
||||
|
||||
logger "insufficient servers for HA, aborting"
|
||||
--
|
||||
1.8.3.1
|
||||
|
43
0075-common-ha-Fix-an-incorrect-syntax-during-setup.patch
Normal file
43
0075-common-ha-Fix-an-incorrect-syntax-during-setup.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 0a124b59c662c8f85fe6d184b839cbfe29d5e8ab Mon Sep 17 00:00:00 2001
|
||||
From: Soumya Koduri <skoduri@redhat.com>
|
||||
Date: Wed, 14 Jun 2017 15:20:22 +0530
|
||||
Subject: [PATCH 075/124] common-ha: Fix an incorrect syntax during setup
|
||||
|
||||
There was an invalid line introduced as part of
|
||||
https://code.engineering.redhat.com/gerrit/#/c/108431/
|
||||
|
||||
Detected by rpmdiff -
|
||||
https://errata.devel.redhat.com/rpmdiff/show/175336?result_id=4796901
|
||||
|
||||
This change is to fix the same.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I55cdd7d866cb175fb620dbbd2d02c36eab291a74
|
||||
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/109017
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Tested-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167160
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index d7dfb87..8302c5e 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -791,7 +791,6 @@ enable_pacemaker()
|
||||
{
|
||||
while [[ ${1} ]]; do
|
||||
if [ "${SERVICE_MAN}" == "/usr/bin/systemctl" ]; then
|
||||
-${SECRET_PEM} root@${1} ${SERVICE_MAN} enable pacemaker"
|
||||
ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no -i \
|
||||
${SECRET_PEM} root@${1} "${SERVICE_MAN} enable pacemaker"
|
||||
else
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,44 @@
|
||||
From a917a989232d2c72752f8a2cf27bad90b5acb83d Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Tue, 27 Feb 2018 15:35:30 +0530
|
||||
Subject: [PATCH 076/124] glusterd/ganesha : change voltype for ganesha.enable
|
||||
in volume option table
|
||||
|
||||
The voltype defined for ganesha.enable is features/ganesha. But ganesha xlator
|
||||
was removed from client stack long back. Now it is defined as part of glusterd.
|
||||
So reflecting the same on the volume option table.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Upstream reference :
|
||||
>patch link https://review.gluster.org/19639
|
||||
>Change-Id: Ifedd7493020b77bd54edfdbdd9c799d93b24d0aa
|
||||
>BUG: 1486542
|
||||
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
|
||||
Change-Id: Ifedd7493020b77bd54edfdbdd9c799d93b24d0aa
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167161
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
index 13f423a..c8f6e67 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
@@ -2599,7 +2599,7 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
||||
},
|
||||
{
|
||||
.key = "ganesha.enable",
|
||||
- .voltype = "features/ganesha",
|
||||
+ .voltype = "mgmt/ganesha",
|
||||
.value = "off",
|
||||
.option = "ganesha.enable",
|
||||
.op_version = GD_OP_VERSION_3_7_0,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,73 @@
|
||||
From 1e619b95e3f03e226fef135bfaeeca9b069eb978 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 14 Mar 2018 12:01:30 +0530
|
||||
Subject: [PATCH 077/124] glusterd/ganesha : create/remove export file only
|
||||
from the node which performs ganesha.enable
|
||||
|
||||
As part of volume set ganesha.enable on the ganesha export configuration file will be created/removed
|
||||
using "create-export-ganesha.sh". This performed from the nodes which are part of ganesha cluster.
|
||||
But it is not need since the file is saved in shared storage and consumed by the nodes in the ganesha cluster.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Upstream Reference :
|
||||
>patch link : https://review.gluster.org/#/c/19716/
|
||||
>Change-Id: I2583899972b47d451a90711940293004a3af4690
|
||||
>BUG: 1555195
|
||||
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
|
||||
Change-Id: I2583899972b47d451a90711940293004a3af4690
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167162
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 2 +-
|
||||
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 3 ++-
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 2 +-
|
||||
3 files changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index fe0bffc..ff36476 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -530,7 +530,7 @@ ganesha_manage_export(dict_t *dict, char *value,
|
||||
* Create the export file from the node where ganesha.enable "on"
|
||||
* is executed
|
||||
* */
|
||||
- if (option) {
|
||||
+ if (option && is_origin_glusterd(dict)) {
|
||||
ret = manage_export_config(volname, "on", op_errstr);
|
||||
if (ret) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_EXPORT_FILE_CREATE_FAIL,
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
index 52809a8..10e2d48 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
@@ -2415,7 +2415,8 @@ glusterd_op_reset_volume(dict_t *dict, char **op_rspstr)
|
||||
}
|
||||
|
||||
if (!strcmp(key, "ganesha.enable") || !strcmp(key, "all")) {
|
||||
- if (glusterd_check_ganesha_export(volinfo)) {
|
||||
+ if (glusterd_check_ganesha_export(volinfo) &&
|
||||
+ is_origin_glusterd(dict)) {
|
||||
ret = manage_export_config(volname, "off", op_rspstr);
|
||||
if (ret)
|
||||
gf_msg(this->name, GF_LOG_WARNING, 0, GD_MSG_NFS_GNS_RESET_FAIL,
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
index de4eccb..1ea8ba6 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
|
||||
@@ -2936,7 +2936,7 @@ glusterd_op_delete_volume(dict_t *dict)
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (glusterd_check_ganesha_export(volinfo)) {
|
||||
+ if (glusterd_check_ganesha_export(volinfo) && is_origin_glusterd(dict)) {
|
||||
ret = manage_export_config(volname, "off", NULL);
|
||||
if (ret)
|
||||
gf_msg(this->name, GF_LOG_WARNING, 0, 0,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,40 @@
|
||||
From 5daff948884b1b68ffcbc6ceea3c7affdb9700f4 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Wed, 4 Apr 2018 09:29:43 +0530
|
||||
Subject: [PATCH 078/124] common-ha/scripts : pass the list of servers properly
|
||||
to stop_ganesha_all()
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Upstream Reference :
|
||||
>Change-Id: I6d92623cd9fb450d7a27f5acc61eca0b3cbc9b08
|
||||
>BUG: 1563500
|
||||
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
>Patch link : https://review.gluster.org/#/c/19816/
|
||||
|
||||
Change-Id: I6d92623cd9fb450d7a27f5acc61eca0b3cbc9b08
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167163
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 8302c5e..4e5799f 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -199,7 +199,7 @@ setup_cluster()
|
||||
if [ $? -ne 0 ]; then
|
||||
logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} ${servers} failed"
|
||||
#set up failed stop all ganesha process and clean up symlinks in cluster
|
||||
- stop_ganesha_all ${servers}
|
||||
+ stop_ganesha_all "${servers}"
|
||||
exit 1;
|
||||
fi
|
||||
pcs cluster start --all
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,93 @@
|
||||
From 7e71723a46237f13a570961054b361dc1b34ab25 Mon Sep 17 00:00:00 2001
|
||||
From: Soumya Koduri <skoduri@redhat.com>
|
||||
Date: Thu, 19 Jan 2017 15:01:12 +0530
|
||||
Subject: [PATCH 079/124] common-ha: All statd related files need to be owned
|
||||
by rpcuser
|
||||
|
||||
Statd service is started as rpcuser by default. Hence the
|
||||
files/directories needed by it under '/var/lib/nfs' should be
|
||||
owned by the same user.
|
||||
|
||||
Note: This change is not in mainline as the cluster-bits
|
||||
are being moved to storehaug project -
|
||||
http://review.gluster.org/#/c/16349/
|
||||
http://review.gluster.org/#/c/16333/
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Upstream Reference :
|
||||
> Change-Id: I89fd06aa9700c5ce60026ac825da7c154d9f48fd
|
||||
> BUG: 1414665
|
||||
> Signed-off-by: Soumya Koduri <skoduri@redhat.com>
|
||||
> Reviewed-on: http://review.gluster.org/16433
|
||||
> Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
|
||||
> Smoke: Gluster Build System <jenkins@build.gluster.org>
|
||||
> Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
|
||||
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
|
||||
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
|
||||
|
||||
Change-Id: I89fd06aa9700c5ce60026ac825da7c154d9f48fd
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167164
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 4e5799f..4a98f32 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -756,9 +756,11 @@ setup_state_volume()
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd
|
||||
fi
|
||||
if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then
|
||||
touch ${mnt}/nfs-ganesha/${dirname}/nfs/state
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov
|
||||
@@ -768,9 +770,11 @@ setup_state_volume()
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
|
||||
fi
|
||||
if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then
|
||||
touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state
|
||||
@@ -830,9 +834,11 @@ addnode_state_volume()
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd
|
||||
fi
|
||||
if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/state ]; then
|
||||
touch ${mnt}/nfs-ganesha/${dirname}/nfs/state
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/state
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/ganesha/v4recov
|
||||
@@ -842,9 +848,11 @@ addnode_state_volume()
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm
|
||||
fi
|
||||
if [ ! -d ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak ]; then
|
||||
mkdir ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
|
||||
+ chown rpcuser:rpcuser ${mnt}/nfs-ganesha/${dirname}/nfs/statd/sm.bak
|
||||
fi
|
||||
if [ ! -e ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state ]; then
|
||||
touch ${mnt}/nfs-ganesha/${dirname}/nfs/statd/state
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,62 @@
|
||||
From c5c6720c5186741a3b01a5ba2b34633fc1a00fc5 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Mon, 30 Apr 2018 12:35:01 +0530
|
||||
Subject: [PATCH 080/124] glusterd/ganesha : Skip non-ganesha nodes properly
|
||||
for ganesha HA set up
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Upstream reference:
|
||||
>Patch unlink https://review.gluster.org/#/c/19949/
|
||||
>Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
|
||||
>BUG: 1573078
|
||||
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
|
||||
Change-Id: Iff7bc3ead43e97847219c5a5cc8b967bf0967903
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167165
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 23 +++++++++++++----------
|
||||
1 file changed, 13 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index ff36476..d882105 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -842,17 +842,20 @@ static int
|
||||
pre_setup(gf_boolean_t run_setup, char **op_errstr)
|
||||
{
|
||||
int ret = 0;
|
||||
-
|
||||
- if (check_host_list()) {
|
||||
- ret = setup_cluster(run_setup);
|
||||
- if (ret == -1)
|
||||
+ if (run_setup) {
|
||||
+ if (!check_host_list()) {
|
||||
gf_asprintf(op_errstr,
|
||||
- "Failed to set up HA "
|
||||
- "config for NFS-Ganesha. "
|
||||
- "Please check the log file for details");
|
||||
- } else
|
||||
- ret = -1;
|
||||
-
|
||||
+ "Running nfs-ganesha setup command "
|
||||
+ "from node which is not part of ganesha cluster");
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ ret = setup_cluster(run_setup);
|
||||
+ if (ret == -1)
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "Failed to set up HA "
|
||||
+ "config for NFS-Ganesha. "
|
||||
+ "Please check the log file for details");
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,50 @@
|
||||
From 3cb9ed7e20f59eec036908eed4cfdbc61e990ee2 Mon Sep 17 00:00:00 2001
|
||||
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
|
||||
Date: Tue, 11 Dec 2018 10:09:42 -0500
|
||||
Subject: [PATCH 081/124] ganesha-ha: ensure pacemaker is enabled after setup
|
||||
|
||||
There appears to be a race between `pcs cluster setup ...` early
|
||||
in the setup and the `systemctl enable pacemaker` at the end. The
|
||||
`pcs cluster setup ...` disables pacemaker and corosync. (Now, in
|
||||
pacemaker-1.1.18. Was it always the case?)
|
||||
|
||||
I am not able to reproduce this on my devel system. I speculate that
|
||||
on a busy system that the `pcs cluster setup ...` disable may, under
|
||||
the right conditions, not run until after the setup script enables
|
||||
it. It must require the right alignment of the Sun, Moon, and all
|
||||
the planets.
|
||||
|
||||
Regardless, we'll use the --enable option to `pcs cluster setup ...`
|
||||
to ensure that the cluster (re)starts pacemaker.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I771ff62c37426438b80e61651a8b4ecaf2d549c3
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167166
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
extras/ganesha/scripts/ganesha-ha.sh | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/extras/ganesha/scripts/ganesha-ha.sh b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
index 4a98f32..32af1ca 100644
|
||||
--- a/extras/ganesha/scripts/ganesha-ha.sh
|
||||
+++ b/extras/ganesha/scripts/ganesha-ha.sh
|
||||
@@ -195,9 +195,9 @@ setup_cluster()
|
||||
|
||||
pcs cluster auth ${servers}
|
||||
# pcs cluster setup --name ${name} ${servers}
|
||||
- pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --transport udpu ${servers}
|
||||
+ pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --enable --transport udpu ${servers}
|
||||
if [ $? -ne 0 ]; then
|
||||
- logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} ${servers} failed"
|
||||
+ logger "pcs cluster setup ${RHEL6_PCS_CNAME_OPTION} ${name} --enable --transport udpu ${servers} failed"
|
||||
#set up failed stop all ganesha process and clean up symlinks in cluster
|
||||
stop_ganesha_all "${servers}"
|
||||
exit 1;
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,59 @@
|
||||
From 6d6841a996a52488e8a18606f386bba0a12b4231 Mon Sep 17 00:00:00 2001
|
||||
From: Soumya Koduri <skoduri@redhat.com>
|
||||
Date: Fri, 18 Nov 2016 12:47:06 +0530
|
||||
Subject: [PATCH 082/124] build: Add dependency on netstat for
|
||||
glusterfs-ganesha pkg
|
||||
|
||||
portblock resource-agent needs netstat command but this dependency
|
||||
should have been ideally added to resource-agents package. But the
|
||||
fixes (bug1395594, bug1395596) are going to be available only
|
||||
in the future RHEL 6.9 and RHEL 7.4 releases. Hence as an interim
|
||||
workaround, we agreed to add this dependency for glusterfs-ganesha package.
|
||||
|
||||
label : DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I6ac1003103755d7534dd079c821bbaacd8dd94b8
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167167
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 14 ++++++++++++++
|
||||
1 file changed, 14 insertions(+)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index e55e255..bc27058 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -466,6 +466,12 @@ Requires: pcs, dbus
|
||||
Requires: cman, pacemaker, corosync
|
||||
%endif
|
||||
|
||||
+%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} > 5 )
|
||||
+# we need portblock resource-agent in 3.9.5 and later.
|
||||
+Requires: resource-agents >= 3.9.5
|
||||
+Requires: net-tools
|
||||
+%endif
|
||||
+
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
Requires: selinux-policy >= 3.13.1-160
|
||||
Requires(post): policycoreutils-python-utils
|
||||
@@ -1951,6 +1957,14 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
+* Sun Apr 7 2019 Soumya Koduri <skoduri@redhat.com>
|
||||
+- As an interim fix add dependency on netstat(/net-tools) for glusterfs-ganesha package (#1395574)
|
||||
+
|
||||
+* Sun Apr 7 2019 Soumya Koduri <skoduri@redhat.com>
|
||||
+- Add dependency on portblock resource agent for ganesha package (#1278336)
|
||||
+- Fix incorrect Requires for portblock resource agent (#1278336)
|
||||
+- Update version checks for portblock resource agent on RHEL (#1278336)
|
||||
+
|
||||
* Sat Apr 6 2019 Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
- Adding ganesha ha resources back in gluster repository
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,82 @@
|
||||
From a80743a3053798521ae4dd830adcde8bc7da11b6 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Tue, 20 Feb 2018 11:50:33 +0530
|
||||
Subject: [PATCH 083/124] common-ha: enable and disable selinux
|
||||
ganesha_use_fusefs
|
||||
|
||||
Adding missing changes in a downstream backport(https://code.engineering.redhat.com/gerrit/#/c/109845/)
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I59fd2fc2228ded9547c2d1e08c22f7a10c35f86f
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167244
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 15 ++++++++++-----
|
||||
1 file changed, 10 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index bc27058..2149f86 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -472,11 +472,16 @@ Requires: resource-agents >= 3.9.5
|
||||
Requires: net-tools
|
||||
%endif
|
||||
|
||||
-%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
+%if ( 0%{?rhel} )
|
||||
Requires: selinux-policy >= 3.13.1-160
|
||||
+Requires(post): policycoreutils-python
|
||||
+Requires(postun): policycoreutils-python
|
||||
+%else
|
||||
Requires(post): policycoreutils-python-utils
|
||||
Requires(postun): policycoreutils-python-utils
|
||||
%endif
|
||||
+%endif
|
||||
|
||||
%description ganesha
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
@@ -936,7 +941,7 @@ exit 0
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
-%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%post ganesha
|
||||
semanage boolean -m ganesha_use_fusefs --on
|
||||
exit 0
|
||||
@@ -1076,7 +1081,7 @@ exit 0
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
-%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%postun ganesha
|
||||
semanage boolean -m ganesha_use_fusefs --off
|
||||
exit 0
|
||||
@@ -1087,7 +1092,7 @@ exit 0
|
||||
## All %%trigger should be placed here and keep them sorted
|
||||
##
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
-%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%trigger ganesha -- selinux-policy-targeted
|
||||
semanage boolean -m ganesha_use_fusefs --on
|
||||
exit 0
|
||||
@@ -1098,7 +1103,7 @@ exit 0
|
||||
## All %%triggerun should be placed here and keep them sorted
|
||||
##
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
-%if ( 0%{?fedora} && 0%{?fedora} > 25 )
|
||||
+%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%triggerun ganesha -- selinux-policy-targeted
|
||||
semanage boolean -m ganesha_use_fusefs --off
|
||||
exit 0
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,37 @@
|
||||
From d7bee4a4ad0878003e19711e20994c42c4d2bd9e Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Tue, 9 Apr 2019 16:15:09 +0530
|
||||
Subject: [PATCH 084/124] glusterd: Fix duplicate client_op_version in info
|
||||
file
|
||||
|
||||
This must have been introduced while applying downstream only patches at
|
||||
RHGS 3.5.0 branch.
|
||||
|
||||
Change-Id: I231249cca2a7bce29ef53cf95f9d2377b8203283
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167341
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-store.c | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
index fb52957..351bd9e 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
@@ -1022,11 +1022,6 @@ glusterd_volume_exclude_options_write(int fd, glusterd_volinfo_t *volinfo)
|
||||
goto out;
|
||||
}
|
||||
|
||||
- snprintf(buf, sizeof(buf), "%d", volinfo->client_op_version);
|
||||
- ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_CLIENT_OP_VERSION,
|
||||
- buf);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
if (volinfo->caps) {
|
||||
snprintf(buf, sizeof(buf), "%d", volinfo->caps);
|
||||
ret = gf_store_save_value(fd, GLUSTERD_STORE_KEY_VOL_CAPS, buf);
|
||||
--
|
||||
1.8.3.1
|
||||
|
8976
0085-Revert-all-remove-code-which-is-not-being-considered.patch
Normal file
8976
0085-Revert-all-remove-code-which-is-not-being-considered.patch
Normal file
File diff suppressed because it is too large
Load Diff
3194
0086-Revert-tiering-remove-the-translator-from-build-and-.patch
Normal file
3194
0086-Revert-tiering-remove-the-translator-from-build-and-.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,89 @@
|
||||
From 144f2eb56d1bbecc9c455065755f41ec81974e3e Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Sun, 7 Apr 2019 21:54:07 +0530
|
||||
Subject: [PATCH 087/124] ganesha : fixing minor issues after the backport from
|
||||
3.4
|
||||
|
||||
label : DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Ib0f6d8728d2e33da63ed4baab0bb981a0b06a8e0
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167168
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 20 +++++++++++++++++---
|
||||
xlators/mgmt/glusterd/src/glusterd-ganesha.c | 2 +-
|
||||
2 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index e0607ba..f6b823d 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -883,6 +883,15 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha
|
||||
install -D -p -m 0644 extras/glusterfs-logrotate \
|
||||
%{buildroot}%{_sysconfdir}/logrotate.d/glusterfs
|
||||
|
||||
+# ganesha ghosts
|
||||
+%if ( 0%{!?_without_server:1} )
|
||||
+mkdir -p %{buildroot}%{_sysconfdir}/ganesha
|
||||
+touch %{buildroot}%{_sysconfdir}/ganesha/ganesha-ha.conf
|
||||
+mkdir -p %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/
|
||||
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
|
||||
+touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
|
||||
+%endif
|
||||
+
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/geo-replication
|
||||
touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf
|
||||
@@ -1197,7 +1206,7 @@ exit 0
|
||||
|
||||
%if ( 0%{?_without_server:1} )
|
||||
#exclude ganesha related files
|
||||
-%exclude %{_sysconfdir}/ganesha/*
|
||||
+%exclude %{_sysconfdir}/ganesha/ganesha-ha.conf.sample
|
||||
%exclude %{_libexecdir}/ganesha/*
|
||||
%exclude %{_prefix}/lib/ocf/resource.d/heartbeat/*
|
||||
%endif
|
||||
@@ -1376,9 +1385,15 @@ exit 0
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%files ganesha
|
||||
-%{_sysconfdir}/ganesha/*
|
||||
+%dir %{_libexecdir}/ganesha
|
||||
+%{_sysconfdir}/ganesha/ganesha-ha.conf.sample
|
||||
%{_libexecdir}/ganesha/*
|
||||
%{_prefix}/lib/ocf/resource.d/heartbeat/*
|
||||
+%{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
|
||||
+%ghost %attr(0644,-,-) %config(noreplace) %{_sysconfdir}/ganesha/ganesha-ha.conf
|
||||
+%ghost %dir %attr(0755,-,-) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha
|
||||
+%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
|
||||
+%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_ocf:1} )
|
||||
@@ -1508,7 +1523,6 @@ exit 0
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S29CTDBsetup.sh
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S30samba-start.sh
|
||||
- %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/start/pre
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/post
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-ganesha.c b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
index d882105..0a16925 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-ganesha.c
|
||||
@@ -278,7 +278,7 @@ glusterd_op_stage_set_ganesha(dict_t *dict, char **op_errstr)
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (strcmp(value, "enable")) {
|
||||
+ if (strcmp(value, "enable") == 0) {
|
||||
ret = start_ganesha(op_errstr);
|
||||
if (ret) {
|
||||
gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_NFS_GNS_START_FAIL,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,74 @@
|
||||
From bbcfd7e28b43845bac675dcc486bde09b0953f64 Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Thu, 11 Apr 2019 14:40:11 +0530
|
||||
Subject: [PATCH 088/124] tier: fix failures noticed during tier start and tier
|
||||
restart.
|
||||
|
||||
Problem 1: when tier is started using the tier start command,
|
||||
the out put was skipped during a failure. failures don't have an
|
||||
transaction id. this id was checked and if its missing then
|
||||
it skips.
|
||||
|
||||
fix: had to remove the unnecessary jump for that case.
|
||||
|
||||
problem 2: When tier was restarted, the tierd doesn't come online.
|
||||
This was because, there were a certain values that were supposed
|
||||
to be stored in glusterd (gluster-store.c) which will be used
|
||||
during restart to come to the original state.
|
||||
These values were stored. as they were missing, tierd didn't come
|
||||
online.
|
||||
|
||||
fix: store the value and make it available during the start.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I7df898fa4c3b72fe8ded4adbf573307a59a37e5e
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167653
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sanju Rakonde <srakonde@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
cli/src/cli-rpc-ops.c | 1 -
|
||||
xlators/mgmt/glusterd/src/glusterd-store.c | 13 +++++++++++++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
|
||||
index 736cd18..b167e26 100644
|
||||
--- a/cli/src/cli-rpc-ops.c
|
||||
+++ b/cli/src/cli-rpc-ops.c
|
||||
@@ -1973,7 +1973,6 @@ gf_cli_defrag_volume_cbk(struct rpc_req *req, struct iovec *iov, int count,
|
||||
if (ret) {
|
||||
gf_log("cli", GF_LOG_WARNING, "failed to get %s from dict",
|
||||
GF_REBALANCE_TID_KEY);
|
||||
- goto out;
|
||||
}
|
||||
if (rsp.op_ret && strcmp(rsp.op_errstr, "")) {
|
||||
snprintf(msg, sizeof(msg), "%s", rsp.op_errstr);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
index 351bd9e..4889217 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
|
||||
@@ -3336,6 +3336,19 @@ glusterd_store_update_volinfo(glusterd_volinfo_t *volinfo)
|
||||
break;
|
||||
|
||||
case GF_CLUSTER_TYPE_TIER:
|
||||
+ if (volinfo->tier_info.cold_type ==
|
||||
+ GF_CLUSTER_TYPE_DISPERSE)
|
||||
+ volinfo->tier_info.cold_dist_leaf_count
|
||||
+ = volinfo->disperse_count;
|
||||
+ else
|
||||
+ volinfo->tier_info.cold_dist_leaf_count
|
||||
+ = glusterd_calc_dist_leaf_count (
|
||||
+ volinfo->tier_info.
|
||||
+ cold_replica_count,
|
||||
+ 1);
|
||||
+
|
||||
+ break;
|
||||
+
|
||||
case GF_CLUSTER_TYPE_STRIPE:
|
||||
case GF_CLUSTER_TYPE_STRIPE_REPLICATE:
|
||||
gf_msg(this->name, GF_LOG_CRITICAL, ENOTSUP,
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,85 @@
|
||||
From 8ba7e04362019ea2d0e80e67eb214d53dca58774 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Thu, 17 Nov 2016 12:44:38 +0530
|
||||
Subject: [PATCH 089/124] glusterd/gNFS : On post upgrade to 3.2, disable gNFS
|
||||
for all volumes
|
||||
|
||||
Currently on 3.2 gNFS is dsiabled for newly created volumes or old volumes
|
||||
with default value. There will be volumes which have explicitly turn off
|
||||
nfs.disable option. This change disable gNFS even for that volume as well.
|
||||
|
||||
label : DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I4ddeb23690271034b0bbb3fc50b359350b5eae87
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/90425
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Tested-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167573
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 43 ++++++++++++++++++------------
|
||||
1 file changed, 26 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
index 10e2d48..06ea8cf 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
@@ -2501,26 +2501,35 @@ glusterd_update_volumes_dict(glusterd_volinfo_t *volinfo)
|
||||
GF_VALIDATE_OR_GOTO(this->name, conf, out);
|
||||
|
||||
/* 3.9.0 onwards gNFS will be disabled by default. In case of an upgrade
|
||||
- * from anything below than 3.9.0 to 3.9.x the volume's dictionary will
|
||||
- * not have 'nfs.disable' key set which means the same will not be set
|
||||
- * to on until explicitly done. setnfs.disable to 'on' at op-version
|
||||
- * bump up flow is the ideal way here. The same is also applicable for
|
||||
- * transport.address-family where if the transport type is set to tcp
|
||||
- * then transport.address-family is defaulted to 'inet'.
|
||||
+ * from anything below than 3.9.0 to 3.9.x, the value for nfs.disable is
|
||||
+ * set to 'on' for all volumes even if it is explicitly set to 'off' in
|
||||
+ * previous version. This change is only applicable to downstream code.
|
||||
+ * Setting nfs.disable to 'on' at op-version bump up flow is the ideal
|
||||
+ * way here. The same is also applicable for transport.address-family
|
||||
+ * where if the transport type is set to tcp then transport.address-family
|
||||
+ * is defaulted to 'inet'.
|
||||
*/
|
||||
if (conf->op_version >= GD_OP_VERSION_3_9_0) {
|
||||
- if (dict_get_str_boolean(volinfo->dict, NFS_DISABLE_MAP_KEY, 1)) {
|
||||
- ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
|
||||
- "on");
|
||||
- if (ret) {
|
||||
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
|
||||
- "Failed to set "
|
||||
- "option ' NFS_DISABLE_MAP_KEY ' on "
|
||||
- "volume %s",
|
||||
- volinfo->volname);
|
||||
- goto out;
|
||||
- }
|
||||
+ if (!(dict_get_str_boolean(volinfo->dict, NFS_DISABLE_MAP_KEY, 0))) {
|
||||
+ gf_msg(this->name, GF_LOG_INFO, 0, 0,
|
||||
+ "Gluster NFS is"
|
||||
+ " being deprecated in favor of NFS-Ganesha, "
|
||||
+ "hence setting nfs.disable to 'on' for volume "
|
||||
+ "%s. Please re-enable it if requires",
|
||||
+ volinfo->volname);
|
||||
+ }
|
||||
+
|
||||
+ ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
|
||||
+ "on");
|
||||
+ if (ret) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
|
||||
+ "Failed to set "
|
||||
+ "option ' NFS_DISABLE_MAP_KEY ' on "
|
||||
+ "volume %s",
|
||||
+ volinfo->volname);
|
||||
+ goto out;
|
||||
}
|
||||
+
|
||||
ret = dict_get_strn(volinfo->dict, "transport.address-family",
|
||||
SLEN("transport.address-family"),
|
||||
&address_family_str);
|
||||
--
|
||||
1.8.3.1
|
||||
|
307
0090-Revert-build-conditionally-build-legacy-gNFS-server-.patch
Normal file
307
0090-Revert-build-conditionally-build-legacy-gNFS-server-.patch
Normal file
@ -0,0 +1,307 @@
|
||||
From 19210e4fc551893d1545e719fa26d9ad2d2f5cba Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Mon, 13 Nov 2017 18:41:58 +0530
|
||||
Subject: [PATCH 090/124] Revert "build: conditionally build legacy gNFS server
|
||||
and associated sub-packaging"
|
||||
|
||||
This reverts commit 83abcba6b42f94eb5a6495a634d4055362a9d79d.
|
||||
|
||||
label : DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: If1c02d80b746e0a5b5e2c9a3625909158eff55d5
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167575
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
configure.ac | 13 -------
|
||||
extras/LinuxRPM/Makefile.am | 4 +--
|
||||
glusterfs.spec.in | 54 ++++++----------------------
|
||||
xlators/Makefile.am | 5 +--
|
||||
xlators/mgmt/glusterd/src/glusterd-nfs-svc.c | 27 ++++++--------
|
||||
5 files changed, 24 insertions(+), 79 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 633e850..521671b 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1359,18 +1359,6 @@ if test -n "$LIBAIO"; then
|
||||
BUILD_LIBAIO=yes
|
||||
fi
|
||||
|
||||
-dnl gnfs section
|
||||
-BUILD_GNFS="no"
|
||||
-AC_ARG_ENABLE([gnfs],
|
||||
- AC_HELP_STRING([--enable-gnfs],
|
||||
- [Enable legacy gnfs server xlator.]))
|
||||
-if test "x${with_server}" = "xyes" -a "x$enable_gnfs" = "xyes"; then
|
||||
- BUILD_GNFS="yes"
|
||||
-fi
|
||||
-AM_CONDITIONAL([BUILD_GNFS], [test x$BUILD_GNFS = xyes])
|
||||
-AC_SUBST(BUILD_GNFS)
|
||||
-dnl end gnfs section
|
||||
-
|
||||
dnl Check for userspace-rcu
|
||||
PKG_CHECK_MODULES([URCU], [liburcu-bp], [],
|
||||
[AC_CHECK_HEADERS([urcu-bp.h],
|
||||
@@ -1624,7 +1612,6 @@ echo "EC dynamic support : $EC_DYNAMIC_SUPPORT"
|
||||
echo "Use memory pools : $USE_MEMPOOL"
|
||||
echo "Nanosecond m/atimes : $BUILD_NANOSECOND_TIMESTAMPS"
|
||||
echo "Server components : $with_server"
|
||||
-echo "Legacy gNFS server : $BUILD_GNFS"
|
||||
echo "IPV6 default : $with_ipv6_default"
|
||||
echo "Use TIRPC : $with_libtirpc"
|
||||
echo "With Python : ${PYTHON_VERSION}"
|
||||
diff --git a/extras/LinuxRPM/Makefile.am b/extras/LinuxRPM/Makefile.am
|
||||
index f028537..61fd6da 100644
|
||||
--- a/extras/LinuxRPM/Makefile.am
|
||||
+++ b/extras/LinuxRPM/Makefile.am
|
||||
@@ -18,7 +18,7 @@ autogen:
|
||||
cd ../.. && \
|
||||
rm -rf autom4te.cache && \
|
||||
./autogen.sh && \
|
||||
- ./configure --enable-gnfs --with-previous-options
|
||||
+ ./configure --with-previous-options
|
||||
|
||||
prep:
|
||||
$(MAKE) -C ../.. dist;
|
||||
@@ -36,7 +36,7 @@ srcrpm:
|
||||
mv rpmbuild/SRPMS/* .
|
||||
|
||||
rpms:
|
||||
- rpmbuild --define '_topdir $(shell pwd)/rpmbuild' --with gnfs -bb rpmbuild/SPECS/glusterfs.spec
|
||||
+ rpmbuild --define '_topdir $(shell pwd)/rpmbuild' -bb rpmbuild/SPECS/glusterfs.spec
|
||||
mv rpmbuild/RPMS/*/* .
|
||||
|
||||
# EPEL-5 does not like new versions of rpmbuild and requires some
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index f6b823d..cb17eaa 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -52,11 +52,6 @@
|
||||
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without georeplication
|
||||
%{?_without_georeplication:%global _without_georeplication --disable-georeplication}
|
||||
|
||||
-# gnfs
|
||||
-# if you wish to compile an rpm with the legacy gNFS server xlator
|
||||
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with gnfs
|
||||
-%{?_with_gnfs:%global _with_gnfs --enable-gnfs}
|
||||
-
|
||||
# ipv6default
|
||||
# if you wish to compile an rpm with IPv6 default...
|
||||
# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with ipv6default
|
||||
@@ -153,7 +148,6 @@
|
||||
%if 0%{?_without_server:1}
|
||||
%global _without_events --disable-events
|
||||
%global _without_georeplication --disable-georeplication
|
||||
-%global _with_gnfs %{nil}
|
||||
%global _without_tiering --disable-tiering
|
||||
%global _without_ocf --without-ocf
|
||||
%endif
|
||||
@@ -525,25 +519,6 @@ is in userspace and easily manageable.
|
||||
This package provides support to geo-replication.
|
||||
%endif
|
||||
|
||||
-%if ( 0%{?_with_gnfs:1} )
|
||||
-%package gnfs
|
||||
-Summary: GlusterFS gNFS server
|
||||
-Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
-Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release}
|
||||
-Requires: nfs-utils
|
||||
-
|
||||
-%description gnfs
|
||||
-GlusterFS is a distributed file-system capable of scaling to several
|
||||
-petabytes. It aggregates various storage bricks over Infiniband RDMA
|
||||
-or TCP/IP interconnect into one large parallel network file
|
||||
-system. GlusterFS is one of the most sophisticated file systems in
|
||||
-terms of features and extensibility. It borrows a powerful concept
|
||||
-called Translators from GNU Hurd kernel. Much of the code in GlusterFS
|
||||
-is in user space and easily manageable.
|
||||
-
|
||||
-This package provides the glusterfs legacy gNFS server xlator
|
||||
-%endif
|
||||
-
|
||||
%package libs
|
||||
Summary: GlusterFS common libraries
|
||||
|
||||
@@ -659,6 +634,7 @@ Requires: %{name}-api%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release}
|
||||
# lvm2 for snapshot, and nfs-utils and rpcbind/portmap for gnfs server
|
||||
Requires: lvm2
|
||||
+Requires: nfs-utils
|
||||
%if ( 0%{?_with_systemd:1} )
|
||||
%{?systemd_requires}
|
||||
%else
|
||||
@@ -789,7 +765,6 @@ export LDFLAGS
|
||||
%{?_with_cmocka} \
|
||||
%{?_with_debug} \
|
||||
%{?_with_firewalld} \
|
||||
- %{?_with_gnfs} \
|
||||
%{?_with_tmpfilesdir} \
|
||||
%{?_with_tsan} \
|
||||
%{?_with_valgrind} \
|
||||
@@ -1286,17 +1261,6 @@ exit 0
|
||||
%{_bindir}/fusermount-glusterfs
|
||||
%endif
|
||||
|
||||
-%if ( 0%{?_with_gnfs:1} && 0%{!?_without_server:1} )
|
||||
-%files gnfs
|
||||
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs
|
||||
- %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/server.so
|
||||
-%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
|
||||
-%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
-%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
|
||||
-%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
-%endif
|
||||
-
|
||||
%files thin-arbiter
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
|
||||
@@ -1409,11 +1373,6 @@ exit 0
|
||||
%config(noreplace) %{_sysconfdir}/glusterfs
|
||||
%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
%exclude %{_sysconfdir}/glusterfs/eventsconfig.json
|
||||
-%exclude %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
-%exclude %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
-%if ( 0%{?_with_gnfs:1} )
|
||||
-%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/*
|
||||
-%endif
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/glusterd
|
||||
%if ( 0%{_for_fedora_koji_builds} )
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd
|
||||
@@ -1461,6 +1420,7 @@ exit 0
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/trash.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/upcall.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/leases.so
|
||||
+ %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs*
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt/glusterd.so
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/protocol
|
||||
@@ -1477,6 +1437,7 @@ exit 0
|
||||
|
||||
# /var/lib/glusterd, e.g. hookscripts, etc.
|
||||
%ghost %attr(0644,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/glusterd.info
|
||||
+%ghost %attr(0600,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/options
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/bitd
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/groups
|
||||
@@ -1529,7 +1490,11 @@ exit 0
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S30samba-stop.sh
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh
|
||||
-%config(noreplace) %ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
|
||||
+%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
|
||||
+%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
+%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
|
||||
+%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
+%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/quotad
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/scrub
|
||||
@@ -1995,6 +1960,9 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
+* Sun Apr 7 2019 Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
+- DOWNSTREAM ONLY - revert of 83abcb(gnfs in an optional subpackage)
|
||||
+
|
||||
* Sun Apr 7 2019 Soumya Koduri <skoduri@redhat.com>
|
||||
- As an interim fix add dependency on netstat(/net-tools) for glusterfs-ganesha package (#1395574)
|
||||
|
||||
diff --git a/xlators/Makefile.am b/xlators/Makefile.am
|
||||
index ef20cbb..be54eb3 100644
|
||||
--- a/xlators/Makefile.am
|
||||
+++ b/xlators/Makefile.am
|
||||
@@ -1,12 +1,9 @@
|
||||
-if BUILD_GNFS
|
||||
- GNFS_DIR = nfs
|
||||
-endif
|
||||
|
||||
DIST_SUBDIRS = cluster storage protocol performance debug features \
|
||||
mount nfs mgmt system playground meta
|
||||
|
||||
SUBDIRS = cluster storage protocol performance debug features \
|
||||
- mount ${GNFS_DIR} mgmt system playground meta
|
||||
+ mount nfs mgmt system playground meta
|
||||
|
||||
EXTRA_DIST = xlator.sym
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
|
||||
index 36e9052..3960031 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "glusterd-messages.h"
|
||||
#include "glusterd-svc-helper.h"
|
||||
|
||||
+static char *nfs_svc_name = "nfs";
|
||||
+
|
||||
static gf_boolean_t
|
||||
glusterd_nfssvc_need_start()
|
||||
{
|
||||
@@ -41,6 +43,12 @@ glusterd_nfssvc_need_start()
|
||||
return start;
|
||||
}
|
||||
|
||||
+int
|
||||
+glusterd_nfssvc_init(glusterd_svc_t *svc)
|
||||
+{
|
||||
+ return glusterd_svc_init(svc, nfs_svc_name);
|
||||
+}
|
||||
+
|
||||
static int
|
||||
glusterd_nfssvc_create_volfile()
|
||||
{
|
||||
@@ -49,7 +57,7 @@ glusterd_nfssvc_create_volfile()
|
||||
};
|
||||
glusterd_conf_t *conf = THIS->private;
|
||||
|
||||
- glusterd_svc_build_volfile_path(conf->nfs_svc.name, conf->workdir, filepath,
|
||||
+ glusterd_svc_build_volfile_path(nfs_svc_name, conf->workdir, filepath,
|
||||
sizeof(filepath));
|
||||
return glusterd_create_global_volfile(build_nfs_graph, filepath, NULL);
|
||||
}
|
||||
@@ -60,7 +68,7 @@ glusterd_nfssvc_manager(glusterd_svc_t *svc, void *data, int flags)
|
||||
int ret = -1;
|
||||
|
||||
if (!svc->inited) {
|
||||
- ret = glusterd_svc_init(svc, "nfs");
|
||||
+ ret = glusterd_nfssvc_init(svc);
|
||||
if (ret) {
|
||||
gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_FAILED_INIT_NFSSVC,
|
||||
"Failed to init nfs service");
|
||||
@@ -75,13 +83,6 @@ glusterd_nfssvc_manager(glusterd_svc_t *svc, void *data, int flags)
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
- /* not an error, or a (very) soft error at best */
|
||||
- if (sys_access(XLATORDIR "/nfs/server.so", R_OK) != 0) {
|
||||
- gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_GNFS_XLATOR_NOT_INSTALLED,
|
||||
- "nfs/server.so xlator is not installed");
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
ret = glusterd_nfssvc_create_volfile();
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -155,14 +156,6 @@ glusterd_nfssvc_reconfigure()
|
||||
priv = this->private;
|
||||
GF_VALIDATE_OR_GOTO(this->name, priv, out);
|
||||
|
||||
- /* not an error, or a (very) soft error at best */
|
||||
- if (sys_access(XLATORDIR "/nfs/server.so", R_OK) != 0) {
|
||||
- gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_GNFS_XLATOR_NOT_INSTALLED,
|
||||
- "nfs/server.so xlator is not installed");
|
||||
- ret = 0;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
cds_list_for_each_entry(volinfo, &priv->volumes, vol_list)
|
||||
{
|
||||
if (GLUSTERD_STATUS_STARTED == volinfo->status) {
|
||||
--
|
||||
1.8.3.1
|
||||
|
110
0091-glusterd-gNFS-explicitly-set-nfs.disable-to-off-afte.patch
Normal file
110
0091-glusterd-gNFS-explicitly-set-nfs.disable-to-off-afte.patch
Normal file
@ -0,0 +1,110 @@
|
||||
From ca3a4ebeddfef8c6909ff5388787a91ee52fd675 Mon Sep 17 00:00:00 2001
|
||||
From: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Date: Thu, 15 Dec 2016 17:14:01 +0530
|
||||
Subject: [PATCH 091/124] glusterd/gNFS : explicitly set "nfs.disable" to "off"
|
||||
after 3.2 upgrade
|
||||
|
||||
Gluster NFS was enabled by default for all volumes till 3.1. But 3.2 onwards
|
||||
for the new volumes it will be disabled by setting "nfs.disable" to "on".
|
||||
This take patch will take care of existing volume in such a way that if the
|
||||
option is not configured, it will set "nfs.disable" to "off" during op-version
|
||||
bump up.
|
||||
|
||||
Also this patch removes the warning message while enabling gluster NFS for
|
||||
a volume.
|
||||
|
||||
label : DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: Ib199c3180204f917791b4627c58d846750d18a5a
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/93146
|
||||
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167574
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
cli/src/cli-cmd-parser.c | 16 ---------------
|
||||
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 31 ++++++++++++------------------
|
||||
2 files changed, 12 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
|
||||
index f85958b..92ceb8e 100644
|
||||
--- a/cli/src/cli-cmd-parser.c
|
||||
+++ b/cli/src/cli-cmd-parser.c
|
||||
@@ -1678,22 +1678,6 @@ cli_cmd_volume_set_parse(struct cli_state *state, const char **words,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
- if ((!strcmp(key, "nfs.disable")) && (!strcmp(value, "off"))) {
|
||||
- question =
|
||||
- "Gluster NFS is being deprecated in favor "
|
||||
- "of NFS-Ganesha Enter \"yes\" to continue "
|
||||
- "using Gluster NFS";
|
||||
- answer = cli_cmd_get_confirmation(state, question);
|
||||
- if (GF_ANSWER_NO == answer) {
|
||||
- gf_log("cli", GF_LOG_ERROR,
|
||||
- "Operation "
|
||||
- "cancelled, exiting");
|
||||
- *op_errstr = gf_strdup("Aborted by user.");
|
||||
- ret = -1;
|
||||
- goto out;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if ((strcmp(key, "cluster.brick-multiplex") == 0)) {
|
||||
question =
|
||||
"Brick-multiplexing is supported only for "
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
index 06ea8cf..df8a6ab 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
@@ -2502,32 +2502,25 @@ glusterd_update_volumes_dict(glusterd_volinfo_t *volinfo)
|
||||
|
||||
/* 3.9.0 onwards gNFS will be disabled by default. In case of an upgrade
|
||||
* from anything below than 3.9.0 to 3.9.x, the value for nfs.disable is
|
||||
- * set to 'on' for all volumes even if it is explicitly set to 'off' in
|
||||
+ * set to 'off' for all volumes even if it is explicitly set to 'on' in
|
||||
* previous version. This change is only applicable to downstream code.
|
||||
- * Setting nfs.disable to 'on' at op-version bump up flow is the ideal
|
||||
+ * Setting nfs.disable to 'off' at op-version bump up flow is the ideal
|
||||
* way here. The same is also applicable for transport.address-family
|
||||
* where if the transport type is set to tcp then transport.address-family
|
||||
* is defaulted to 'inet'.
|
||||
*/
|
||||
if (conf->op_version >= GD_OP_VERSION_3_9_0) {
|
||||
if (!(dict_get_str_boolean(volinfo->dict, NFS_DISABLE_MAP_KEY, 0))) {
|
||||
- gf_msg(this->name, GF_LOG_INFO, 0, 0,
|
||||
- "Gluster NFS is"
|
||||
- " being deprecated in favor of NFS-Ganesha, "
|
||||
- "hence setting nfs.disable to 'on' for volume "
|
||||
- "%s. Please re-enable it if requires",
|
||||
- volinfo->volname);
|
||||
- }
|
||||
-
|
||||
- ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
|
||||
- "on");
|
||||
- if (ret) {
|
||||
- gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
|
||||
- "Failed to set "
|
||||
- "option ' NFS_DISABLE_MAP_KEY ' on "
|
||||
- "volume %s",
|
||||
- volinfo->volname);
|
||||
- goto out;
|
||||
+ ret = dict_set_dynstr_with_alloc(volinfo->dict, NFS_DISABLE_MAP_KEY,
|
||||
+ "off");
|
||||
+ if (ret) {
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, errno, GD_MSG_DICT_SET_FAILED,
|
||||
+ "Failed to set "
|
||||
+ "option ' NFS_DISABLE_MAP_KEY ' off "
|
||||
+ "volume %s",
|
||||
+ volinfo->volname);
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
ret = dict_get_strn(volinfo->dict, "transport.address-family",
|
||||
--
|
||||
1.8.3.1
|
||||
|
41
0092-logging-Fix-GF_LOG_OCCASSIONALLY-API.patch
Normal file
41
0092-logging-Fix-GF_LOG_OCCASSIONALLY-API.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From 82d7c8e057b9e22d13ca89f2a75e65a42878b7c3 Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Tue, 2 Apr 2019 10:45:15 +0530
|
||||
Subject: [PATCH 092/124] logging: Fix GF_LOG_OCCASSIONALLY API
|
||||
|
||||
GF_LOG_OCCASSIONALLY doesn't log on the first instance rather at every
|
||||
42nd iterations which isn't effective as in some cases we might not have
|
||||
the code flow hitting the same log for as many as 42 times and we'd end
|
||||
up suppressing the log.
|
||||
|
||||
>upstream fix : https://review.gluster.org/#/c/glusterfs/+/22475/
|
||||
>Fixes: bz#1694925
|
||||
>Change-Id: Iee293281d25a652b64df111d59b13de4efce06fa
|
||||
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
|
||||
BUG: 1691620
|
||||
Change-Id: Iee293281d25a652b64df111d59b13de4efce06fa
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167822
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
libglusterfs/src/glusterfs/logging.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libglusterfs/src/glusterfs/logging.h b/libglusterfs/src/glusterfs/logging.h
|
||||
index c81e19b..3655b1d 100644
|
||||
--- a/libglusterfs/src/glusterfs/logging.h
|
||||
+++ b/libglusterfs/src/glusterfs/logging.h
|
||||
@@ -300,7 +300,7 @@ _gf_log_eh(const char *function, const char *fmt, ...)
|
||||
|
||||
/* Log once in GF_UNIVERSAL_ANSWER times */
|
||||
#define GF_LOG_OCCASIONALLY(var, args...) \
|
||||
- if (!(var++ % GF_UNIVERSAL_ANSWER)) { \
|
||||
+ if (var++ == 0 || !((var - 1) % GF_UNIVERSAL_ANSWER)) { \
|
||||
gf_log(args); \
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
106
0093-glusterd-Change-op-version-of-cache-invalidation-in-.patch
Normal file
106
0093-glusterd-Change-op-version-of-cache-invalidation-in-.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From 713f55b4a5cc582d06a10a1c9a0cdf71a4636a10 Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Mon, 15 Apr 2019 07:57:40 +0530
|
||||
Subject: [PATCH 093/124] glusterd: Change op-version of cache-invalidation in
|
||||
quick-read
|
||||
|
||||
In upstream cache-invalidation option in quick read was introduced with
|
||||
4.0. There are two problems with it:
|
||||
|
||||
1. The key being made duplicate to md-cache xlator, so setting the same
|
||||
option actually enables this feature on both md-cache and quick-read.
|
||||
2. As the op-version tagged to this key was GD_OP_VERSION_4_0_0, with a RHGS
|
||||
3.5 cluster when a md-cache profile is set to a particular volume old
|
||||
client fails to mount which is wrong.
|
||||
|
||||
Solving 1 with out breaking backward compatibility in upstream is quite hard.
|
||||
This patch addresses both the problems in downstream by (a) changing the
|
||||
op-version to GD_OP_VERSION_6_0_0 and (b) renaming this key to
|
||||
quick-read-cache-invalidation. The fix is currently made downstream only till a
|
||||
proper solution is identified in upstream.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
BUG: 1697820
|
||||
Change-Id: I1251424576d6ebbdb2a761400fd20f0aff0c80a2
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167823
|
||||
Reviewed-by: Amar Tumballi Suryanarayan <amarts@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
tests/basic/quick-read-with-upcall.t | 1 +
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 +++---
|
||||
xlators/performance/quick-read/src/quick-read.c | 11 ++++++-----
|
||||
3 files changed, 10 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/tests/basic/quick-read-with-upcall.t b/tests/basic/quick-read-with-upcall.t
|
||||
index 318e93a..647dacf 100644
|
||||
--- a/tests/basic/quick-read-with-upcall.t
|
||||
+++ b/tests/basic/quick-read-with-upcall.t
|
||||
@@ -58,6 +58,7 @@ EXPECT "$D0" cat $M1/test1.txt
|
||||
sleep 60
|
||||
EXPECT "$D1" cat $M1/test1.txt
|
||||
|
||||
+TEST $CLI volume set $V0 performance.quick-read-cache-invalidation on
|
||||
TEST $CLI volume set $V0 performance.cache-invalidation on
|
||||
|
||||
TEST write_to "$M0/test2.txt" "$D0"
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
index a877805..42ca9bb 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
@@ -1690,10 +1690,10 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
||||
.option = "cache-timeout",
|
||||
.op_version = 1,
|
||||
.flags = VOLOPT_FLAG_CLIENT_OPT},
|
||||
- {.key = "performance.cache-invalidation",
|
||||
+ {.key = "performance.quick-read-cache-invalidation",
|
||||
.voltype = "performance/quick-read",
|
||||
- .option = "cache-invalidation",
|
||||
- .op_version = GD_OP_VERSION_4_0_0,
|
||||
+ .option = "quick-read-cache-invalidation",
|
||||
+ .op_version = GD_OP_VERSION_6_0,
|
||||
.flags = VOLOPT_FLAG_CLIENT_OPT},
|
||||
{.key = "performance.ctime-invalidation",
|
||||
.voltype = "performance/quick-read",
|
||||
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
|
||||
index 244e8c8..59553c0 100644
|
||||
--- a/xlators/performance/quick-read/src/quick-read.c
|
||||
+++ b/xlators/performance/quick-read/src/quick-read.c
|
||||
@@ -1218,8 +1218,8 @@ qr_reconfigure(xlator_t *this, dict_t *options)
|
||||
|
||||
GF_OPTION_RECONF("cache-timeout", conf->cache_timeout, options, int32, out);
|
||||
|
||||
- GF_OPTION_RECONF("cache-invalidation", conf->qr_invalidation, options, bool,
|
||||
- out);
|
||||
+ GF_OPTION_RECONF("quick-read-cache-invalidation", conf->qr_invalidation,
|
||||
+ options, bool, out);
|
||||
|
||||
GF_OPTION_RECONF("ctime-invalidation", conf->ctime_invalidation, options,
|
||||
bool, out);
|
||||
@@ -1369,7 +1369,8 @@ qr_init(xlator_t *this)
|
||||
|
||||
GF_OPTION_INIT("cache-timeout", conf->cache_timeout, int32, out);
|
||||
|
||||
- GF_OPTION_INIT("cache-invalidation", conf->qr_invalidation, bool, out);
|
||||
+ GF_OPTION_INIT("quick-read-cache-invalidation", conf->qr_invalidation, bool,
|
||||
+ out);
|
||||
|
||||
GF_OPTION_INIT("cache-size", conf->cache_size, size_uint64, out);
|
||||
if (!check_cache_size_ok(this, conf->cache_size)) {
|
||||
@@ -1615,10 +1616,10 @@ struct volume_options qr_options[] = {
|
||||
.flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
|
||||
},
|
||||
{
|
||||
- .key = {"cache-invalidation"},
|
||||
+ .key = {"quick-read-cache-invalidation"},
|
||||
.type = GF_OPTION_TYPE_BOOL,
|
||||
.default_value = "false",
|
||||
- .op_version = {GD_OP_VERSION_4_0_0},
|
||||
+ .op_version = {GD_OP_VERSION_6_0},
|
||||
.flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC,
|
||||
.description = "When \"on\", invalidates/updates the metadata cache,"
|
||||
" on receiving the cache-invalidation notifications",
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,45 @@
|
||||
From dab37dc78d21762ac3379ad505f8fc4ec996d0f7 Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Tue, 9 Apr 2019 14:58:29 +0530
|
||||
Subject: [PATCH 094/124] glusterd: load ctime in the client graph only if it's
|
||||
not turned off
|
||||
|
||||
Considering ctime is a client side feature, we can't blindly load ctime
|
||||
xlator into the client graph if it's explicitly turned off, that'd
|
||||
result into backward compatibility issue where an old client can't mount
|
||||
a volume configured on a server which is having ctime feature.
|
||||
|
||||
> Upstream patch : https://review.gluster.org/#/c/glusterfs/+/22536/
|
||||
>Fixes: bz#1697907
|
||||
>Change-Id: I6ae7b96d056073aa6746de9a449cf319786d45cc
|
||||
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
|
||||
BUG: 1697820
|
||||
Change-Id: I6ae7b96d056073aa6746de9a449cf319786d45cc
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167815
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Reviewed-by: Amar Tumballi Suryanarayan <amarts@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-volgen.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
index ed24858..012f38e 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
@@ -4358,7 +4358,8 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
}
|
||||
}
|
||||
|
||||
- if (conf->op_version >= GD_OP_VERSION_5_0) {
|
||||
+ if (conf->op_version >= GD_OP_VERSION_5_0 &&
|
||||
+ !dict_get_str_boolean(set_dict, "features.ctime", _gf_false)) {
|
||||
xl = volgen_graph_add(graph, "features/utime", volname);
|
||||
if (!xl) {
|
||||
ret = -1;
|
||||
--
|
||||
1.8.3.1
|
||||
|
204
0095-cluster-afr-Remove-local-from-owners_list-on-failure.patch
Normal file
204
0095-cluster-afr-Remove-local-from-owners_list-on-failure.patch
Normal file
@ -0,0 +1,204 @@
|
||||
From cca418b78ec976aa69eacd56b0e6127ea7e3dd26 Mon Sep 17 00:00:00 2001
|
||||
From: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Date: Thu, 4 Apr 2019 15:31:56 +0530
|
||||
Subject: [PATCH 095/124] cluster/afr: Remove local from owners_list on failure
|
||||
of lock-acquisition
|
||||
|
||||
Backport of https://review.gluster.org/c/glusterfs/+/22515
|
||||
|
||||
When eager-lock lock acquisition fails because of say network failures, the
|
||||
local is not being removed from owners_list, this leads to accumulation of
|
||||
waiting frames and the application will hang because the waiting frames are
|
||||
under the assumption that another transaction is in the process of acquiring
|
||||
lock because owner-list is not empty. Handled this case as well in this patch.
|
||||
Added asserts to make it easier to find these problems in future.
|
||||
|
||||
Change-Id: I3101393265e9827755725b1f2d94a93d8709e923
|
||||
fixes: bz#1688395
|
||||
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167859
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
tests/bugs/replicate/bug-1696599-io-hang.t | 47 ++++++++++++++++++++++++++++++
|
||||
xlators/cluster/afr/src/afr-common.c | 8 ++---
|
||||
xlators/cluster/afr/src/afr-lk-common.c | 1 -
|
||||
xlators/cluster/afr/src/afr-transaction.c | 19 +++++-------
|
||||
xlators/cluster/afr/src/afr.h | 4 +--
|
||||
5 files changed, 61 insertions(+), 18 deletions(-)
|
||||
create mode 100755 tests/bugs/replicate/bug-1696599-io-hang.t
|
||||
|
||||
diff --git a/tests/bugs/replicate/bug-1696599-io-hang.t b/tests/bugs/replicate/bug-1696599-io-hang.t
|
||||
new file mode 100755
|
||||
index 0000000..869cdb9
|
||||
--- /dev/null
|
||||
+++ b/tests/bugs/replicate/bug-1696599-io-hang.t
|
||||
@@ -0,0 +1,47 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+. $(dirname $0)/../../fileio.rc
|
||||
+
|
||||
+#Tests that local structures in afr are removed from granted/blocked list of
|
||||
+#locks when inodelk fails on all bricks
|
||||
+
|
||||
+cleanup;
|
||||
+
|
||||
+TEST glusterd
|
||||
+TEST pidof glusterd
|
||||
+
|
||||
+TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1..3}
|
||||
+TEST $CLI volume set $V0 performance.quick-read off
|
||||
+TEST $CLI volume set $V0 performance.write-behind off
|
||||
+TEST $CLI volume set $V0 performance.io-cache off
|
||||
+TEST $CLI volume set $V0 performance.stat-prefetch off
|
||||
+TEST $CLI volume set $V0 performance.client-io-threads off
|
||||
+TEST $CLI volume set $V0 delay-gen locks
|
||||
+TEST $CLI volume set $V0 delay-gen.delay-duration 5000000
|
||||
+TEST $CLI volume set $V0 delay-gen.delay-percentage 100
|
||||
+TEST $CLI volume set $V0 delay-gen.enable finodelk
|
||||
+
|
||||
+TEST $CLI volume start $V0
|
||||
+EXPECT 'Started' volinfo_field $V0 'Status'
|
||||
+
|
||||
+TEST $GFS -s $H0 --volfile-id $V0 $M0
|
||||
+TEST touch $M0/file
|
||||
+#Trigger write and stop bricks so inodelks fail on all bricks leading to
|
||||
+#lock failure condition
|
||||
+echo abc >> $M0/file &
|
||||
+
|
||||
+TEST $CLI volume stop $V0
|
||||
+TEST $CLI volume reset $V0 delay-gen
|
||||
+wait
|
||||
+TEST $CLI volume start $V0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_meta $M0 $V0-replicate-0 0
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_meta $M0 $V0-replicate-0 1
|
||||
+EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status_meta $M0 $V0-replicate-0 2
|
||||
+#Test that only one write succeeded, this tests that delay-gen worked as
|
||||
+#expected
|
||||
+echo abc >> $M0/file
|
||||
+EXPECT "abc" cat $M0/file
|
||||
+
|
||||
+cleanup;
|
||||
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
|
||||
index 45b96e3..47a5d3a 100644
|
||||
--- a/xlators/cluster/afr/src/afr-common.c
|
||||
+++ b/xlators/cluster/afr/src/afr-common.c
|
||||
@@ -5763,6 +5763,10 @@ afr_transaction_local_init(afr_local_t *local, xlator_t *this)
|
||||
afr_private_t *priv = NULL;
|
||||
|
||||
priv = this->private;
|
||||
+ INIT_LIST_HEAD(&local->transaction.wait_list);
|
||||
+ INIT_LIST_HEAD(&local->transaction.owner_list);
|
||||
+ INIT_LIST_HEAD(&local->ta_waitq);
|
||||
+ INIT_LIST_HEAD(&local->ta_onwireq);
|
||||
ret = afr_internal_lock_init(&local->internal_lock, priv->child_count);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
@@ -5800,10 +5804,6 @@ afr_transaction_local_init(afr_local_t *local, xlator_t *this)
|
||||
goto out;
|
||||
|
||||
ret = 0;
|
||||
- INIT_LIST_HEAD(&local->transaction.wait_list);
|
||||
- INIT_LIST_HEAD(&local->transaction.owner_list);
|
||||
- INIT_LIST_HEAD(&local->ta_waitq);
|
||||
- INIT_LIST_HEAD(&local->ta_onwireq);
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c
|
||||
index 4091671..bc8eabe 100644
|
||||
--- a/xlators/cluster/afr/src/afr-lk-common.c
|
||||
+++ b/xlators/cluster/afr/src/afr-lk-common.c
|
||||
@@ -397,7 +397,6 @@ afr_unlock_now(call_frame_t *frame, xlator_t *this)
|
||||
int_lock->lk_call_count = call_count;
|
||||
|
||||
if (!call_count) {
|
||||
- GF_ASSERT(!local->transaction.do_eager_unlock);
|
||||
gf_msg_trace(this->name, 0, "No internal locks unlocked");
|
||||
int_lock->lock_cbk(frame, this);
|
||||
goto out;
|
||||
diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c
|
||||
index 229820b..15f3a7e 100644
|
||||
--- a/xlators/cluster/afr/src/afr-transaction.c
|
||||
+++ b/xlators/cluster/afr/src/afr-transaction.c
|
||||
@@ -372,6 +372,8 @@ afr_transaction_done(call_frame_t *frame, xlator_t *this)
|
||||
}
|
||||
local->transaction.unwind(frame, this);
|
||||
|
||||
+ GF_ASSERT(list_empty(&local->transaction.owner_list));
|
||||
+ GF_ASSERT(list_empty(&local->transaction.wait_list));
|
||||
AFR_STACK_DESTROY(frame);
|
||||
|
||||
return 0;
|
||||
@@ -393,7 +395,7 @@ afr_lock_fail_shared(afr_local_t *local, struct list_head *list)
|
||||
}
|
||||
|
||||
static void
|
||||
-afr_handle_lock_acquire_failure(afr_local_t *local, gf_boolean_t locked)
|
||||
+afr_handle_lock_acquire_failure(afr_local_t *local)
|
||||
{
|
||||
struct list_head shared;
|
||||
afr_lock_t *lock = NULL;
|
||||
@@ -414,13 +416,8 @@ afr_handle_lock_acquire_failure(afr_local_t *local, gf_boolean_t locked)
|
||||
afr_lock_fail_shared(local, &shared);
|
||||
local->transaction.do_eager_unlock = _gf_true;
|
||||
out:
|
||||
- if (locked) {
|
||||
- local->internal_lock.lock_cbk = afr_transaction_done;
|
||||
- afr_unlock(local->transaction.frame, local->transaction.frame->this);
|
||||
- } else {
|
||||
- afr_transaction_done(local->transaction.frame,
|
||||
- local->transaction.frame->this);
|
||||
- }
|
||||
+ local->internal_lock.lock_cbk = afr_transaction_done;
|
||||
+ afr_unlock(local->transaction.frame, local->transaction.frame->this);
|
||||
}
|
||||
|
||||
call_frame_t *
|
||||
@@ -619,7 +616,7 @@ afr_transaction_perform_fop(call_frame_t *frame, xlator_t *this)
|
||||
failure_count = AFR_COUNT(local->transaction.failed_subvols,
|
||||
priv->child_count);
|
||||
if (failure_count == priv->child_count) {
|
||||
- afr_handle_lock_acquire_failure(local, _gf_true);
|
||||
+ afr_handle_lock_acquire_failure(local);
|
||||
return 0;
|
||||
} else {
|
||||
lock = &local->inode_ctx->lock[local->transaction.type];
|
||||
@@ -2092,7 +2089,7 @@ err:
|
||||
local->op_ret = -1;
|
||||
local->op_errno = op_errno;
|
||||
|
||||
- afr_handle_lock_acquire_failure(local, _gf_true);
|
||||
+ afr_handle_lock_acquire_failure(local);
|
||||
|
||||
if (xdata_req)
|
||||
dict_unref(xdata_req);
|
||||
@@ -2361,7 +2358,7 @@ afr_internal_lock_finish(call_frame_t *frame, xlator_t *this)
|
||||
} else {
|
||||
lock = &local->inode_ctx->lock[local->transaction.type];
|
||||
if (local->internal_lock.lock_op_ret < 0) {
|
||||
- afr_handle_lock_acquire_failure(local, _gf_false);
|
||||
+ afr_handle_lock_acquire_failure(local);
|
||||
} else {
|
||||
lock->event_generation = local->event_generation;
|
||||
afr_changelog_pre_op(frame, this);
|
||||
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
|
||||
index 2cc3797..e731cfa 100644
|
||||
--- a/xlators/cluster/afr/src/afr.h
|
||||
+++ b/xlators/cluster/afr/src/afr.h
|
||||
@@ -1091,8 +1091,8 @@ afr_cleanup_fd_ctx(xlator_t *this, fd_t *fd);
|
||||
#define AFR_FRAME_INIT(frame, op_errno) \
|
||||
({ \
|
||||
frame->local = mem_get0(THIS->local_pool); \
|
||||
- if (afr_local_init(frame->local, THIS->private, &op_errno)) { \
|
||||
- afr_local_cleanup(frame->local, THIS); \
|
||||
+ if (afr_local_init(frame->local, frame->this->private, &op_errno)) { \
|
||||
+ afr_local_cleanup(frame->local, frame->this); \
|
||||
mem_put(frame->local); \
|
||||
frame->local = NULL; \
|
||||
}; \
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,94 @@
|
||||
From 3bcffadcd77eebe6b4f7e5015ad41ec7c1d1ec3e Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Thu, 11 Apr 2019 20:38:53 +0530
|
||||
Subject: [PATCH 096/124] core: Brick is not able to detach successfully in
|
||||
brick_mux environment
|
||||
|
||||
Problem: In brick_mux environment, while volumes are stopped in a
|
||||
loop bricks are not detached successfully. Brick's are not
|
||||
detached because xprtrefcnt has not become 0 for detached brick.
|
||||
At the time of initiating brick detach process server_notify
|
||||
saves xprtrefcnt on detach brick and once counter has become
|
||||
0 then server_rpc_notify spawn a server_graph_janitor_threads
|
||||
for cleanup brick resources.xprtrefcnt has not become 0 because
|
||||
socket framework is not working due to assigning 0 as a fd for socket.
|
||||
In commit dc25d2c1eeace91669052e3cecc083896e7329b2
|
||||
there was a change in changelog fini to close htime_fd if htime_fd is not
|
||||
negative, by default htime_fd is 0 so it close 0 also.
|
||||
|
||||
Solution: Initialize htime_fd to -1 after just allocate changelog_priv
|
||||
by GF_CALLOC
|
||||
|
||||
> Fixes: bz#1699025
|
||||
> Change-Id: I5f7ca62a0eb1c0510c3e9b880d6ab8af8d736a25
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> (Cherry picked from commit b777d83001d8006420b6c7d2d88fe68950aa7e00)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22549/
|
||||
|
||||
Fixes: bz#1698919
|
||||
Change-Id: Ib5b74aa0818235625f8aac7c23d4daa599da3fd1
|
||||
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167826
|
||||
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
.../bug-1699025-brick-mux-detach-brick-fd-issue.t | 33 ++++++++++++++++++++++
|
||||
xlators/features/changelog/src/changelog.c | 1 +
|
||||
2 files changed, 34 insertions(+)
|
||||
create mode 100644 tests/bugs/core/bug-1699025-brick-mux-detach-brick-fd-issue.t
|
||||
|
||||
diff --git a/tests/bugs/core/bug-1699025-brick-mux-detach-brick-fd-issue.t b/tests/bugs/core/bug-1699025-brick-mux-detach-brick-fd-issue.t
|
||||
new file mode 100644
|
||||
index 0000000..1acbaa8
|
||||
--- /dev/null
|
||||
+++ b/tests/bugs/core/bug-1699025-brick-mux-detach-brick-fd-issue.t
|
||||
@@ -0,0 +1,33 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+. $(dirname $0)/../../cluster.rc
|
||||
+
|
||||
+function count_brick_processes {
|
||||
+ pgrep glusterfsd | wc -l
|
||||
+}
|
||||
+
|
||||
+cleanup
|
||||
+
|
||||
+#bug-1444596 - validating brick mux
|
||||
+
|
||||
+TEST glusterd
|
||||
+TEST $CLI volume create $V0 $H0:$B0/brick{0,1}
|
||||
+TEST $CLI volume create $V1 $H0:$B0/brick{2,3}
|
||||
+
|
||||
+TEST $CLI volume set all cluster.brick-multiplex on
|
||||
+
|
||||
+TEST $CLI volume start $V0
|
||||
+TEST $CLI volume start $V1
|
||||
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 4 online_brick_count
|
||||
+EXPECT 1 count_brick_processes
|
||||
+
|
||||
+TEST $CLI volume stop $V1
|
||||
+# At the time initialize brick daemon it always keeps open
|
||||
+# standard fd's (0, 1 , 2) so after stop 1 volume fd's should
|
||||
+# be open
|
||||
+nofds=$(ls -lrth /proc/`pgrep glusterfsd`/fd | grep dev/null | wc -l)
|
||||
+TEST [ $((nofds)) -eq 3 ]
|
||||
+
|
||||
+cleanup
|
||||
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
|
||||
index 1f22a97..d9025f3 100644
|
||||
--- a/xlators/features/changelog/src/changelog.c
|
||||
+++ b/xlators/features/changelog/src/changelog.c
|
||||
@@ -2740,6 +2740,7 @@ init(xlator_t *this)
|
||||
GF_ATOMIC_INIT(priv->clntcnt, 0);
|
||||
GF_ATOMIC_INIT(priv->xprtcnt, 0);
|
||||
INIT_LIST_HEAD(&priv->xprt_list);
|
||||
+ priv->htime_fd = -1;
|
||||
|
||||
ret = changelog_init_options(this, priv);
|
||||
if (ret)
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,61 @@
|
||||
From 302f3f87c9aa00c17ec3b49a81c8a4441d2bdf5f Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Mon, 15 Apr 2019 10:01:40 +0530
|
||||
Subject: [PATCH 097/124] glusterd/tier: while doing an attach tier, the self
|
||||
heal daemon is not getting started
|
||||
|
||||
Problem: on a replicated volume, if attach tier is done,
|
||||
The shd will be restarted. But here the restart fails because of the
|
||||
graph not getting generated properly. The dict which is used for graph
|
||||
creation doesn't get the values copied properly in prepare_shd_volume_options()
|
||||
glusterd_prepare_shd_volume_options_for_tier() fails and skips the copy.
|
||||
|
||||
This patch reverts the changes back to the way it was in 3.4 and
|
||||
help in fixing the issue. Using the old dict_set_str works.
|
||||
|
||||
label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I21534ca177511e018ba76886e899b3b1a4ac4716
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167825
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-volgen.c | 19 +++++++++++++------
|
||||
1 file changed, 13 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
index 012f38e..1f53beb 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
@@ -4895,14 +4895,21 @@ glusterd_prepare_shd_volume_options_for_tier(glusterd_volinfo_t *volinfo,
|
||||
dict_t *set_dict)
|
||||
{
|
||||
int ret = -1;
|
||||
+ char *key = NULL;
|
||||
|
||||
- ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.cold_type);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ key = volgen_get_shd_key (volinfo->tier_info.cold_type);
|
||||
+ if (key) {
|
||||
+ ret = dict_set_str (set_dict, key, "enable");
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- ret = volgen_set_shd_key_enable(set_dict, volinfo->tier_info.hot_type);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ key = volgen_get_shd_key (volinfo->tier_info.hot_type);
|
||||
+ if (key) {
|
||||
+ ret = dict_set_str (set_dict, key, "enable");
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
4617
0098-mgmt-shd-Implement-multiplexing-in-self-heal-daemon.patch
Normal file
4617
0098-mgmt-shd-Implement-multiplexing-in-self-heal-daemon.patch
Normal file
File diff suppressed because it is too large
Load Diff
119
0099-client-fini-return-fini-after-rpc-cleanup.patch
Normal file
119
0099-client-fini-return-fini-after-rpc-cleanup.patch
Normal file
@ -0,0 +1,119 @@
|
||||
From d79cb2cdff6fe8d962c9ac095a7541ddf500302b Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Mon, 1 Apr 2019 14:44:20 +0530
|
||||
Subject: [PATCH 099/124] client/fini: return fini after rpc cleanup
|
||||
|
||||
There is a race condition in rpc_transport later
|
||||
and client fini.
|
||||
|
||||
Sequence of events to happen the race condition
|
||||
1) When we want to destroy a graph, we send a parent down
|
||||
event first
|
||||
2) Once parent down received on a client xlator, we will
|
||||
initiates a rpc disconnect
|
||||
3) This will in turn generates a child down event.
|
||||
4) When we process child down, we first do fini for
|
||||
Every xlator
|
||||
5) On successful return of fini, we delete the graph
|
||||
|
||||
Here after the step 5, there is a chance that the fini
|
||||
on client might not be finished. Because an rpc_tranpsort
|
||||
ref can race with the above sequence.
|
||||
|
||||
So we have to wait till all rpc's are successfully freed
|
||||
before returning the fini from client
|
||||
|
||||
Backport of: https://review.gluster.org/#/c/glusterfs/+/22468/
|
||||
|
||||
>Change-Id: I20145662d71fb837e448a4d3210d1fcb2855f2d4
|
||||
>fixes: bz#1659708
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: I848bcfb9443467caed32bae0717244ab01b407fc
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167831
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/protocol/client/src/client.c | 25 ++++++++++++++++++++-----
|
||||
xlators/protocol/client/src/client.h | 6 ++++++
|
||||
2 files changed, 26 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
|
||||
index 19f5175..a372807 100644
|
||||
--- a/xlators/protocol/client/src/client.c
|
||||
+++ b/xlators/protocol/client/src/client.c
|
||||
@@ -49,11 +49,12 @@ client_fini_complete(xlator_t *this)
|
||||
if (!conf->destroy)
|
||||
return 0;
|
||||
|
||||
- this->private = NULL;
|
||||
-
|
||||
- pthread_spin_destroy(&conf->fd_lock);
|
||||
- pthread_mutex_destroy(&conf->lock);
|
||||
- GF_FREE(conf);
|
||||
+ pthread_mutex_lock(&conf->lock);
|
||||
+ {
|
||||
+ conf->fini_completed = _gf_true;
|
||||
+ pthread_cond_broadcast(&conf->fini_complete_cond);
|
||||
+ }
|
||||
+ pthread_mutex_unlock(&conf->lock);
|
||||
|
||||
out:
|
||||
return 0;
|
||||
@@ -2721,6 +2722,7 @@ init(xlator_t *this)
|
||||
goto out;
|
||||
|
||||
pthread_mutex_init(&conf->lock, NULL);
|
||||
+ pthread_cond_init(&conf->fini_complete_cond, NULL);
|
||||
pthread_spin_init(&conf->fd_lock, 0);
|
||||
INIT_LIST_HEAD(&conf->saved_fds);
|
||||
|
||||
@@ -2779,6 +2781,7 @@ fini(xlator_t *this)
|
||||
if (!conf)
|
||||
return;
|
||||
|
||||
+ conf->fini_completed = _gf_false;
|
||||
conf->destroy = 1;
|
||||
if (conf->rpc) {
|
||||
/* cleanup the saved-frames before last unref */
|
||||
@@ -2786,6 +2789,18 @@ fini(xlator_t *this)
|
||||
rpc_clnt_unref(conf->rpc);
|
||||
}
|
||||
|
||||
+ pthread_mutex_lock(&conf->lock);
|
||||
+ {
|
||||
+ while (!conf->fini_completed)
|
||||
+ pthread_cond_wait(&conf->fini_complete_cond, &conf->lock);
|
||||
+ }
|
||||
+ pthread_mutex_unlock(&conf->lock);
|
||||
+
|
||||
+ pthread_spin_destroy(&conf->fd_lock);
|
||||
+ pthread_mutex_destroy(&conf->lock);
|
||||
+ pthread_cond_destroy(&conf->fini_complete_cond);
|
||||
+ GF_FREE(conf);
|
||||
+
|
||||
/* Saved Fds */
|
||||
/* TODO: */
|
||||
|
||||
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
|
||||
index f12fa61..8dcd72f 100644
|
||||
--- a/xlators/protocol/client/src/client.h
|
||||
+++ b/xlators/protocol/client/src/client.h
|
||||
@@ -235,6 +235,12 @@ typedef struct clnt_conf {
|
||||
* up, disconnects can be
|
||||
* logged
|
||||
*/
|
||||
+
|
||||
+ gf_boolean_t old_protocol; /* used only for old-protocol testing */
|
||||
+ pthread_cond_t fini_complete_cond; /* Used to wait till we finsh the fini
|
||||
+ compltely, ie client_fini_complete
|
||||
+ to return*/
|
||||
+ gf_boolean_t fini_completed;
|
||||
} clnt_conf_t;
|
||||
|
||||
typedef struct _client_fd_ctx {
|
||||
--
|
||||
1.8.3.1
|
||||
|
179
0100-clnt-rpc-ref-leak-during-disconnect.patch
Normal file
179
0100-clnt-rpc-ref-leak-during-disconnect.patch
Normal file
@ -0,0 +1,179 @@
|
||||
From 4d95e271a9042bf2d789a4d900ad263b6ea47681 Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Wed, 23 Jan 2019 21:55:01 +0530
|
||||
Subject: [PATCH 100/124] clnt/rpc: ref leak during disconnect.
|
||||
|
||||
During disconnect cleanup, we are not cancelling reconnect
|
||||
timer, which causes a ref leak each time when a disconnect
|
||||
happen.
|
||||
|
||||
Backport of: https://review.gluster.org/#/c/glusterfs/+/22087/
|
||||
|
||||
>Change-Id: I9d05d1f368d080e04836bf6a0bb018bf8f7b5b8a
|
||||
>updates: bz#1659708
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: I5a2dbb17e663a4809bb4c435cacadbf0ab694a76
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167844
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
libglusterfs/src/timer.c | 16 +++++++----
|
||||
rpc/rpc-lib/src/rpc-clnt.c | 11 +++++++-
|
||||
.../mgmt/glusterd/src/glusterd-snapshot-utils.c | 32 ++++++++++++++++++----
|
||||
3 files changed, 47 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/libglusterfs/src/timer.c b/libglusterfs/src/timer.c
|
||||
index d882543..2643c07 100644
|
||||
--- a/libglusterfs/src/timer.c
|
||||
+++ b/libglusterfs/src/timer.c
|
||||
@@ -75,13 +75,13 @@ gf_timer_call_cancel(glusterfs_ctx_t *ctx, gf_timer_t *event)
|
||||
if (ctx == NULL || event == NULL) {
|
||||
gf_msg_callingfn("timer", GF_LOG_ERROR, EINVAL, LG_MSG_INVALID_ARG,
|
||||
"invalid argument");
|
||||
- return 0;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (ctx->cleanup_started) {
|
||||
gf_msg_callingfn("timer", GF_LOG_INFO, 0, LG_MSG_CTX_CLEANUP_STARTED,
|
||||
"ctx cleanup started");
|
||||
- return 0;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
LOCK(&ctx->lock);
|
||||
@@ -93,10 +93,9 @@ gf_timer_call_cancel(glusterfs_ctx_t *ctx, gf_timer_t *event)
|
||||
if (!reg) {
|
||||
/* This can happen when cleanup may have just started and
|
||||
* gf_timer_registry_destroy() sets ctx->timer to NULL.
|
||||
- * Just bail out as success as gf_timer_proc() takes
|
||||
- * care of cleaning up the events.
|
||||
+ * gf_timer_proc() takes care of cleaning up the events.
|
||||
*/
|
||||
- return 0;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
LOCK(®->lock);
|
||||
@@ -203,6 +202,13 @@ gf_timer_proc(void *data)
|
||||
list_for_each_entry_safe(event, tmp, ®->active, list)
|
||||
{
|
||||
list_del(&event->list);
|
||||
+ /* TODO Possible resource leak
|
||||
+ * Before freeing the event, we need to call the respective
|
||||
+ * event functions and free any resources.
|
||||
+ * For example, In case of rpc_clnt_reconnect, we need to
|
||||
+ * unref rpc object which was taken when added to timer
|
||||
+ * wheel.
|
||||
+ */
|
||||
GF_FREE(event);
|
||||
}
|
||||
}
|
||||
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
|
||||
index 3f7bb3c..6f47515 100644
|
||||
--- a/rpc/rpc-lib/src/rpc-clnt.c
|
||||
+++ b/rpc/rpc-lib/src/rpc-clnt.c
|
||||
@@ -495,6 +495,7 @@ rpc_clnt_connection_cleanup(rpc_clnt_connection_t *conn)
|
||||
int unref = 0;
|
||||
int ret = 0;
|
||||
gf_boolean_t timer_unref = _gf_false;
|
||||
+ gf_boolean_t reconnect_unref = _gf_false;
|
||||
|
||||
if (!conn) {
|
||||
goto out;
|
||||
@@ -514,6 +515,12 @@ rpc_clnt_connection_cleanup(rpc_clnt_connection_t *conn)
|
||||
timer_unref = _gf_true;
|
||||
conn->timer = NULL;
|
||||
}
|
||||
+ if (conn->reconnect) {
|
||||
+ ret = gf_timer_call_cancel(clnt->ctx, conn->reconnect);
|
||||
+ if (!ret)
|
||||
+ reconnect_unref = _gf_true;
|
||||
+ conn->reconnect = NULL;
|
||||
+ }
|
||||
|
||||
conn->connected = 0;
|
||||
conn->disconnected = 1;
|
||||
@@ -533,6 +540,8 @@ rpc_clnt_connection_cleanup(rpc_clnt_connection_t *conn)
|
||||
if (timer_unref)
|
||||
rpc_clnt_unref(clnt);
|
||||
|
||||
+ if (reconnect_unref)
|
||||
+ rpc_clnt_unref(clnt);
|
||||
out:
|
||||
return 0;
|
||||
}
|
||||
@@ -830,7 +839,7 @@ rpc_clnt_handle_disconnect(struct rpc_clnt *clnt, rpc_clnt_connection_t *conn)
|
||||
pthread_mutex_lock(&conn->lock);
|
||||
{
|
||||
if (!conn->rpc_clnt->disabled && (conn->reconnect == NULL)) {
|
||||
- ts.tv_sec = 10;
|
||||
+ ts.tv_sec = 3;
|
||||
ts.tv_nsec = 0;
|
||||
|
||||
rpc_clnt_ref(clnt);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
index 041946d..b3c4158 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
@@ -3364,6 +3364,25 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+int
|
||||
+glusterd_is_path_mounted(const char *path)
|
||||
+{
|
||||
+ FILE *mtab = NULL;
|
||||
+ struct mntent *part = NULL;
|
||||
+ int is_mounted = 0;
|
||||
+
|
||||
+ if ((mtab = setmntent("/etc/mtab", "r")) != NULL) {
|
||||
+ while ((part = getmntent(mtab)) != NULL) {
|
||||
+ if ((part->mnt_fsname != NULL) &&
|
||||
+ (strcmp(part->mnt_dir, path)) == 0) {
|
||||
+ is_mounted = 1;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ endmntent(mtab);
|
||||
+ }
|
||||
+ return is_mounted;
|
||||
+}
|
||||
/* This function will do unmount for snaps.
|
||||
*/
|
||||
int32_t
|
||||
@@ -3388,14 +3407,11 @@ glusterd_snap_unmount(xlator_t *this, glusterd_volinfo_t *volinfo)
|
||||
continue;
|
||||
}
|
||||
|
||||
- /* Fetch the brick mount path from the brickinfo->path */
|
||||
- ret = glusterd_get_brick_root(brickinfo->path, &brick_mount_path);
|
||||
+ ret = glusterd_find_brick_mount_path(brickinfo->path,
|
||||
+ &brick_mount_path);
|
||||
if (ret) {
|
||||
- gf_msg(this->name, GF_LOG_INFO, 0, GD_MSG_BRICK_PATH_UNMOUNTED,
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_BRK_MNTPATH_GET_FAIL,
|
||||
"Failed to find brick_mount_path for %s", brickinfo->path);
|
||||
- /* There is chance that brick path is already
|
||||
- * unmounted. */
|
||||
- ret = 0;
|
||||
goto out;
|
||||
}
|
||||
/* unmount cannot be done when the brick process is still in
|
||||
@@ -3440,6 +3456,10 @@ glusterd_umount(const char *path)
|
||||
GF_ASSERT(this);
|
||||
GF_ASSERT(path);
|
||||
|
||||
+ if (!glusterd_is_path_mounted(path)) {
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
runinit(&runner);
|
||||
snprintf(msg, sizeof(msg), "umount path %s", path);
|
||||
runner_add_args(&runner, _PATH_UMOUNT, "-f", path, NULL);
|
||||
--
|
||||
1.8.3.1
|
||||
|
162
0101-shd-mux-Fix-coverity-issues-introduced-by-shd-mux-pa.patch
Normal file
162
0101-shd-mux-Fix-coverity-issues-introduced-by-shd-mux-pa.patch
Normal file
@ -0,0 +1,162 @@
|
||||
From 0021a4bbc9af2bfe28d4a79f76c3cd33f23dd118 Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Fri, 5 Apr 2019 12:33:55 +0530
|
||||
Subject: [PATCH 101/124] shd/mux: Fix coverity issues introduced by shd mux
|
||||
patch
|
||||
|
||||
CID 1400475: Null pointer dereferences (FORWARD_NULL)
|
||||
CID 1400474: Null pointer dereferences (FORWARD_NULL)
|
||||
CID 1400471: Code maintainability issues (UNUSED_VALUE)
|
||||
CID 1400470: Null pointer dereferences (FORWARD_NULL)
|
||||
CID 1400469: Memory - illegal accesses (USE_AFTER_FREE)
|
||||
CID 1400467: Code maintainability issues (UNUSED_VALUE)
|
||||
|
||||
Backport of: https://review.gluster.org/#/c/glusterfs/+/22514/
|
||||
|
||||
>Change-Id: I0ca1c733be335c6e5844f44850f8066626ac40d4
|
||||
>updates: bz#789278
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: I0425efca9ab5a95801eff9e99259219449a16380
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167832
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
libglusterfs/src/graph.c | 21 +++++++++++++--------
|
||||
xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 6 ++++++
|
||||
xlators/mgmt/glusterd/src/glusterd-svc-helper.c | 24 +++++++++++++++++-------
|
||||
3 files changed, 36 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
|
||||
index a492dd8..4c8b02d 100644
|
||||
--- a/libglusterfs/src/graph.c
|
||||
+++ b/libglusterfs/src/graph.c
|
||||
@@ -1470,7 +1470,9 @@ glusterfs_process_svc_detach(glusterfs_ctx_t *ctx, gf_volfile_t *volfile_obj)
|
||||
goto out;
|
||||
parent_graph = ctx->active;
|
||||
graph = volfile_obj->graph;
|
||||
- if (graph && graph->first)
|
||||
+ if (!graph)
|
||||
+ goto out;
|
||||
+ if (graph->first)
|
||||
xl = graph->first;
|
||||
|
||||
last_xl = graph->last_xl;
|
||||
@@ -1591,12 +1593,10 @@ glusterfs_process_svc_attach_volfp(glusterfs_ctx_t *ctx, FILE *fp,
|
||||
parent_graph->leaf_count += graph->leaf_count;
|
||||
parent_graph->id++;
|
||||
|
||||
+ volfile_obj = GF_CALLOC(1, sizeof(gf_volfile_t), gf_common_volfile_t);
|
||||
if (!volfile_obj) {
|
||||
- volfile_obj = GF_CALLOC(1, sizeof(gf_volfile_t), gf_common_volfile_t);
|
||||
- if (!volfile_obj) {
|
||||
- ret = -1;
|
||||
- goto out;
|
||||
- }
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
graph->used = 1;
|
||||
@@ -1641,6 +1641,7 @@ glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
|
||||
{
|
||||
glusterfs_graph_t *oldvolfile_graph = NULL;
|
||||
glusterfs_graph_t *newvolfile_graph = NULL;
|
||||
+ char vol_id[NAME_MAX + 1];
|
||||
|
||||
int ret = -1;
|
||||
|
||||
@@ -1672,6 +1673,9 @@ glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
|
||||
glusterfs_graph_prepare(newvolfile_graph, ctx, newvolfile_graph->first);
|
||||
|
||||
if (!is_graph_topology_equal(oldvolfile_graph, newvolfile_graph)) {
|
||||
+ ret = snprintf(vol_id, sizeof(vol_id), "%s", volfile_obj->vol_id);
|
||||
+ if (ret < 0)
|
||||
+ goto out;
|
||||
ret = glusterfs_process_svc_detach(ctx, volfile_obj);
|
||||
if (ret) {
|
||||
gf_msg("glusterfsd-mgmt", GF_LOG_ERROR, EINVAL,
|
||||
@@ -1680,8 +1684,9 @@ glusterfs_mux_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
|
||||
"old graph. Aborting the reconfiguration operation");
|
||||
goto out;
|
||||
}
|
||||
- ret = glusterfs_process_svc_attach_volfp(ctx, newvolfile_fp,
|
||||
- volfile_obj->vol_id, checksum);
|
||||
+ volfile_obj = NULL;
|
||||
+ ret = glusterfs_process_svc_attach_volfp(ctx, newvolfile_fp, vol_id,
|
||||
+ checksum);
|
||||
goto out;
|
||||
}
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
index 937ea30..04a4b2e 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
@@ -101,6 +101,8 @@ glusterd_shdsvc_init(void *data, glusterd_conn_t *mux_conn,
|
||||
svc->conn.rpc = rpc_clnt_ref(mux_svc->rpc);
|
||||
ret = snprintf(svc->conn.sockpath, sizeof(svc->conn.sockpath), "%s",
|
||||
mux_conn->sockpath);
|
||||
+ if (ret < 0)
|
||||
+ goto out;
|
||||
} else {
|
||||
ret = mkdir_p(logdir, 0755, _gf_true);
|
||||
if ((ret == -1) && (EEXIST != errno)) {
|
||||
@@ -663,6 +665,10 @@ glusterd_shdsvc_stop(glusterd_svc_t *svc, int sig)
|
||||
glusterd_volinfo_ref(volinfo);
|
||||
svc_proc->data = volinfo;
|
||||
ret = glusterd_svc_stop(svc, sig);
|
||||
+ if (ret) {
|
||||
+ glusterd_volinfo_unref(volinfo);
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
if (!empty && pid != -1) {
|
||||
ret = glusterd_detach_svc(svc, volinfo, sig);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
index e42703c..02945b1 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
@@ -411,9 +411,14 @@ __gf_find_compatible_svc(gd_node_type daemon)
|
||||
conf = THIS->private;
|
||||
GF_VALIDATE_OR_GOTO("glusterd", conf, out);
|
||||
|
||||
- if (daemon == GD_NODE_SHD) {
|
||||
- svc_procs = &conf->shd_procs;
|
||||
- if (!svc_procs)
|
||||
+ switch (daemon) {
|
||||
+ case GD_NODE_SHD: {
|
||||
+ svc_procs = &conf->shd_procs;
|
||||
+ if (!svc_procs)
|
||||
+ goto out;
|
||||
+ } break;
|
||||
+ default:
|
||||
+ /* Add support for other client daemons here */
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -540,11 +545,16 @@ __gf_find_compatible_svc_from_pid(gd_node_type daemon, pid_t pid)
|
||||
if (!conf)
|
||||
return NULL;
|
||||
|
||||
- if (daemon == GD_NODE_SHD) {
|
||||
- svc_procs = &conf->shd_procs;
|
||||
- if (!svc_proc)
|
||||
+ switch (daemon) {
|
||||
+ case GD_NODE_SHD: {
|
||||
+ svc_procs = &conf->shd_procs;
|
||||
+ if (!svc_procs)
|
||||
+ return NULL;
|
||||
+ } break;
|
||||
+ default:
|
||||
+ /* Add support for other client daemons here */
|
||||
return NULL;
|
||||
- } /* Can be moved to switch when mux is implemented for other daemon; */
|
||||
+ }
|
||||
|
||||
cds_list_for_each_entry(svc_proc, svc_procs, svc_proc_list)
|
||||
{
|
||||
--
|
||||
1.8.3.1
|
||||
|
737
0102-rpc-transport-Missing-a-ref-on-dict-while-creating-t.patch
Normal file
737
0102-rpc-transport-Missing-a-ref-on-dict-while-creating-t.patch
Normal file
@ -0,0 +1,737 @@
|
||||
From df6523ed3c5267624197b52edcb553fc2d8a08f2 Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Tue, 26 Feb 2019 18:04:18 +0530
|
||||
Subject: [PATCH 102/124] rpc/transport: Missing a ref on dict while creating
|
||||
transport object
|
||||
|
||||
while creating rpc_tranpsort object, we store a dictionary without
|
||||
taking a ref on dict but it does an unref during the cleaning of the
|
||||
transport object.
|
||||
|
||||
So the rpc layer expect the caller to take a ref on the dictionary
|
||||
before passing dict to rpc layer. This leads to a lot of confusion
|
||||
across the code base and leads to ref leaks.
|
||||
|
||||
Semantically, this is not correct. It is the rpc layer responsibility
|
||||
to take a ref when storing it, and free during the cleanup.
|
||||
|
||||
I'm listing down the total issues or leaks across the code base because
|
||||
of this confusion. These issues are currently present in the upstream
|
||||
master.
|
||||
|
||||
1) changelog_rpc_client_init
|
||||
|
||||
2) quota_enforcer_init
|
||||
|
||||
3) rpcsvc_create_listeners : when there are two transport, like tcp,rdma.
|
||||
|
||||
4) quotad_aggregator_init
|
||||
|
||||
5) glusterd: init
|
||||
|
||||
6) nfs3_init_state
|
||||
|
||||
7) server: init
|
||||
|
||||
8) client:init
|
||||
|
||||
This patch does the cleanup according to the semantics.
|
||||
|
||||
Backport of : https://review.gluster.org/#/c/glusterfs/+/22266/
|
||||
|
||||
>Change-Id: I46373af9630373eb375ee6de0e6f2bbe2a677425
|
||||
>updates: bz#1659708
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: Iff978497e11592fbebfa4b683fdc56698b782859
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167847
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
api/src/glfs-mgmt.c | 10 ++++--
|
||||
cli/src/cli.c | 20 +++++++-----
|
||||
glusterfsd/src/glusterfsd-mgmt.c | 18 ++++++++--
|
||||
rpc/rpc-lib/src/rpc-clnt.c | 2 --
|
||||
rpc/rpc-lib/src/rpc-transport.c | 38 +++++++---------------
|
||||
rpc/rpc-lib/src/rpc-transport.h | 4 +--
|
||||
rpc/rpc-lib/src/rpcsvc.c | 13 ++------
|
||||
rpc/rpc-lib/src/rpcsvc.h | 2 +-
|
||||
.../features/changelog/src/changelog-rpc-common.c | 9 +++--
|
||||
.../snapview-server/src/snapview-server-mgmt.c | 8 ++++-
|
||||
xlators/mgmt/glusterd/src/glusterd-conn-mgmt.c | 8 ++++-
|
||||
xlators/mgmt/glusterd/src/glusterd-handler.c | 18 ++++++----
|
||||
xlators/mgmt/glusterd/src/glusterd-rebalance.c | 8 ++++-
|
||||
xlators/mgmt/glusterd/src/glusterd-utils.c | 9 +++--
|
||||
xlators/mgmt/glusterd/src/glusterd.c | 6 +++-
|
||||
xlators/nfs/server/src/acl3.c | 5 +++
|
||||
xlators/nfs/server/src/mount3.c | 5 +++
|
||||
xlators/nfs/server/src/nlm4.c | 7 ++++
|
||||
18 files changed, 119 insertions(+), 71 deletions(-)
|
||||
|
||||
diff --git a/api/src/glfs-mgmt.c b/api/src/glfs-mgmt.c
|
||||
index d502b4f..7476d5b 100644
|
||||
--- a/api/src/glfs-mgmt.c
|
||||
+++ b/api/src/glfs-mgmt.c
|
||||
@@ -1015,6 +1015,10 @@ glfs_mgmt_init(struct glfs *fs)
|
||||
if (ctx->mgmt)
|
||||
return 0;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
if (cmd_args->volfile_server_port)
|
||||
port = cmd_args->volfile_server_port;
|
||||
|
||||
@@ -1029,11 +1033,11 @@ glfs_mgmt_init(struct glfs *fs)
|
||||
|
||||
if (cmd_args->volfile_server_transport &&
|
||||
!strcmp(cmd_args->volfile_server_transport, "unix")) {
|
||||
- ret = rpc_transport_unix_options_build(&options, host, 0);
|
||||
+ ret = rpc_transport_unix_options_build(options, host, 0);
|
||||
} else {
|
||||
xlator_cmdline_option_t *opt = find_xlator_option_in_cmd_args_t(
|
||||
"address-family", cmd_args);
|
||||
- ret = rpc_transport_inet_options_build(&options, host, port,
|
||||
+ ret = rpc_transport_inet_options_build(options, host, port,
|
||||
(opt ? opt->value : NULL));
|
||||
}
|
||||
|
||||
@@ -1075,5 +1079,7 @@ glfs_mgmt_init(struct glfs *fs)
|
||||
|
||||
ret = rpc_clnt_start(rpc);
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return ret;
|
||||
}
|
||||
diff --git a/cli/src/cli.c b/cli/src/cli.c
|
||||
index c33d152..ff39a98 100644
|
||||
--- a/cli/src/cli.c
|
||||
+++ b/cli/src/cli.c
|
||||
@@ -661,9 +661,8 @@ cli_quotad_clnt_rpc_init(void)
|
||||
|
||||
global_quotad_rpc = rpc;
|
||||
out:
|
||||
- if (ret) {
|
||||
- if (rpc_opts)
|
||||
- dict_unref(rpc_opts);
|
||||
+ if (rpc_opts) {
|
||||
+ dict_unref(rpc_opts);
|
||||
}
|
||||
return rpc;
|
||||
}
|
||||
@@ -685,6 +684,10 @@ cli_rpc_init(struct cli_state *state)
|
||||
this = THIS;
|
||||
cli_rpc_prog = &cli_prog;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
/* If address family specified in CLI */
|
||||
if (state->address_family) {
|
||||
addr_family = state->address_family;
|
||||
@@ -699,7 +702,7 @@ cli_rpc_init(struct cli_state *state)
|
||||
"Connecting to glusterd using "
|
||||
"sockfile %s",
|
||||
state->glusterd_sock);
|
||||
- ret = rpc_transport_unix_options_build(&options, state->glusterd_sock,
|
||||
+ ret = rpc_transport_unix_options_build(options, state->glusterd_sock,
|
||||
0);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -709,10 +712,6 @@ cli_rpc_init(struct cli_state *state)
|
||||
"%s",
|
||||
state->remote_host);
|
||||
|
||||
- options = dict_new();
|
||||
- if (!options)
|
||||
- goto out;
|
||||
-
|
||||
ret = dict_set_str(options, "remote-host", state->remote_host);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -731,7 +730,7 @@ cli_rpc_init(struct cli_state *state)
|
||||
gf_log("cli", GF_LOG_DEBUG,
|
||||
"Connecting to glusterd using "
|
||||
"default socket");
|
||||
- ret = rpc_transport_unix_options_build(&options,
|
||||
+ ret = rpc_transport_unix_options_build(options,
|
||||
DEFAULT_GLUSTERD_SOCKFILE, 0);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -749,6 +748,9 @@ cli_rpc_init(struct cli_state *state)
|
||||
|
||||
ret = rpc_clnt_start(rpc);
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
+
|
||||
if (ret) {
|
||||
if (rpc)
|
||||
rpc_clnt_unref(rpc);
|
||||
diff --git a/glusterfsd/src/glusterfsd-mgmt.c b/glusterfsd/src/glusterfsd-mgmt.c
|
||||
index a89c980..1d2cd1a 100644
|
||||
--- a/glusterfsd/src/glusterfsd-mgmt.c
|
||||
+++ b/glusterfsd/src/glusterfsd-mgmt.c
|
||||
@@ -2781,7 +2781,11 @@ glusterfs_listener_init(glusterfs_ctx_t *ctx)
|
||||
if (!cmd_args->sock_file)
|
||||
return 0;
|
||||
|
||||
- ret = rpcsvc_transport_unix_options_build(&options, cmd_args->sock_file);
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
+ ret = rpcsvc_transport_unix_options_build(options, cmd_args->sock_file);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -2808,6 +2812,8 @@ glusterfs_listener_init(glusterfs_ctx_t *ctx)
|
||||
ctx->listener = rpc;
|
||||
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -2889,6 +2895,10 @@ glusterfs_mgmt_init(glusterfs_ctx_t *ctx)
|
||||
if (ctx->mgmt)
|
||||
return 0;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
LOCK_INIT(&ctx->volfile_lock);
|
||||
|
||||
if (cmd_args->volfile_server_port)
|
||||
@@ -2898,10 +2908,10 @@ glusterfs_mgmt_init(glusterfs_ctx_t *ctx)
|
||||
|
||||
if (cmd_args->volfile_server_transport &&
|
||||
!strcmp(cmd_args->volfile_server_transport, "unix")) {
|
||||
- ret = rpc_transport_unix_options_build(&options, host, 0);
|
||||
+ ret = rpc_transport_unix_options_build(options, host, 0);
|
||||
} else {
|
||||
opt = find_xlator_option_in_cmd_args_t("address-family", cmd_args);
|
||||
- ret = rpc_transport_inet_options_build(&options, host, port,
|
||||
+ ret = rpc_transport_inet_options_build(options, host, port,
|
||||
(opt ? opt->value : NULL));
|
||||
}
|
||||
if (ret)
|
||||
@@ -2950,6 +2960,8 @@ glusterfs_mgmt_init(glusterfs_ctx_t *ctx)
|
||||
|
||||
ret = rpc_clnt_start(rpc);
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
|
||||
index 6f47515..b04eaed 100644
|
||||
--- a/rpc/rpc-lib/src/rpc-clnt.c
|
||||
+++ b/rpc/rpc-lib/src/rpc-clnt.c
|
||||
@@ -1125,8 +1125,6 @@ rpc_clnt_new(dict_t *options, xlator_t *owner, char *name,
|
||||
mem_pool_destroy(rpc->saved_frames_pool);
|
||||
GF_FREE(rpc);
|
||||
rpc = NULL;
|
||||
- if (options)
|
||||
- dict_unref(options);
|
||||
goto out;
|
||||
}
|
||||
|
||||
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c
|
||||
index 4beaaf9..bed1f8c 100644
|
||||
--- a/rpc/rpc-lib/src/rpc-transport.c
|
||||
+++ b/rpc/rpc-lib/src/rpc-transport.c
|
||||
@@ -168,6 +168,11 @@ rpc_transport_cleanup(rpc_transport_t *trans)
|
||||
if (trans->fini)
|
||||
trans->fini(trans);
|
||||
|
||||
+ if (trans->options) {
|
||||
+ dict_unref(trans->options);
|
||||
+ trans->options = NULL;
|
||||
+ }
|
||||
+
|
||||
GF_FREE(trans->name);
|
||||
|
||||
if (trans->xl)
|
||||
@@ -352,7 +357,7 @@ rpc_transport_load(glusterfs_ctx_t *ctx, dict_t *options, char *trans_name)
|
||||
}
|
||||
}
|
||||
|
||||
- trans->options = options;
|
||||
+ trans->options = dict_ref(options);
|
||||
|
||||
pthread_mutex_init(&trans->lock, NULL);
|
||||
trans->xl = this;
|
||||
@@ -591,19 +596,14 @@ out:
|
||||
}
|
||||
|
||||
int
|
||||
-rpc_transport_unix_options_build(dict_t **options, char *filepath,
|
||||
+rpc_transport_unix_options_build(dict_t *dict, char *filepath,
|
||||
int frame_timeout)
|
||||
{
|
||||
- dict_t *dict = NULL;
|
||||
char *fpath = NULL;
|
||||
int ret = -1;
|
||||
|
||||
GF_ASSERT(filepath);
|
||||
- GF_ASSERT(options);
|
||||
-
|
||||
- dict = dict_new();
|
||||
- if (!dict)
|
||||
- goto out;
|
||||
+ GF_VALIDATE_OR_GOTO("rpc-transport", dict, out);
|
||||
|
||||
fpath = gf_strdup(filepath);
|
||||
if (!fpath) {
|
||||
@@ -638,20 +638,14 @@ rpc_transport_unix_options_build(dict_t **options, char *filepath,
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
-
|
||||
- *options = dict;
|
||||
out:
|
||||
- if (ret && dict) {
|
||||
- dict_unref(dict);
|
||||
- }
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
-rpc_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
- int port, char *af)
|
||||
+rpc_transport_inet_options_build(dict_t *dict, const char *hostname, int port,
|
||||
+ char *af)
|
||||
{
|
||||
- dict_t *dict = NULL;
|
||||
char *host = NULL;
|
||||
int ret = -1;
|
||||
#ifdef IPV6_DEFAULT
|
||||
@@ -660,13 +654,9 @@ rpc_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
char *addr_family = "inet";
|
||||
#endif
|
||||
|
||||
- GF_ASSERT(options);
|
||||
GF_ASSERT(hostname);
|
||||
GF_ASSERT(port >= 1024);
|
||||
-
|
||||
- dict = dict_new();
|
||||
- if (!dict)
|
||||
- goto out;
|
||||
+ GF_VALIDATE_OR_GOTO("rpc-transport", dict, out);
|
||||
|
||||
host = gf_strdup((char *)hostname);
|
||||
if (!host) {
|
||||
@@ -702,12 +692,6 @@ rpc_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
"failed to set trans-type with socket");
|
||||
goto out;
|
||||
}
|
||||
-
|
||||
- *options = dict;
|
||||
out:
|
||||
- if (ret && dict) {
|
||||
- dict_unref(dict);
|
||||
- }
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h
|
||||
index 9e75d1a..64b7e9b 100644
|
||||
--- a/rpc/rpc-lib/src/rpc-transport.h
|
||||
+++ b/rpc/rpc-lib/src/rpc-transport.h
|
||||
@@ -303,11 +303,11 @@ rpc_transport_keepalive_options_set(dict_t *options, int32_t interval,
|
||||
int32_t time, int32_t timeout);
|
||||
|
||||
int
|
||||
-rpc_transport_unix_options_build(dict_t **options, char *filepath,
|
||||
+rpc_transport_unix_options_build(dict_t *options, char *filepath,
|
||||
int frame_timeout);
|
||||
|
||||
int
|
||||
-rpc_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
+rpc_transport_inet_options_build(dict_t *options, const char *hostname,
|
||||
int port, char *af);
|
||||
|
||||
void
|
||||
diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c
|
||||
index 74373c4..5a35139 100644
|
||||
--- a/rpc/rpc-lib/src/rpcsvc.c
|
||||
+++ b/rpc/rpc-lib/src/rpcsvc.c
|
||||
@@ -2615,18 +2615,13 @@ rpcsvc_reconfigure_options(rpcsvc_t *svc, dict_t *options)
|
||||
}
|
||||
|
||||
int
|
||||
-rpcsvc_transport_unix_options_build(dict_t **options, char *filepath)
|
||||
+rpcsvc_transport_unix_options_build(dict_t *dict, char *filepath)
|
||||
{
|
||||
- dict_t *dict = NULL;
|
||||
char *fpath = NULL;
|
||||
int ret = -1;
|
||||
|
||||
GF_ASSERT(filepath);
|
||||
- GF_ASSERT(options);
|
||||
-
|
||||
- dict = dict_new();
|
||||
- if (!dict)
|
||||
- goto out;
|
||||
+ GF_VALIDATE_OR_GOTO("rpcsvc", dict, out);
|
||||
|
||||
fpath = gf_strdup(filepath);
|
||||
if (!fpath) {
|
||||
@@ -2649,13 +2644,9 @@ rpcsvc_transport_unix_options_build(dict_t **options, char *filepath)
|
||||
ret = dict_set_str(dict, "transport-type", "socket");
|
||||
if (ret)
|
||||
goto out;
|
||||
-
|
||||
- *options = dict;
|
||||
out:
|
||||
if (ret) {
|
||||
GF_FREE(fpath);
|
||||
- if (dict)
|
||||
- dict_unref(dict);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h
|
||||
index 34045ce..a51edc7 100644
|
||||
--- a/rpc/rpc-lib/src/rpcsvc.h
|
||||
+++ b/rpc/rpc-lib/src/rpcsvc.h
|
||||
@@ -665,7 +665,7 @@ rpcsvc_actor_t *
|
||||
rpcsvc_program_actor(rpcsvc_request_t *req);
|
||||
|
||||
int
|
||||
-rpcsvc_transport_unix_options_build(dict_t **options, char *filepath);
|
||||
+rpcsvc_transport_unix_options_build(dict_t *options, char *filepath);
|
||||
int
|
||||
rpcsvc_set_allow_insecure(rpcsvc_t *svc, dict_t *options);
|
||||
int
|
||||
diff --git a/xlators/features/changelog/src/changelog-rpc-common.c b/xlators/features/changelog/src/changelog-rpc-common.c
|
||||
index cf35175..dcdcfb1 100644
|
||||
--- a/xlators/features/changelog/src/changelog-rpc-common.c
|
||||
+++ b/xlators/features/changelog/src/changelog-rpc-common.c
|
||||
@@ -47,7 +47,7 @@ changelog_rpc_client_init(xlator_t *this, void *cbkdata, char *sockfile,
|
||||
if (!options)
|
||||
goto error_return;
|
||||
|
||||
- ret = rpc_transport_unix_options_build(&options, sockfile, 0);
|
||||
+ ret = rpc_transport_unix_options_build(options, sockfile, 0);
|
||||
if (ret) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, 0, CHANGELOG_MSG_RPC_BUILD_ERROR,
|
||||
"failed to build rpc options");
|
||||
@@ -73,6 +73,7 @@ changelog_rpc_client_init(xlator_t *this, void *cbkdata, char *sockfile,
|
||||
goto dealloc_rpc_clnt;
|
||||
}
|
||||
|
||||
+ dict_unref(options);
|
||||
return rpc;
|
||||
|
||||
dealloc_rpc_clnt:
|
||||
@@ -303,7 +304,11 @@ changelog_rpc_server_init(xlator_t *this, char *sockfile, void *cbkdata,
|
||||
if (!cbkdata)
|
||||
cbkdata = this;
|
||||
|
||||
- ret = rpcsvc_transport_unix_options_build(&options, sockfile);
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ return NULL;
|
||||
+
|
||||
+ ret = rpcsvc_transport_unix_options_build(options, sockfile);
|
||||
if (ret)
|
||||
goto dealloc_dict;
|
||||
|
||||
diff --git a/xlators/features/snapview-server/src/snapview-server-mgmt.c b/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
||||
index b608cdf..bc415ef 100644
|
||||
--- a/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
||||
+++ b/xlators/features/snapview-server/src/snapview-server-mgmt.c
|
||||
@@ -101,8 +101,12 @@ svs_mgmt_init(xlator_t *this)
|
||||
if (cmd_args->volfile_server)
|
||||
host = cmd_args->volfile_server;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
opt = find_xlator_option_in_cmd_args_t("address-family", cmd_args);
|
||||
- ret = rpc_transport_inet_options_build(&options, host, port,
|
||||
+ ret = rpc_transport_inet_options_build(options, host, port,
|
||||
(opt != NULL ? opt->value : NULL));
|
||||
if (ret) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, 0, SVS_MSG_BUILD_TRNSPRT_OPT_FAILED,
|
||||
@@ -145,6 +149,8 @@ svs_mgmt_init(xlator_t *this)
|
||||
gf_msg_debug(this->name, 0, "svs mgmt init successful");
|
||||
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
if (ret)
|
||||
if (priv) {
|
||||
rpc_clnt_connection_cleanup(&priv->rpc->conn);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.c b/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.c
|
||||
index 052438c..16eefa1 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-conn-mgmt.c
|
||||
@@ -29,6 +29,10 @@ glusterd_conn_init(glusterd_conn_t *conn, char *sockpath, int frame_timeout,
|
||||
if (!this)
|
||||
goto out;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
svc = glusterd_conn_get_svc_object(conn);
|
||||
if (!svc) {
|
||||
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_SVC_GET_FAIL,
|
||||
@@ -36,7 +40,7 @@ glusterd_conn_init(glusterd_conn_t *conn, char *sockpath, int frame_timeout,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- ret = rpc_transport_unix_options_build(&options, sockpath, frame_timeout);
|
||||
+ ret = rpc_transport_unix_options_build(options, sockpath, frame_timeout);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -66,6 +70,8 @@ glusterd_conn_init(glusterd_conn_t *conn, char *sockpath, int frame_timeout,
|
||||
conn->rpc = rpc;
|
||||
conn->notify = notify;
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
if (ret) {
|
||||
if (rpc) {
|
||||
rpc_clnt_unref(rpc);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
index 1cb9013..6147995 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
@@ -3493,11 +3493,10 @@ out:
|
||||
}
|
||||
|
||||
int
|
||||
-glusterd_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
+glusterd_transport_inet_options_build(dict_t *dict, const char *hostname,
|
||||
int port, char *af)
|
||||
{
|
||||
xlator_t *this = NULL;
|
||||
- dict_t *dict = NULL;
|
||||
int32_t interval = -1;
|
||||
int32_t time = -1;
|
||||
int32_t timeout = -1;
|
||||
@@ -3505,14 +3504,14 @@ glusterd_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
|
||||
this = THIS;
|
||||
GF_ASSERT(this);
|
||||
- GF_ASSERT(options);
|
||||
+ GF_ASSERT(dict);
|
||||
GF_ASSERT(hostname);
|
||||
|
||||
if (!port)
|
||||
port = GLUSTERD_DEFAULT_PORT;
|
||||
|
||||
/* Build default transport options */
|
||||
- ret = rpc_transport_inet_options_build(&dict, hostname, port, af);
|
||||
+ ret = rpc_transport_inet_options_build(dict, hostname, port, af);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -3552,7 +3551,6 @@ glusterd_transport_inet_options_build(dict_t **options, const char *hostname,
|
||||
if ((interval > 0) || (time > 0))
|
||||
ret = rpc_transport_keepalive_options_set(dict, interval, time,
|
||||
timeout);
|
||||
- *options = dict;
|
||||
out:
|
||||
gf_msg_debug("glusterd", 0, "Returning %d", ret);
|
||||
return ret;
|
||||
@@ -3572,6 +3570,10 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
|
||||
if (!peerctx)
|
||||
goto out;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
if (args)
|
||||
peerctx->args = *args;
|
||||
|
||||
@@ -3586,7 +3588,7 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
|
||||
if (ret)
|
||||
gf_log(this->name, GF_LOG_TRACE,
|
||||
"option transport.address-family is not set in xlator options");
|
||||
- ret = glusterd_transport_inet_options_build(&options, peerinfo->hostname,
|
||||
+ ret = glusterd_transport_inet_options_build(options, peerinfo->hostname,
|
||||
peerinfo->port, af);
|
||||
if (ret)
|
||||
goto out;
|
||||
@@ -3596,6 +3598,7 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
|
||||
* create our RPC endpoint with the same address that the peer would
|
||||
* use to reach us.
|
||||
*/
|
||||
+
|
||||
if (this->options) {
|
||||
data = dict_getn(this->options, "transport.socket.bind-address",
|
||||
SLEN("transport.socket.bind-address"));
|
||||
@@ -3637,6 +3640,9 @@ glusterd_friend_rpc_create(xlator_t *this, glusterd_peerinfo_t *peerinfo,
|
||||
peerctx = NULL;
|
||||
ret = 0;
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
+
|
||||
GF_FREE(peerctx);
|
||||
return ret;
|
||||
}
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
|
||||
index ed5ded5..cbed9a9 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
|
||||
@@ -391,6 +391,10 @@ glusterd_rebalance_rpc_create(glusterd_volinfo_t *volinfo)
|
||||
if (!defrag)
|
||||
goto out;
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
GLUSTERD_GET_DEFRAG_SOCK_FILE(sockfile, volinfo);
|
||||
/* Check if defrag sockfile exists in the new location
|
||||
* in /var/run/ , if it does not try the old location
|
||||
@@ -420,7 +424,7 @@ glusterd_rebalance_rpc_create(glusterd_volinfo_t *volinfo)
|
||||
* default timeout of 30mins used for unreliable network connections is
|
||||
* too long for unix domain socket connections.
|
||||
*/
|
||||
- ret = rpc_transport_unix_options_build(&options, sockfile, 600);
|
||||
+ ret = rpc_transport_unix_options_build(options, sockfile, 600);
|
||||
if (ret) {
|
||||
gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_UNIX_OP_BUILD_FAIL,
|
||||
"Unix options build failed");
|
||||
@@ -437,6 +441,8 @@ glusterd_rebalance_rpc_create(glusterd_volinfo_t *volinfo)
|
||||
}
|
||||
ret = 0;
|
||||
out:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return ret;
|
||||
}
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
index ef664c2..2dd5f91 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
@@ -1980,7 +1980,11 @@ glusterd_brick_connect(glusterd_volinfo_t *volinfo,
|
||||
* The default timeout of 30mins used for unreliable network
|
||||
* connections is too long for unix domain socket connections.
|
||||
*/
|
||||
- ret = rpc_transport_unix_options_build(&options, socketpath, 600);
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
+ ret = rpc_transport_unix_options_build(options, socketpath, 600);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -1999,7 +2003,8 @@ glusterd_brick_connect(glusterd_volinfo_t *volinfo,
|
||||
brickinfo->rpc = rpc;
|
||||
}
|
||||
out:
|
||||
-
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
gf_msg_debug("glusterd", 0, "Returning %d", ret);
|
||||
return ret;
|
||||
}
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
|
||||
index 89afb9c..d4ab630 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd.c
|
||||
@@ -1111,11 +1111,15 @@ glusterd_init_uds_listener(xlator_t *this)
|
||||
|
||||
GF_ASSERT(this);
|
||||
|
||||
+ options = dict_new();
|
||||
+ if (!options)
|
||||
+ goto out;
|
||||
+
|
||||
sock_data = dict_get(this->options, "glusterd-sockfile");
|
||||
(void)snprintf(sockfile, sizeof(sockfile), "%s",
|
||||
sock_data ? sock_data->data : DEFAULT_GLUSTERD_SOCKFILE);
|
||||
|
||||
- ret = rpcsvc_transport_unix_options_build(&options, sockfile);
|
||||
+ ret = rpcsvc_transport_unix_options_build(options, sockfile);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
diff --git a/xlators/nfs/server/src/acl3.c b/xlators/nfs/server/src/acl3.c
|
||||
index 0eca45d..2ede24b 100644
|
||||
--- a/xlators/nfs/server/src/acl3.c
|
||||
+++ b/xlators/nfs/server/src/acl3.c
|
||||
@@ -787,9 +787,14 @@ acl3svc_init(xlator_t *nfsx)
|
||||
goto err;
|
||||
}
|
||||
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
+
|
||||
acl3_inited = _gf_true;
|
||||
return &acl3prog;
|
||||
err:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
|
||||
index 726dc29..396809c 100644
|
||||
--- a/xlators/nfs/server/src/mount3.c
|
||||
+++ b/xlators/nfs/server/src/mount3.c
|
||||
@@ -4102,8 +4102,13 @@ mnt3svc_init(xlator_t *nfsx)
|
||||
gf_msg_debug(GF_MNT, GF_LOG_DEBUG, "Thread creation failed");
|
||||
}
|
||||
}
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
+
|
||||
return &mnt3prog;
|
||||
err:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
|
||||
index a341ebd..c3c1453 100644
|
||||
--- a/xlators/nfs/server/src/nlm4.c
|
||||
+++ b/xlators/nfs/server/src/nlm4.c
|
||||
@@ -1121,6 +1121,8 @@ nlm4_establish_callback(nfs3_call_state_t *cs, call_frame_t *cbk_frame)
|
||||
ret = 0;
|
||||
|
||||
err:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
if (ret == -1) {
|
||||
if (rpc_clnt)
|
||||
rpc_clnt_unref(rpc_clnt);
|
||||
@@ -2708,8 +2710,13 @@ nlm4svc_init(xlator_t *nfsx)
|
||||
|
||||
gf_timer_call_after(nfsx->ctx, timeout, nlm_grace_period_over, NULL);
|
||||
nlm4_inited = _gf_true;
|
||||
+
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return &nlm4prog;
|
||||
err:
|
||||
+ if (options)
|
||||
+ dict_unref(options);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
43
0103-dht-NULL-check-before-setting-error-flag.patch
Normal file
43
0103-dht-NULL-check-before-setting-error-flag.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From 45c9eeb5544738d4d1d0aefb8a7f61e5d8859ad8 Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Tue, 12 Mar 2019 18:00:37 +0530
|
||||
Subject: [PATCH 103/124] dht: NULL check before setting error flag
|
||||
|
||||
Function dht_common_mark_mdsxattr blindly setting value for
|
||||
an integer pointer without validating it. In fact there are
|
||||
two callers of this function that passes NULL value to the
|
||||
same pointer which leads to a crash.
|
||||
|
||||
Backport of : https://review.gluster.org/#/c/22345/
|
||||
|
||||
>Change-Id: Id94ffe216f6a21f007b3291bff0b1e1c1989075c
|
||||
>fixes: bz#1687811
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: Id9785c16184fd80e8184e5ae135fb63bf44692cd
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167846
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/cluster/dht/src/dht-common.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
|
||||
index 367548f..2a68193 100644
|
||||
--- a/xlators/cluster/dht/src/dht-common.c
|
||||
+++ b/xlators/cluster/dht/src/dht-common.c
|
||||
@@ -852,7 +852,8 @@ dht_common_mark_mdsxattr(call_frame_t *frame, int *errst,
|
||||
"Failed to get hashed subvol for path %s"
|
||||
"gfid is %s ",
|
||||
local->loc.path, gfid_local);
|
||||
- (*errst) = 1;
|
||||
+ if (errst)
|
||||
+ (*errst) = 1;
|
||||
ret = -1;
|
||||
goto out;
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
151
0104-afr-shd-Cleanup-self-heal-daemon-resources-during-af.patch
Normal file
151
0104-afr-shd-Cleanup-self-heal-daemon-resources-during-af.patch
Normal file
@ -0,0 +1,151 @@
|
||||
From faaaa3452ceec6afcc18cffc9beca3fe19841cce Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Thu, 3 Jan 2019 17:44:18 +0530
|
||||
Subject: [PATCH 104/124] afr/shd: Cleanup self heal daemon resources during
|
||||
afr fini
|
||||
|
||||
We were not properly cleaning self-heal daemon resources
|
||||
during afr fini. This patch will clean the same.
|
||||
|
||||
Backport of: https://review.gluster.org/#/c/glusterfs/+/22151/
|
||||
|
||||
>Change-Id: I597860be6f781b195449e695d871b8667a418d5a
|
||||
>updates: bz#1659708
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: I7be981b9c2476c8cacadea6b14d74234f67b714f
|
||||
BUG: 1471742
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167845
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
libglusterfs/src/syncop-utils.c | 8 +++++
|
||||
xlators/cluster/afr/src/afr-self-heald.c | 2 ++
|
||||
xlators/cluster/afr/src/afr.c | 57 ++++++++++++++++++++++++++++++++
|
||||
3 files changed, 67 insertions(+)
|
||||
|
||||
diff --git a/libglusterfs/src/syncop-utils.c b/libglusterfs/src/syncop-utils.c
|
||||
index be03527..b842142 100644
|
||||
--- a/libglusterfs/src/syncop-utils.c
|
||||
+++ b/libglusterfs/src/syncop-utils.c
|
||||
@@ -350,6 +350,11 @@ syncop_mt_dir_scan(call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid,
|
||||
gf_boolean_t cond_init = _gf_false;
|
||||
gf_boolean_t mut_init = _gf_false;
|
||||
gf_dirent_t entries;
|
||||
+ xlator_t *this = NULL;
|
||||
+
|
||||
+ if (frame) {
|
||||
+ this = frame->this;
|
||||
+ }
|
||||
|
||||
/*For this functionality to be implemented in general, we need
|
||||
* synccond_t infra which doesn't block the executing thread. Until then
|
||||
@@ -397,6 +402,9 @@ syncop_mt_dir_scan(call_frame_t *frame, xlator_t *subvol, loc_t *loc, int pid,
|
||||
|
||||
list_for_each_entry_safe(entry, tmp, &entries.list, list)
|
||||
{
|
||||
+ if (this && this->cleanup_starting)
|
||||
+ goto out;
|
||||
+
|
||||
list_del_init(&entry->list);
|
||||
if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) {
|
||||
gf_dirent_entry_free(entry);
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heald.c b/xlators/cluster/afr/src/afr-self-heald.c
|
||||
index 7eb1207..8bc4720 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heald.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heald.c
|
||||
@@ -373,6 +373,7 @@ afr_shd_sweep_prepare(struct subvol_healer *healer)
|
||||
|
||||
time(&event->start_time);
|
||||
event->end_time = 0;
|
||||
+ _mask_cancellation();
|
||||
}
|
||||
|
||||
void
|
||||
@@ -394,6 +395,7 @@ afr_shd_sweep_done(struct subvol_healer *healer)
|
||||
|
||||
if (eh_save_history(shd->statistics[healer->subvol], history) < 0)
|
||||
GF_FREE(history);
|
||||
+ _unmask_cancellation();
|
||||
}
|
||||
|
||||
int
|
||||
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
|
||||
index 33258a0..a0a7551 100644
|
||||
--- a/xlators/cluster/afr/src/afr.c
|
||||
+++ b/xlators/cluster/afr/src/afr.c
|
||||
@@ -611,13 +611,70 @@ init(xlator_t *this)
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
+void
|
||||
+afr_destroy_healer_object(xlator_t *this, struct subvol_healer *healer)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ if (!healer)
|
||||
+ return;
|
||||
+
|
||||
+ if (healer->running) {
|
||||
+ /*
|
||||
+ * If there are any resources to cleanup, We need
|
||||
+ * to do that gracefully using pthread_cleanup_push
|
||||
+ */
|
||||
+ ret = gf_thread_cleanup_xint(healer->thread);
|
||||
+ if (ret)
|
||||
+ gf_msg(this->name, GF_LOG_WARNING, 0, AFR_MSG_SELF_HEAL_FAILED,
|
||||
+ "Failed to clean up healer threads.");
|
||||
+ healer->thread = 0;
|
||||
+ }
|
||||
+ pthread_cond_destroy(&healer->cond);
|
||||
+ pthread_mutex_destroy(&healer->mutex);
|
||||
+}
|
||||
+
|
||||
+void
|
||||
+afr_selfheal_daemon_fini(xlator_t *this)
|
||||
+{
|
||||
+ struct subvol_healer *healer = NULL;
|
||||
+ afr_self_heald_t *shd = NULL;
|
||||
+ afr_private_t *priv = NULL;
|
||||
+ int i = 0;
|
||||
+
|
||||
+ priv = this->private;
|
||||
+ if (!priv)
|
||||
+ return;
|
||||
+
|
||||
+ shd = &priv->shd;
|
||||
+ if (!shd->iamshd)
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < priv->child_count; i++) {
|
||||
+ healer = &shd->index_healers[i];
|
||||
+ afr_destroy_healer_object(this, healer);
|
||||
|
||||
+ healer = &shd->full_healers[i];
|
||||
+ afr_destroy_healer_object(this, healer);
|
||||
+
|
||||
+ if (shd->statistics[i])
|
||||
+ eh_destroy(shd->statistics[i]);
|
||||
+ }
|
||||
+ GF_FREE(shd->index_healers);
|
||||
+ GF_FREE(shd->full_healers);
|
||||
+ GF_FREE(shd->statistics);
|
||||
+ if (shd->split_brain)
|
||||
+ eh_destroy(shd->split_brain);
|
||||
+}
|
||||
void
|
||||
fini(xlator_t *this)
|
||||
{
|
||||
afr_private_t *priv = NULL;
|
||||
|
||||
priv = this->private;
|
||||
+
|
||||
+ afr_selfheal_daemon_fini(this);
|
||||
+
|
||||
LOCK(&priv->lock);
|
||||
if (priv->timer != NULL) {
|
||||
gf_timer_call_cancel(this->ctx, priv->timer);
|
||||
--
|
||||
1.8.3.1
|
||||
|
336
0105-core-Log-level-changes-do-not-effect-on-running-clie.patch
Normal file
336
0105-core-Log-level-changes-do-not-effect-on-running-clie.patch
Normal file
@ -0,0 +1,336 @@
|
||||
From 023854d5573211d4737eb0ebe7ec954a7b7bb4ee Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Mon, 15 Apr 2019 10:34:34 +0530
|
||||
Subject: [PATCH 105/124] core: Log level changes do not effect on running
|
||||
client process
|
||||
|
||||
Problem: commit c34e4161f3cb6539ec83a9020f3d27eb4759a975 set log-level
|
||||
per xlator during reconfigure only for a brick process not for
|
||||
the client process.
|
||||
|
||||
Solution: 1) Change per xlator log-level only if brick_mux is enabled.To make sure
|
||||
about brick multiplex introudce a flag brick_mux at ctx->cmd_args.
|
||||
|
||||
Note: There are two other changes done with this patch
|
||||
1) Ignore client-log-level option to attach a brick with
|
||||
already running brick if brick_mux is enabled
|
||||
2) Add a log to print pid of the running process to make easier
|
||||
debugging
|
||||
|
||||
> Change-Id: I39e85de778e150d0685cd9a79425ce8b4783f9c9
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> Fixes: bz#1696046
|
||||
> (Cherry picked from commit 798aadbe51a9a02dd98a0f861cc239ecf7c8ed57)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22495/)
|
||||
|
||||
Change-Id: If82cc8e51cf00bd50d3321d31ec420f89786ea02
|
||||
Fixes: bz#1695081
|
||||
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167828
|
||||
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
glusterfsd/src/glusterfsd-messages.h | 2 +-
|
||||
glusterfsd/src/glusterfsd.c | 20 ++++-
|
||||
glusterfsd/src/glusterfsd.h | 1 +
|
||||
libglusterfs/src/glusterfs/glusterfs.h | 1 +
|
||||
tests/bugs/glusterd/bug-1696046.t | 113 +++++++++++++++++++++++++++++
|
||||
xlators/debug/io-stats/src/io-stats.c | 22 +++---
|
||||
xlators/mgmt/glusterd/src/glusterd-utils.c | 7 ++
|
||||
7 files changed, 152 insertions(+), 14 deletions(-)
|
||||
create mode 100644 tests/bugs/glusterd/bug-1696046.t
|
||||
|
||||
diff --git a/glusterfsd/src/glusterfsd-messages.h b/glusterfsd/src/glusterfsd-messages.h
|
||||
index 94312a5..280624c 100644
|
||||
--- a/glusterfsd/src/glusterfsd-messages.h
|
||||
+++ b/glusterfsd/src/glusterfsd-messages.h
|
||||
@@ -36,6 +36,6 @@ GLFS_MSGID(GLUSTERFSD, glusterfsd_msg_1, glusterfsd_msg_2, glusterfsd_msg_3,
|
||||
glusterfsd_msg_31, glusterfsd_msg_32, glusterfsd_msg_33,
|
||||
glusterfsd_msg_34, glusterfsd_msg_35, glusterfsd_msg_36,
|
||||
glusterfsd_msg_37, glusterfsd_msg_38, glusterfsd_msg_39,
|
||||
- glusterfsd_msg_40, glusterfsd_msg_41, glusterfsd_msg_42);
|
||||
+ glusterfsd_msg_40, glusterfsd_msg_41, glusterfsd_msg_42, glusterfsd_msg_43);
|
||||
|
||||
#endif /* !_GLUSTERFSD_MESSAGES_H_ */
|
||||
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c
|
||||
index 3aa89ca..6aee4c1 100644
|
||||
--- a/glusterfsd/src/glusterfsd.c
|
||||
+++ b/glusterfsd/src/glusterfsd.c
|
||||
@@ -85,8 +85,7 @@ static char gf_doc[] = "";
|
||||
static char argp_doc[] =
|
||||
"--volfile-server=SERVER [MOUNT-POINT]\n"
|
||||
"--volfile=VOLFILE [MOUNT-POINT]";
|
||||
-const char *argp_program_version =
|
||||
- PACKAGE_NAME" "PACKAGE_VERSION;
|
||||
+const char *argp_program_version = PACKAGE_NAME " " PACKAGE_VERSION;
|
||||
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
|
||||
|
||||
static error_t
|
||||
@@ -266,6 +265,7 @@ static struct argp_option gf_options[] = {
|
||||
"attribute, dentry and page-cache. "
|
||||
"Disable this only if same files/directories are not accessed across "
|
||||
"two different mounts concurrently [default: \"on\"]"},
|
||||
+ {"brick-mux", ARGP_BRICK_MUX_KEY, 0, 0, "Enable brick mux. "},
|
||||
{0, 0, 0, 0, "Miscellaneous Options:"},
|
||||
{
|
||||
0,
|
||||
@@ -702,7 +702,6 @@ create_fuse_mount(glusterfs_ctx_t *ctx)
|
||||
xlator_t *master = NULL;
|
||||
|
||||
cmd_args = &ctx->cmd_args;
|
||||
-
|
||||
if (!cmd_args->mount_point) {
|
||||
gf_msg_trace("glusterfsd", 0,
|
||||
"mount point not found, not a client process");
|
||||
@@ -1090,6 +1089,10 @@ parse_opts(int key, char *arg, struct argp_state *state)
|
||||
cmd_args->thin_client = _gf_true;
|
||||
break;
|
||||
|
||||
+ case ARGP_BRICK_MUX_KEY:
|
||||
+ cmd_args->brick_mux = _gf_true;
|
||||
+ break;
|
||||
+
|
||||
case ARGP_PID_FILE_KEY:
|
||||
cmd_args->pid_file = gf_strdup(arg);
|
||||
break;
|
||||
@@ -1207,7 +1210,6 @@ parse_opts(int key, char *arg, struct argp_state *state)
|
||||
case ARGP_KEY_ARG:
|
||||
if (state->arg_num >= 1)
|
||||
argp_usage(state);
|
||||
-
|
||||
cmd_args->mount_point = gf_strdup(arg);
|
||||
break;
|
||||
|
||||
@@ -2540,6 +2542,8 @@ postfork:
|
||||
if (ret)
|
||||
goto out;
|
||||
}
|
||||
+ gf_log("glusterfs", GF_LOG_INFO, "Pid of current running process is %d",
|
||||
+ getpid());
|
||||
ret = gf_log_inject_timer_event(ctx);
|
||||
|
||||
glusterfs_signals_setup(ctx);
|
||||
@@ -2787,6 +2791,14 @@ main(int argc, char *argv[])
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
+ /* set brick_mux mode only for server process */
|
||||
+ if ((ctx->process_mode != GF_SERVER_PROCESS) && cmd->brick_mux) {
|
||||
+ gf_msg("glusterfs", GF_LOG_CRITICAL, 0, glusterfsd_msg_43,
|
||||
+ "command line argument --brick-mux is valid only for brick "
|
||||
+ "process");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
/* log the version of glusterfs running here along with the actual
|
||||
command line options. */
|
||||
{
|
||||
diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h
|
||||
index 35cf6d8..fa55789 100644
|
||||
--- a/glusterfsd/src/glusterfsd.h
|
||||
+++ b/glusterfsd/src/glusterfsd.h
|
||||
@@ -111,6 +111,7 @@ enum argp_option_keys {
|
||||
ARGP_FUSE_FLUSH_HANDLE_INTERRUPT_KEY = 189,
|
||||
ARGP_FUSE_LRU_LIMIT_KEY = 190,
|
||||
ARGP_FUSE_AUTO_INVAL_KEY = 191,
|
||||
+ ARGP_BRICK_MUX_KEY = 192
|
||||
};
|
||||
|
||||
struct _gfd_vol_top_priv {
|
||||
diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h
|
||||
index deec5ba..fb727fc 100644
|
||||
--- a/libglusterfs/src/glusterfs/glusterfs.h
|
||||
+++ b/libglusterfs/src/glusterfs/glusterfs.h
|
||||
@@ -575,6 +575,7 @@ struct _cmd_args {
|
||||
|
||||
int fuse_flush_handle_interrupt;
|
||||
int fuse_auto_inval;
|
||||
+ bool brick_mux;
|
||||
};
|
||||
typedef struct _cmd_args cmd_args_t;
|
||||
|
||||
diff --git a/tests/bugs/glusterd/bug-1696046.t b/tests/bugs/glusterd/bug-1696046.t
|
||||
new file mode 100644
|
||||
index 0000000..e1c1eb2
|
||||
--- /dev/null
|
||||
+++ b/tests/bugs/glusterd/bug-1696046.t
|
||||
@@ -0,0 +1,113 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+
|
||||
+cleanup;
|
||||
+
|
||||
+function count_up_bricks {
|
||||
+ $CLI --xml volume status $1 | grep '<status>1' | wc -l
|
||||
+}
|
||||
+
|
||||
+function count_brick_processes {
|
||||
+ pgrep glusterfsd | wc -l
|
||||
+}
|
||||
+
|
||||
+logdir=`gluster --print-logdir`
|
||||
+
|
||||
+## Start and create a volume
|
||||
+TEST glusterd;
|
||||
+TEST pidof glusterd;
|
||||
+
|
||||
+TEST $CLI volume set all cluster.brick-multiplex on
|
||||
+TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3};
|
||||
+TEST $CLI volume create $V1 replica 3 $H0:$B0/${V1}{1,2,3};
|
||||
+
|
||||
+## Start volume and verify
|
||||
+TEST $CLI volume start $V0;
|
||||
+EXPECT 'Started' volinfo_field $V0 'Status';
|
||||
+TEST $CLI volume start $V1;
|
||||
+EXPECT 'Started' volinfo_field $V1 'Status';
|
||||
+
|
||||
+
|
||||
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 4 count_up_bricks $V0
|
||||
+EXPECT_WITHIN $PROCESS_UP_TIMEOUT 4 count_up_bricks $V1
|
||||
+
|
||||
+EXPECT 1 count_brick_processes
|
||||
+
|
||||
+# Mount V0
|
||||
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
|
||||
+
|
||||
+function client-log-file-name()
|
||||
+{
|
||||
+ logfilename=$M0".log"
|
||||
+ echo ${logfilename:1} | tr / -
|
||||
+}
|
||||
+
|
||||
+function brick-log-file-name()
|
||||
+{
|
||||
+ logfilename=$B0"/"$V0"1.log"
|
||||
+ echo ${logfilename:1} | tr / -
|
||||
+}
|
||||
+
|
||||
+log_file=$logdir"/"`client-log-file-name`
|
||||
+nofdlog=$(cat $log_file | grep " D " | wc -l)
|
||||
+TEST [ $((nofdlog)) -eq 0 ]
|
||||
+
|
||||
+brick_log_file=$logdir"/bricks/"`brick-log-file-name`
|
||||
+nofdlog=$(cat $brick_log_file | grep " D " | wc -l)
|
||||
+TEST [ $((nofdlog)) -eq 0 ]
|
||||
+
|
||||
+## Set brick-log-level to DEBUG
|
||||
+TEST $CLI volume set $V0 diagnostics.brick-log-level DEBUG
|
||||
+
|
||||
+# Do some operation
|
||||
+touch $M0/file1
|
||||
+
|
||||
+# Check debug message debug message should be exist only for V0
|
||||
+# Server xlator is common in brick_mux so after enabling DEBUG log
|
||||
+# some debug message should be available for other xlators like posix
|
||||
+
|
||||
+brick_log_file=$logdir"/bricks/"`brick-log-file-name`
|
||||
+nofdlog=$(cat $brick_log_file | grep file1 | grep -v server | wc -l)
|
||||
+TEST [ $((nofdlog)) -ne 0 ]
|
||||
+
|
||||
+#Check if any debug log exist in client-log file
|
||||
+nofdlog=$(cat $log_file | grep " D " | wc -l)
|
||||
+TEST [ $((nofdlog)) -eq 0 ]
|
||||
+
|
||||
+## Set brick-log-level to INFO
|
||||
+TEST $CLI volume set $V0 diagnostics.brick-log-level INFO
|
||||
+
|
||||
+## Set client-log-level to DEBUG
|
||||
+TEST $CLI volume set $V0 diagnostics.client-log-level DEBUG
|
||||
+
|
||||
+# Do some operation
|
||||
+touch $M0/file2
|
||||
+
|
||||
+nofdlog=$(cat $brick_log_file | grep " D " | grep file2 | wc -l)
|
||||
+TEST [ $((nofdlog)) -eq 0 ]
|
||||
+
|
||||
+nofdlog=$(cat $log_file | grep " D " | wc -l)
|
||||
+TEST [ $((nofdlog)) -ne 0 ]
|
||||
+
|
||||
+# Unmount V0
|
||||
+TEST umount $M0
|
||||
+
|
||||
+#Mount V1
|
||||
+TEST glusterfs --volfile-id=$V1 --volfile-server=$H0 --entry-timeout=0 $M0;
|
||||
+
|
||||
+#do some operation
|
||||
+touch $M0/file3
|
||||
+
|
||||
+
|
||||
+# DEBUG log level is enabled only for V0 so no debug message should be available
|
||||
+# in log specific to file2 creation except for server xlator, server xlator is
|
||||
+# common xlator in brick mulitplex
|
||||
+nofdlog=$(cat $brick_log_file | grep file3 | grep -v server | wc -l)
|
||||
+TEST [ $((nofdlog)) -eq 0 ]
|
||||
+
|
||||
+# Unmount V1
|
||||
+TEST umount $M0
|
||||
+
|
||||
+cleanup;
|
||||
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
|
||||
index 41b57c5..aa91a0a 100644
|
||||
--- a/xlators/debug/io-stats/src/io-stats.c
|
||||
+++ b/xlators/debug/io-stats/src/io-stats.c
|
||||
@@ -3704,19 +3704,23 @@ xlator_set_loglevel(xlator_t *this, int log_level)
|
||||
active = ctx->active;
|
||||
top = active->first;
|
||||
|
||||
- if (strcmp(top->type, "protocol/server") || (log_level == -1))
|
||||
+ if (log_level == -1)
|
||||
return;
|
||||
|
||||
- /* Set log-level for server xlator */
|
||||
- top->loglevel = log_level;
|
||||
+ if (ctx->cmd_args.brick_mux) {
|
||||
+ /* Set log-level for all brick xlators */
|
||||
+ top->loglevel = log_level;
|
||||
|
||||
- /* Set log-level for parent xlator */
|
||||
- if (this->parents)
|
||||
- this->parents->xlator->loglevel = log_level;
|
||||
+ /* Set log-level for parent xlator */
|
||||
+ if (this->parents)
|
||||
+ this->parents->xlator->loglevel = log_level;
|
||||
|
||||
- while (trav) {
|
||||
- trav->loglevel = log_level;
|
||||
- trav = trav->next;
|
||||
+ while (trav) {
|
||||
+ trav->loglevel = log_level;
|
||||
+ trav = trav->next;
|
||||
+ }
|
||||
+ } else {
|
||||
+ gf_log_set_loglevel(this->ctx, log_level);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
index 2dd5f91..fdd7d91 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
@@ -2240,6 +2240,9 @@ retry:
|
||||
if (volinfo->memory_accounting)
|
||||
runner_add_arg(&runner, "--mem-accounting");
|
||||
|
||||
+ if (is_brick_mx_enabled())
|
||||
+ runner_add_arg(&runner, "--brick-mux");
|
||||
+
|
||||
runner_log(&runner, "", 0, "Starting GlusterFS");
|
||||
|
||||
brickinfo->port = port;
|
||||
@@ -2378,6 +2381,10 @@ unsafe_option(dict_t *this, char *key, data_t *value, void *arg)
|
||||
return _gf_false;
|
||||
}
|
||||
|
||||
+ if (fnmatch("*diagnostics.client-log*", key, 0) == 0) {
|
||||
+ return _gf_false;
|
||||
+ }
|
||||
+
|
||||
return _gf_true;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
111
0106-libgfchangelog-use-find_library-to-locate-shared-lib.patch
Normal file
111
0106-libgfchangelog-use-find_library-to-locate-shared-lib.patch
Normal file
@ -0,0 +1,111 @@
|
||||
From 55d945603bb52f0787c5200118673d6206ec3492 Mon Sep 17 00:00:00 2001
|
||||
From: Sunny Kumar <sunkumar@redhat.com>
|
||||
Date: Fri, 12 Apr 2019 19:55:10 +0530
|
||||
Subject: [PATCH 106/124] libgfchangelog : use find_library to locate shared
|
||||
library
|
||||
|
||||
Issue:
|
||||
|
||||
libgfchangelog.so: cannot open shared object file
|
||||
|
||||
Due to hardcoded shared library name runtime loader looks for particular version of
|
||||
a shared library.
|
||||
|
||||
Solution:
|
||||
|
||||
Using find_library to locate shared library at runtime solves this issue.
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "/usr/libexec/glusterfs/python/syncdaemon/gsyncd.py", line 323, in main
|
||||
func(args)
|
||||
File "/usr/libexec/glusterfs/python/syncdaemon/subcmds.py", line 82, in subcmd_worker
|
||||
local.service_loop(remote)
|
||||
File "/usr/libexec/glusterfs/python/syncdaemon/resource.py", line 1261, in service_loop
|
||||
changelog_agent.init()
|
||||
File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", line 233, in __call__
|
||||
return self.ins(self.meth, *a)
|
||||
File "/usr/libexec/glusterfs/python/syncdaemon/repce.py", line 215, in __call__
|
||||
raise res
|
||||
OSError: libgfchangelog.so: cannot open shared object file: No such file or directory
|
||||
|
||||
>Upstream Patch: https://review.gluster.org/#/c/glusterfs/+/22557/
|
||||
>Change-Id: I3dd013d701ed1cd99ba7ef20d1898f343e1db8f5
|
||||
>fixes: bz#1699394
|
||||
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
||||
|
||||
fixes: bz#1699271
|
||||
Change-Id: If8b5827cdac658eb3a211109bd397db9a6fee8e6
|
||||
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167907
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
geo-replication/syncdaemon/libgfchangelog.py | 3 ++-
|
||||
tools/glusterfind/src/libgfchangelog.py | 7 +++----
|
||||
xlators/features/changelog/lib/examples/python/libgfchangelog.py | 4 +++-
|
||||
3 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/geo-replication/syncdaemon/libgfchangelog.py b/geo-replication/syncdaemon/libgfchangelog.py
|
||||
index fff9d24..8d12956 100644
|
||||
--- a/geo-replication/syncdaemon/libgfchangelog.py
|
||||
+++ b/geo-replication/syncdaemon/libgfchangelog.py
|
||||
@@ -10,13 +10,14 @@
|
||||
|
||||
import os
|
||||
from ctypes import CDLL, RTLD_GLOBAL, get_errno, byref, c_ulong
|
||||
+from ctypes.util import find_library
|
||||
from syncdutils import ChangelogException, ChangelogHistoryNotAvailable
|
||||
from py2py3 import gr_cl_history_changelog, gr_cl_done, gr_create_string_buffer
|
||||
from py2py3 import gr_cl_register, gr_cl_history_done, bytearray_to_str
|
||||
|
||||
|
||||
class Changes(object):
|
||||
- libgfc = CDLL("libgfchangelog.so", mode=RTLD_GLOBAL,
|
||||
+ libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL,
|
||||
use_errno=True)
|
||||
|
||||
@classmethod
|
||||
diff --git a/tools/glusterfind/src/libgfchangelog.py b/tools/glusterfind/src/libgfchangelog.py
|
||||
index 1ef177a..513bb10 100644
|
||||
--- a/tools/glusterfind/src/libgfchangelog.py
|
||||
+++ b/tools/glusterfind/src/libgfchangelog.py
|
||||
@@ -9,8 +9,8 @@
|
||||
# cases as published by the Free Software Foundation.
|
||||
|
||||
import os
|
||||
-from ctypes import CDLL, get_errno, create_string_buffer, c_ulong, byref
|
||||
-from ctypes import RTLD_GLOBAL
|
||||
+from ctypes import CDLL, RTLD_GLOBAL, get_errno, create_string_buffer, c_ulong, byref
|
||||
+from ctypes.util import find_library
|
||||
from gfind_py2py3 import bytearray_to_str, gf_create_string_buffer
|
||||
from gfind_py2py3 import gfind_history_changelog, gfind_changelog_register
|
||||
from gfind_py2py3 import gfind_history_changelog_done
|
||||
@@ -19,8 +19,7 @@ from gfind_py2py3 import gfind_history_changelog_done
|
||||
class ChangelogException(OSError):
|
||||
pass
|
||||
|
||||
-
|
||||
-libgfc = CDLL("libgfchangelog.so", use_errno=True, mode=RTLD_GLOBAL)
|
||||
+libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL, use_errno=True)
|
||||
|
||||
|
||||
def raise_oserr(prefix=None):
|
||||
diff --git a/xlators/features/changelog/lib/examples/python/libgfchangelog.py b/xlators/features/changelog/lib/examples/python/libgfchangelog.py
|
||||
index 2cdbf11..2da9f2d 100644
|
||||
--- a/xlators/features/changelog/lib/examples/python/libgfchangelog.py
|
||||
+++ b/xlators/features/changelog/lib/examples/python/libgfchangelog.py
|
||||
@@ -1,8 +1,10 @@
|
||||
import os
|
||||
from ctypes import *
|
||||
+from ctypes.util import find_library
|
||||
|
||||
class Changes(object):
|
||||
- libgfc = CDLL("libgfchangelog.so", mode=RTLD_GLOBAL, use_errno=True)
|
||||
+ libgfc = CDLL(find_library("gfchangelog"), mode=RTLD_GLOBAL,
|
||||
+ use_errno=True)
|
||||
|
||||
@classmethod
|
||||
def geterrno(cls):
|
||||
--
|
||||
1.8.3.1
|
||||
|
93
0107-gfapi-add-function-to-set-client-pid.patch
Normal file
93
0107-gfapi-add-function-to-set-client-pid.patch
Normal file
@ -0,0 +1,93 @@
|
||||
From 799a74e5e8123cd2e67e9ed5c0f986630a8e0547 Mon Sep 17 00:00:00 2001
|
||||
From: Ravishankar N <ravishankar@redhat.com>
|
||||
Date: Thu, 14 Mar 2019 18:41:11 +0530
|
||||
Subject: [PATCH 107/124] gfapi: add function to set client-pid
|
||||
|
||||
This api offers the ability to set the pid of a client to a particular
|
||||
value, identical to how gluster fuse clients provide the --client-pid
|
||||
option. This is an internal API to be used by gluster processes only. See
|
||||
https://lists.gluster.org/pipermail/gluster-devel/2019-March/055925.html
|
||||
for more details. Currently glfsheal is the only proposed consumer.
|
||||
|
||||
Patch on upstream master: https://review.gluster.org/#/c/glusterfs/+/22368/
|
||||
Change-Id: I0620be2127d79d69cdd57cffb29bba44e6e5da1f
|
||||
BUG 1676495
|
||||
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/166459
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
api/src/gfapi.aliases | 1 +
|
||||
api/src/gfapi.map | 4 ++++
|
||||
api/src/glfs-internal.h | 6 ++++++
|
||||
api/src/glfs.c | 15 +++++++++++++++
|
||||
4 files changed, 26 insertions(+)
|
||||
|
||||
diff --git a/api/src/gfapi.aliases b/api/src/gfapi.aliases
|
||||
index 25e2d74..09c0fd8 100644
|
||||
--- a/api/src/gfapi.aliases
|
||||
+++ b/api/src/gfapi.aliases
|
||||
@@ -172,6 +172,7 @@ _pub_glfs_upcall_lease_get_lease_type _glfs_upcall_lease_get_lease_type$GFAPI_4.
|
||||
|
||||
_priv_glfs_statx _glfs_statx$GFAPI_6.0
|
||||
_priv_glfs_iatt_from_statx _glfs_iatt_from_statx$GFAPI_6.0
|
||||
+_priv_glfs_setfspid _glfs_setfspid$GFAPI_6.1
|
||||
|
||||
_pub_glfs_read_async _glfs_read_async$GFAPI_6.0
|
||||
_pub_glfs_write_async _glfs_write_async$GFAPI_6.0
|
||||
diff --git a/api/src/gfapi.map b/api/src/gfapi.map
|
||||
index bb201c7..b97a614 100644
|
||||
--- a/api/src/gfapi.map
|
||||
+++ b/api/src/gfapi.map
|
||||
@@ -267,3 +267,7 @@ GFAPI_6.0 {
|
||||
glfs_fsetattr;
|
||||
} GFAPI_PRIVATE_6.0;
|
||||
|
||||
+GFAPI_PRIVATE_6.1 {
|
||||
+ global:
|
||||
+ glfs_setfspid;
|
||||
+} GFAPI_6.0;
|
||||
diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h
|
||||
index 40bbb8a..55401b2 100644
|
||||
--- a/api/src/glfs-internal.h
|
||||
+++ b/api/src/glfs-internal.h
|
||||
@@ -702,4 +702,10 @@ void
|
||||
glfs_iatt_from_statx(struct iatt *, const struct glfs_stat *)
|
||||
GFAPI_PRIVATE(glfs_iatt_from_statx, 6.0);
|
||||
|
||||
+/*
|
||||
+ * This API is a per thread setting, similar to glfs_setfs{u/g}id, because of
|
||||
+ * the call to syncopctx_setfspid.
|
||||
+ */
|
||||
+int
|
||||
+glfs_setfspid(struct glfs *, pid_t) GFAPI_PRIVATE(glfs_setfspid, 6.1);
|
||||
#endif /* !_GLFS_INTERNAL_H */
|
||||
diff --git a/api/src/glfs.c b/api/src/glfs.c
|
||||
index b741f6e..f4a8e08 100644
|
||||
--- a/api/src/glfs.c
|
||||
+++ b/api/src/glfs.c
|
||||
@@ -1461,6 +1461,21 @@ invalid_fs:
|
||||
|
||||
GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_ipc, 3.12.0);
|
||||
|
||||
+int
|
||||
+priv_glfs_setfspid(struct glfs *fs, pid_t pid)
|
||||
+{
|
||||
+ cmd_args_t *cmd_args = NULL;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ cmd_args = &fs->ctx->cmd_args;
|
||||
+ cmd_args->client_pid = pid;
|
||||
+ cmd_args->client_pid_set = 1;
|
||||
+ ret = syncopctx_setfspid(&pid);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+GFAPI_SYMVER_PRIVATE_DEFAULT(glfs_setfspid, 6.1);
|
||||
+
|
||||
void
|
||||
pub_glfs_free(void *ptr)
|
||||
{
|
||||
--
|
||||
1.8.3.1
|
||||
|
225
0108-afr-add-client-pid-to-all-gf_event-calls.patch
Normal file
225
0108-afr-add-client-pid-to-all-gf_event-calls.patch
Normal file
@ -0,0 +1,225 @@
|
||||
From ba1460a4fee0c41c7d7f7a2043bae37f7e751259 Mon Sep 17 00:00:00 2001
|
||||
From: Ravishankar N <ravishankar@redhat.com>
|
||||
Date: Fri, 15 Mar 2019 19:31:03 +0530
|
||||
Subject: [PATCH 108/124] afr: add client-pid to all gf_event() calls
|
||||
|
||||
client-pid for glustershd is GF_CLIENT_PID_SELF_HEALD
|
||||
client-pid for glfsheal is GF_CLIENT_PID_GLFS_HEALD
|
||||
|
||||
Patch on upstream master: https://review.gluster.org/#/c/glusterfs/+/22369/
|
||||
BUG: 1676495
|
||||
Change-Id: Ib3a863af160ff48c822a5e6b0c27c575c9887470
|
||||
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/166460
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
heal/src/glfs-heal.c | 6 ++++++
|
||||
xlators/cluster/afr/src/afr-common.c | 12 ++++++++----
|
||||
xlators/cluster/afr/src/afr-self-heal-common.c | 11 +++++++----
|
||||
xlators/cluster/afr/src/afr-self-heal-data.c | 4 +++-
|
||||
xlators/cluster/afr/src/afr-self-heal-entry.c | 5 +++--
|
||||
xlators/cluster/afr/src/afr-self-heal-metadata.c | 4 +++-
|
||||
xlators/cluster/afr/src/afr-self-heal-name.c | 7 ++++---
|
||||
xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 10 ++++++++++
|
||||
8 files changed, 44 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
|
||||
index 6030de3..7e37e47 100644
|
||||
--- a/heal/src/glfs-heal.c
|
||||
+++ b/heal/src/glfs-heal.c
|
||||
@@ -1688,6 +1688,12 @@ main(int argc, char **argv)
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ ret = glfs_setfspid(fs, GF_CLIENT_PID_GLFS_HEAL);
|
||||
+ if (ret) {
|
||||
+ printf("Setting client pid failed, %s\n", strerror(errno));
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
ret = glfs_init(fs);
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
|
||||
index 47a5d3a..3690b84 100644
|
||||
--- a/xlators/cluster/afr/src/afr-common.c
|
||||
+++ b/xlators/cluster/afr/src/afr-common.c
|
||||
@@ -5233,7 +5233,8 @@ __afr_handle_child_up_event(xlator_t *this, xlator_t *child_xlator,
|
||||
"Subvolume '%s' came back up; "
|
||||
"going online.",
|
||||
child_xlator->name);
|
||||
- gf_event(EVENT_AFR_SUBVOL_UP, "subvol=%s", this->name);
|
||||
+ gf_event(EVENT_AFR_SUBVOL_UP, "client-pid=%d; subvol=%s",
|
||||
+ this->ctx->cmd_args.client_pid, this->name);
|
||||
} else {
|
||||
*event = GF_EVENT_SOME_DESCENDENT_UP;
|
||||
}
|
||||
@@ -5310,7 +5311,8 @@ __afr_handle_child_down_event(xlator_t *this, xlator_t *child_xlator, int idx,
|
||||
"All subvolumes are down. Going "
|
||||
"offline until at least one of them "
|
||||
"comes back up.");
|
||||
- gf_event(EVENT_AFR_SUBVOLS_DOWN, "subvol=%s", this->name);
|
||||
+ gf_event(EVENT_AFR_SUBVOLS_DOWN, "client-pid=%d; subvol=%s",
|
||||
+ this->ctx->cmd_args.client_pid, this->name);
|
||||
} else {
|
||||
*event = GF_EVENT_SOME_DESCENDENT_DOWN;
|
||||
}
|
||||
@@ -5585,12 +5587,14 @@ afr_notify(xlator_t *this, int32_t event, void *data, void *data2)
|
||||
if (!had_quorum && has_quorum) {
|
||||
gf_msg(this->name, GF_LOG_INFO, 0, AFR_MSG_QUORUM_MET,
|
||||
"Client-quorum is met");
|
||||
- gf_event(EVENT_AFR_QUORUM_MET, "subvol=%s", this->name);
|
||||
+ gf_event(EVENT_AFR_QUORUM_MET, "client-pid=%d; subvol=%s",
|
||||
+ this->ctx->cmd_args.client_pid, this->name);
|
||||
}
|
||||
if (had_quorum && !has_quorum) {
|
||||
gf_msg(this->name, GF_LOG_WARNING, 0, AFR_MSG_QUORUM_FAIL,
|
||||
"Client-quorum is not met");
|
||||
- gf_event(EVENT_AFR_QUORUM_FAIL, "subvol=%s", this->name);
|
||||
+ gf_event(EVENT_AFR_QUORUM_FAIL, "client-pid=%d; subvol=%s",
|
||||
+ this->ctx->cmd_args.client_pid, this->name);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
|
||||
index 2268761..595bed4 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
|
||||
@@ -383,11 +383,12 @@ out:
|
||||
uuid_utoa_r(replies[src_idx].poststat.ia_gfid, g2),
|
||||
priv->children[src_idx]->name);
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;type=gfid;file="
|
||||
"<gfid:%s>/%s>;count=2;child-%d=%s;gfid-%d=%s;"
|
||||
"child-%d=%s;gfid-%d=%s",
|
||||
- this->name, uuid_utoa(pargfid), bname, child_idx,
|
||||
- priv->children[child_idx]->name, child_idx,
|
||||
+ this->ctx->cmd_args.client_pid, this->name, uuid_utoa(pargfid),
|
||||
+ bname, child_idx, priv->children[child_idx]->name, child_idx,
|
||||
uuid_utoa_r(replies[child_idx].poststat.ia_gfid, g1), src_idx,
|
||||
priv->children[src_idx]->name, src_idx,
|
||||
uuid_utoa_r(replies[src_idx].poststat.ia_gfid, g2));
|
||||
@@ -2296,11 +2297,13 @@ afr_selfheal_unlocked_inspect(call_frame_t *frame, xlator_t *this, uuid_t gfid,
|
||||
priv->children[i]->name,
|
||||
uuid_utoa(replies[i].poststat.ia_gfid));
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;"
|
||||
"type=file;gfid=%s;"
|
||||
"ia_type-%d=%s;ia_type-%d=%s",
|
||||
- this->name, uuid_utoa(replies[i].poststat.ia_gfid),
|
||||
- first_idx, gf_inode_type_to_str(first.ia_type), i,
|
||||
+ this->ctx->cmd_args.client_pid, this->name,
|
||||
+ uuid_utoa(replies[i].poststat.ia_gfid), first_idx,
|
||||
+ gf_inode_type_to_str(first.ia_type), i,
|
||||
gf_inode_type_to_str(replies[i].poststat.ia_type));
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
|
||||
index d9a0ee3..18a0334 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
|
||||
@@ -537,9 +537,11 @@ __afr_selfheal_data_finalize_source(
|
||||
replies, AFR_DATA_TRANSACTION);
|
||||
if (source < 0) {
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;type=data;"
|
||||
"file=%s",
|
||||
- this->name, uuid_utoa(inode->gfid));
|
||||
+ this->ctx->cmd_args.client_pid, this->name,
|
||||
+ uuid_utoa(inode->gfid));
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
|
||||
index b23ed6a..fc09b4c 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
|
||||
@@ -269,11 +269,12 @@ afr_selfheal_detect_gfid_and_type_mismatch(xlator_t *this,
|
||||
gf_inode_type_to_str(replies[src_idx].poststat.ia_type),
|
||||
priv->children[src_idx]->name);
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;type=file;"
|
||||
"file=<gfid:%s>/%s>;count=2;child-%d=%s;type-"
|
||||
"%d=%s;child-%d=%s;type-%d=%s",
|
||||
- this->name, uuid_utoa(pargfid), bname, i,
|
||||
- priv->children[i]->name, i,
|
||||
+ this->ctx->cmd_args.client_pid, this->name,
|
||||
+ uuid_utoa(pargfid), bname, i, priv->children[i]->name, i,
|
||||
gf_inode_type_to_str(replies[i].poststat.ia_type), src_idx,
|
||||
priv->children[src_idx]->name, src_idx,
|
||||
gf_inode_type_to_str(replies[src_idx].poststat.ia_type));
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
|
||||
index a661fcb..ba43341 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
|
||||
@@ -242,9 +242,11 @@ __afr_selfheal_metadata_finalize_source(call_frame_t *frame, xlator_t *this,
|
||||
|
||||
if (!priv->metadata_splitbrain_forced_heal) {
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;"
|
||||
"type=metadata;file=%s",
|
||||
- this->name, uuid_utoa(inode->gfid));
|
||||
+ this->ctx->cmd_args.client_pid, this->name,
|
||||
+ uuid_utoa(inode->gfid));
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c
|
||||
index c4df5d4..36640b5 100644
|
||||
--- a/xlators/cluster/afr/src/afr-self-heal-name.c
|
||||
+++ b/xlators/cluster/afr/src/afr-self-heal-name.c
|
||||
@@ -222,13 +222,14 @@ afr_selfheal_name_type_mismatch_check(xlator_t *this, struct afr_reply *replies,
|
||||
gf_inode_type_to_str(inode_type),
|
||||
priv->children[type_idx]->name);
|
||||
gf_event(EVENT_AFR_SPLIT_BRAIN,
|
||||
+ "client-pid=%d;"
|
||||
"subvol=%s;type=file;"
|
||||
"file=<gfid:%s>/%s;count=2;"
|
||||
"child-%d=%s;type-%d=%s;child-%d=%s;"
|
||||
"type-%d=%s",
|
||||
- this->name, uuid_utoa(pargfid), bname, i,
|
||||
- priv->children[i]->name, i,
|
||||
- gf_inode_type_to_str(inode_type1), type_idx,
|
||||
+ this->ctx->cmd_args.client_pid, this->name,
|
||||
+ uuid_utoa(pargfid), bname, i, priv->children[i]->name,
|
||||
+ i, gf_inode_type_to_str(inode_type1), type_idx,
|
||||
priv->children[type_idx]->name, type_idx,
|
||||
gf_inode_type_to_str(inode_type));
|
||||
return -EIO;
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
index 04a4b2e..19eca9f 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
@@ -324,6 +324,7 @@ glusterd_new_shd_svc_start(glusterd_svc_t *svc, int flags)
|
||||
{
|
||||
int ret = -1;
|
||||
char glusterd_uuid_option[PATH_MAX] = {0};
|
||||
+ char client_pid[32] = {0};
|
||||
dict_t *cmdline = NULL;
|
||||
|
||||
cmdline = dict_new();
|
||||
@@ -335,6 +336,15 @@ glusterd_new_shd_svc_start(glusterd_svc_t *svc, int flags)
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
+ ret = snprintf(client_pid, sizeof(client_pid), "--client-pid=%d",
|
||||
+ GF_CLIENT_PID_SELF_HEALD);
|
||||
+ if (ret < 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ ret = dict_set_str(cmdline, "arg", client_pid);
|
||||
+ if (ret < 0)
|
||||
+ goto out;
|
||||
+
|
||||
/* Pass cmdline arguments as key-value pair. The key is merely
|
||||
* a carrier and is not used. Since dictionary follows LIFO the value
|
||||
* should be put in reverse order*/
|
||||
--
|
||||
1.8.3.1
|
||||
|
613
0109-glusterd-Optimize-glusterd-handshaking-code-path.patch
Normal file
613
0109-glusterd-Optimize-glusterd-handshaking-code-path.patch
Normal file
@ -0,0 +1,613 @@
|
||||
From aff18f761ef64d55635daa9a1d2140fe35632820 Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Date: Fri, 29 Mar 2019 11:48:32 +0530
|
||||
Subject: [PATCH 109/124] glusterd: Optimize glusterd handshaking code path
|
||||
|
||||
Problem: At the time of handshaking glusterd populate volume
|
||||
data in a dictionary.While no. of volumes are configured
|
||||
more than 1500 glusterd takes more than 10 min to generated
|
||||
the data.Due to taking more time rpc request times out and
|
||||
rpc start bailing of call frames.
|
||||
|
||||
Solution: To optimize the code done below changes
|
||||
1) Spawn multiple threads to populate volumes data in bulk
|
||||
in separate dictionary and introduce an option
|
||||
glusterd.brick-dict-thread-count to configure no. of threads
|
||||
to populate volume data.
|
||||
2) Populate tier data only while volume type is tier
|
||||
3) Compare snap data only while snap_count is non zero
|
||||
|
||||
> Fixes: bz#1699339
|
||||
> Change-Id: I38dc71970c049217f9d1a06fc0aaf4c26eab18f5
|
||||
> Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
> (Cherry picked from commit 26a19d9da3ab5604db02d4ca02ce868fb57193a4)
|
||||
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22556/)
|
||||
|
||||
Bug: 1652461
|
||||
Change-Id: Ia81671a7e1f173bcb32da9dc439be9e61c18bde1
|
||||
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/167981
|
||||
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
---
|
||||
libglusterfs/src/glusterfs/globals.h | 4 +-
|
||||
tests/bugs/glusterd/bug-1699339.t | 69 ++++++
|
||||
xlators/mgmt/glusterd/src/glusterd-op-sm.c | 1 +
|
||||
.../mgmt/glusterd/src/glusterd-snapshot-utils.c | 3 +
|
||||
xlators/mgmt/glusterd/src/glusterd-utils.c | 269 +++++++++++++++++----
|
||||
xlators/mgmt/glusterd/src/glusterd-volume-set.c | 55 +++++
|
||||
xlators/mgmt/glusterd/src/glusterd.h | 10 +
|
||||
7 files changed, 362 insertions(+), 49 deletions(-)
|
||||
create mode 100644 tests/bugs/glusterd/bug-1699339.t
|
||||
|
||||
diff --git a/libglusterfs/src/glusterfs/globals.h b/libglusterfs/src/glusterfs/globals.h
|
||||
index 6642ba0..e45db14 100644
|
||||
--- a/libglusterfs/src/glusterfs/globals.h
|
||||
+++ b/libglusterfs/src/glusterfs/globals.h
|
||||
@@ -50,7 +50,7 @@
|
||||
1 /* MIN is the fresh start op-version, mostly \
|
||||
should not change */
|
||||
#define GD_OP_VERSION_MAX \
|
||||
- GD_OP_VERSION_6_0 /* MAX VERSION is the maximum \
|
||||
+ GD_OP_VERSION_7_0 /* MAX VERSION is the maximum \
|
||||
count in VME table, should \
|
||||
keep changing with \
|
||||
introduction of newer \
|
||||
@@ -134,6 +134,8 @@
|
||||
|
||||
#define GD_OP_VERSION_6_0 60000 /* Op-version for GlusterFS 6.0 */
|
||||
|
||||
+#define GD_OP_VERSION_7_0 70000 /* Op-version for GlusterFS 7.0 */
|
||||
+
|
||||
#include "glusterfs/xlator.h"
|
||||
#include "glusterfs/options.h"
|
||||
|
||||
diff --git a/tests/bugs/glusterd/bug-1699339.t b/tests/bugs/glusterd/bug-1699339.t
|
||||
new file mode 100644
|
||||
index 0000000..3e950f4
|
||||
--- /dev/null
|
||||
+++ b/tests/bugs/glusterd/bug-1699339.t
|
||||
@@ -0,0 +1,69 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+. $(dirname $0)/../../cluster.rc
|
||||
+
|
||||
+cleanup;
|
||||
+
|
||||
+NUM_VOLS=15
|
||||
+
|
||||
+
|
||||
+get_brick_base () {
|
||||
+ printf "%s/vol%02d" $B0 $1
|
||||
+}
|
||||
+
|
||||
+function count_up_bricks {
|
||||
+ vol=$1;
|
||||
+ $CLI_1 --xml volume status $vol | grep '<status>1' | wc -l
|
||||
+}
|
||||
+
|
||||
+create_volume () {
|
||||
+
|
||||
+ local vol_name=$(printf "%s-vol%02d" $V0 $1)
|
||||
+
|
||||
+ TEST $CLI_1 volume create $vol_name replica 3 $H1:$B1/${vol_name} $H2:$B2/${vol_name} $H3:$B3/${vol_name}
|
||||
+ TEST $CLI_1 volume start $vol_name
|
||||
+}
|
||||
+
|
||||
+TEST launch_cluster 3
|
||||
+TEST $CLI_1 volume set all cluster.brick-multiplex on
|
||||
+
|
||||
+# The option accepts the value in the range from 5 to 200
|
||||
+TEST ! $CLI_1 volume set all glusterd.vol_count_per_thread 210
|
||||
+TEST ! $CLI_1 volume set all glusterd.vol_count_per_thread 4
|
||||
+
|
||||
+TEST $CLI_1 volume set all glusterd.vol_count_per_thread 5
|
||||
+
|
||||
+TEST $CLI_1 peer probe $H2;
|
||||
+EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count
|
||||
+
|
||||
+TEST $CLI_1 peer probe $H3;
|
||||
+EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count
|
||||
+
|
||||
+# Our infrastructure can't handle an arithmetic expression here. The formula
|
||||
+# is (NUM_VOLS-1)*5 because it sees each TEST/EXPECT once but needs the other
|
||||
+# NUM_VOLS-1 and there are 5 such statements in each iteration.
|
||||
+TESTS_EXPECTED_IN_LOOP=28
|
||||
+for i in $(seq 1 $NUM_VOLS); do
|
||||
+ starttime="$(date +%s)";
|
||||
+ create_volume $i
|
||||
+done
|
||||
+
|
||||
+TEST kill_glusterd 1
|
||||
+
|
||||
+vol1=$(printf "%s-vol%02d" $V0 1)
|
||||
+TEST $CLI_2 volume set $vol1 performance.readdir-ahead on
|
||||
+vol2=$(printf "%s-vol%02d" $V0 2)
|
||||
+TEST $CLI_2 volume set $vol2 performance.readdir-ahead on
|
||||
+
|
||||
+# Bring back 1st glusterd
|
||||
+TEST $glusterd_1
|
||||
+EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count
|
||||
+
|
||||
+EXPECT_WITHIN $PROBE_TIMEOUT "on" volinfo_field_1 $vol1 performance.readdir-ahead
|
||||
+
|
||||
+vol_name=$(printf "%s-vol%02d" $V0 2)
|
||||
+EXPECT_WITHIN $PROBE_TIMEOUT "on" volinfo_field_1 $vol2 performance.readdir-ahead
|
||||
+
|
||||
+cleanup
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
index 95f9707..94a5e1f 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
|
||||
@@ -87,6 +87,7 @@ glusterd_all_vol_opts valid_all_vol_opts[] = {
|
||||
* TBD: Discuss the default value for this. Maybe this should be a
|
||||
* dynamic value depending on the memory specifications per node */
|
||||
{GLUSTERD_BRICKMUX_LIMIT_KEY, GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE},
|
||||
+ {GLUSTERD_VOL_CNT_PER_THRD, GLUSTERD_VOL_CNT_PER_THRD_DEFAULT_VALUE},
|
||||
/*{GLUSTERD_LOCALTIME_LOGGING_KEY, "disable"},*/
|
||||
{GLUSTERD_DAEMON_LOG_LEVEL_KEY, "INFO"},
|
||||
{NULL},
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
index b3c4158..d225854 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot-utils.c
|
||||
@@ -2099,6 +2099,9 @@ glusterd_compare_friend_snapshots(dict_t *peer_data, char *peername,
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (!snap_count)
|
||||
+ goto out;
|
||||
+
|
||||
for (i = 1; i <= snap_count; i++) {
|
||||
/* Compare one snapshot from peer_data at a time */
|
||||
ret = glusterd_compare_snap(peer_data, i, peername, peerid);
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
index fdd7d91..ff6102b 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
|
||||
@@ -155,6 +155,47 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+int
|
||||
+get_gd_vol_thread_limit(int *thread_limit)
|
||||
+{
|
||||
+ char *value = NULL;
|
||||
+ int ret = -1;
|
||||
+ int vol_per_thread_limit = 0;
|
||||
+ xlator_t *this = NULL;
|
||||
+ glusterd_conf_t *priv = NULL;
|
||||
+
|
||||
+ this = THIS;
|
||||
+ GF_VALIDATE_OR_GOTO("glusterd", this, out);
|
||||
+
|
||||
+ priv = this->private;
|
||||
+ GF_VALIDATE_OR_GOTO(this->name, priv, out);
|
||||
+
|
||||
+ if (!is_brick_mx_enabled()) {
|
||||
+ vol_per_thread_limit = 1;
|
||||
+ ret = 0;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = dict_get_strn(priv->opts, GLUSTERD_VOL_CNT_PER_THRD,
|
||||
+ SLEN(GLUSTERD_VOL_CNT_PER_THRD), &value);
|
||||
+ if (ret) {
|
||||
+ value = GLUSTERD_VOL_CNT_PER_THRD_DEFAULT_VALUE;
|
||||
+ }
|
||||
+ ret = gf_string2int(value, &vol_per_thread_limit);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+
|
||||
+out:
|
||||
+ *thread_limit = vol_per_thread_limit;
|
||||
+
|
||||
+ gf_msg_debug("glusterd", 0,
|
||||
+ "Per Thread volume limit set to %d glusterd to populate dict "
|
||||
+ "data parallel",
|
||||
+ *thread_limit);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
extern struct volopt_map_entry glusterd_volopt_map[];
|
||||
extern glusterd_all_vol_opts valid_all_vol_opts[];
|
||||
|
||||
@@ -3070,50 +3111,55 @@ glusterd_add_volume_to_dict(glusterd_volinfo_t *volinfo, dict_t *dict,
|
||||
|
||||
/* tiering related variables */
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_brick_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_brick_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ if (volinfo->type == GF_CLUSTER_TYPE_TIER) {
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_brick_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_brick_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_type", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_type);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_type", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_type);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_replica_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_replica_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_replica_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_replica_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_disperse_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_disperse_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_disperse_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key,
|
||||
+ volinfo->tier_info.cold_disperse_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_redundancy_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_redundancy_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_redundancy_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key,
|
||||
+ volinfo->tier_info.cold_redundancy_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.cold_dist_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.cold_dist_leaf_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.cold_dist_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key,
|
||||
+ volinfo->tier_info.cold_dist_leaf_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.hot_brick_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_brick_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.hot_brick_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_brick_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.hot_type", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_type);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.hot_type", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_type);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
|
||||
- snprintf(key, sizeof(key), "%s%d.hot_replica_count", prefix, count);
|
||||
- ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_replica_count);
|
||||
- if (ret)
|
||||
- goto out;
|
||||
+ snprintf(key, sizeof(key), "%s%d.hot_replica_count", prefix, count);
|
||||
+ ret = dict_set_uint32(dict, key, volinfo->tier_info.hot_replica_count);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
snprintf(key, sizeof(key), "%s%d", prefix, count);
|
||||
ret = gd_add_vol_snap_details_to_dict(dict, key, volinfo);
|
||||
@@ -3363,33 +3409,40 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int32_t
|
||||
-glusterd_add_volumes_to_export_dict(dict_t **peer_data)
|
||||
+void *
|
||||
+glusterd_add_bulk_volumes_create_thread(void *data)
|
||||
{
|
||||
int32_t ret = -1;
|
||||
- dict_t *dict = NULL;
|
||||
glusterd_conf_t *priv = NULL;
|
||||
glusterd_volinfo_t *volinfo = NULL;
|
||||
int32_t count = 0;
|
||||
- glusterd_dict_ctx_t ctx = {0};
|
||||
xlator_t *this = NULL;
|
||||
+ glusterd_add_dict_args_t *arg = NULL;
|
||||
+ dict_t *dict = NULL;
|
||||
+ int start = 0;
|
||||
+ int end = 0;
|
||||
|
||||
- this = THIS;
|
||||
- GF_ASSERT(this);
|
||||
+ GF_ASSERT(data);
|
||||
+
|
||||
+ arg = data;
|
||||
+ dict = arg->voldict;
|
||||
+ start = arg->start;
|
||||
+ end = arg->end;
|
||||
+ this = arg->this;
|
||||
+ THIS = arg->this;
|
||||
priv = this->private;
|
||||
GF_ASSERT(priv);
|
||||
|
||||
- dict = dict_new();
|
||||
- if (!dict)
|
||||
- goto out;
|
||||
-
|
||||
cds_list_for_each_entry(volinfo, &priv->volumes, vol_list)
|
||||
{
|
||||
count++;
|
||||
+ if ((count < start) || (count > end))
|
||||
+ continue;
|
||||
+
|
||||
ret = glusterd_add_volume_to_dict(volinfo, dict, count, "volume");
|
||||
if (ret)
|
||||
goto out;
|
||||
- if (!glusterd_is_volume_quota_enabled(volinfo))
|
||||
+ if (!dict_get_sizen(volinfo->dict, VKEY_FEATURES_QUOTA))
|
||||
continue;
|
||||
ret = glusterd_vol_add_quota_conf_to_dict(volinfo, dict, count,
|
||||
"volume");
|
||||
@@ -3397,7 +3450,122 @@ glusterd_add_volumes_to_export_dict(dict_t **peer_data)
|
||||
goto out;
|
||||
}
|
||||
|
||||
- ret = dict_set_int32n(dict, "count", SLEN("count"), count);
|
||||
+out:
|
||||
+ GF_ATOMIC_DEC(priv->thread_count);
|
||||
+ free(arg);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+int32_t
|
||||
+glusterd_add_volumes_to_export_dict(dict_t **peer_data)
|
||||
+{
|
||||
+ int32_t ret = -1;
|
||||
+ dict_t *dict = NULL;
|
||||
+ dict_t *dict_arr[128] = {
|
||||
+ 0,
|
||||
+ };
|
||||
+ glusterd_conf_t *priv = NULL;
|
||||
+ glusterd_volinfo_t *volinfo = NULL;
|
||||
+ int32_t count = 0;
|
||||
+ glusterd_dict_ctx_t ctx = {0};
|
||||
+ xlator_t *this = NULL;
|
||||
+ int totthread = 0;
|
||||
+ int volcnt = 0;
|
||||
+ int start = 1;
|
||||
+ int endindex = 0;
|
||||
+ int vol_per_thread_limit = 0;
|
||||
+ glusterd_add_dict_args_t *arg = NULL;
|
||||
+ pthread_t th_id = {
|
||||
+ 0,
|
||||
+ };
|
||||
+ int th_ret = 0;
|
||||
+ int i = 0;
|
||||
+
|
||||
+ this = THIS;
|
||||
+ GF_ASSERT(this);
|
||||
+ priv = this->private;
|
||||
+ GF_ASSERT(priv);
|
||||
+
|
||||
+ dict = dict_new();
|
||||
+ if (!dict)
|
||||
+ goto out;
|
||||
+
|
||||
+ /* Count the total number of volumes */
|
||||
+ cds_list_for_each_entry(volinfo, &priv->volumes, vol_list) volcnt++;
|
||||
+
|
||||
+ get_gd_vol_thread_limit(&vol_per_thread_limit);
|
||||
+
|
||||
+ if ((vol_per_thread_limit == 1) || (vol_per_thread_limit > 100)) {
|
||||
+ totthread = 0;
|
||||
+ } else {
|
||||
+ totthread = volcnt / vol_per_thread_limit;
|
||||
+ endindex = volcnt % vol_per_thread_limit;
|
||||
+ if (endindex)
|
||||
+ totthread++;
|
||||
+ }
|
||||
+
|
||||
+ if (totthread == 0) {
|
||||
+ cds_list_for_each_entry(volinfo, &priv->volumes, vol_list)
|
||||
+ {
|
||||
+ count++;
|
||||
+ ret = glusterd_add_volume_to_dict(volinfo, dict, count, "volume");
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+
|
||||
+ if (!dict_get_sizen(volinfo->dict, VKEY_FEATURES_QUOTA))
|
||||
+ continue;
|
||||
+
|
||||
+ ret = glusterd_vol_add_quota_conf_to_dict(volinfo, dict, count,
|
||||
+ "volume");
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ }
|
||||
+ } else {
|
||||
+ for (i = 0; i < totthread; i++) {
|
||||
+ arg = calloc(1, sizeof(*arg));
|
||||
+ dict_arr[i] = dict_new();
|
||||
+ arg->this = this;
|
||||
+ arg->voldict = dict_arr[i];
|
||||
+ arg->start = start;
|
||||
+ if (!endindex) {
|
||||
+ arg->end = ((i + 1) * vol_per_thread_limit);
|
||||
+ } else {
|
||||
+ arg->end = (start + endindex);
|
||||
+ }
|
||||
+ th_ret = gf_thread_create_detached(
|
||||
+ &th_id, glusterd_add_bulk_volumes_create_thread, arg,
|
||||
+ "bulkvoldict");
|
||||
+ if (th_ret) {
|
||||
+ gf_log(this->name, GF_LOG_ERROR,
|
||||
+ "glusterd_add_bulk_volume %s"
|
||||
+ " thread creation failed",
|
||||
+ "bulkvoldict");
|
||||
+ free(arg);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ start = start + vol_per_thread_limit;
|
||||
+ GF_ATOMIC_INC(priv->thread_count);
|
||||
+ gf_log(this->name, GF_LOG_INFO,
|
||||
+ "Create thread %d to populate dict data for volume"
|
||||
+ " start index is %d end index is %d",
|
||||
+ (i + 1), arg->start, arg->end);
|
||||
+ }
|
||||
+ while (GF_ATOMIC_GET(priv->thread_count)) {
|
||||
+ sleep(1);
|
||||
+ }
|
||||
+
|
||||
+ gf_log(this->name, GF_LOG_INFO,
|
||||
+ "Finished dictionary popluation in all threads");
|
||||
+ for (i = 0; i < totthread; i++) {
|
||||
+ dict_copy_with_ref(dict_arr[i], dict);
|
||||
+ dict_unref(dict_arr[i]);
|
||||
+ }
|
||||
+ gf_log(this->name, GF_LOG_INFO,
|
||||
+ "Finished merger of all dictionraies into single one");
|
||||
+ }
|
||||
+
|
||||
+ ret = dict_set_int32n(dict, "count", SLEN("count"), volcnt);
|
||||
if (ret)
|
||||
goto out;
|
||||
|
||||
@@ -3499,6 +3667,9 @@ glusterd_compare_friend_volume(dict_t *peer_data, int32_t count,
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (!dict_get_sizen(volinfo->dict, VKEY_FEATURES_QUOTA))
|
||||
+ goto skip_quota;
|
||||
+
|
||||
snprintf(key, sizeof(key), "volume%d.quota-version", count);
|
||||
ret = dict_get_uint32(peer_data, key, "a_version);
|
||||
if (ret) {
|
||||
@@ -3550,6 +3721,8 @@ glusterd_compare_friend_volume(dict_t *peer_data, int32_t count,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
+
|
||||
+skip_quota:
|
||||
*status = GLUSTERD_VOL_COMP_SCS;
|
||||
|
||||
out:
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
index 42ca9bb..10aa2ae 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c
|
||||
@@ -1058,6 +1058,51 @@ out:
|
||||
}
|
||||
|
||||
static int
|
||||
+validate_volume_per_thread_limit(glusterd_volinfo_t *volinfo, dict_t *dict,
|
||||
+ char *key, char *value, char **op_errstr)
|
||||
+{
|
||||
+ xlator_t *this = NULL;
|
||||
+ uint val = 0;
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ this = THIS;
|
||||
+ GF_VALIDATE_OR_GOTO("glusterd", this, out);
|
||||
+
|
||||
+ if (!is_brick_mx_enabled()) {
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "Brick-multiplexing is not enabled. "
|
||||
+ "Please enable brick multiplexing before trying "
|
||||
+ "to set this option.");
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_WRONG_OPTS_SETTING, "%s",
|
||||
+ *op_errstr);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ ret = gf_string2uint(value, &val);
|
||||
+ if (ret) {
|
||||
+ gf_asprintf(op_errstr,
|
||||
+ "%s is not a valid count. "
|
||||
+ "%s expects an unsigned integer.",
|
||||
+ value, key);
|
||||
+ gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_INVALID_ENTRY, "%s",
|
||||
+ *op_errstr);
|
||||
+ }
|
||||
+
|
||||
+ if ((val < 5) || (val > 200)) {
|
||||
+ gf_asprintf(
|
||||
+ op_errstr,
|
||||
+ "Please set this option to a greater than 5 or less than 200 "
|
||||
+ "to optimize dict generated while no. of volumes are more");
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+out:
|
||||
+ gf_msg_debug("glusterd", 0, "Returning %d", ret);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
validate_boolean(glusterd_volinfo_t *volinfo, dict_t *dict, char *key,
|
||||
char *value, char **op_errstr)
|
||||
{
|
||||
@@ -3520,6 +3565,16 @@ struct volopt_map_entry glusterd_volopt_map[] = {
|
||||
"brick multiplexing. Brick multiplexing ensures that "
|
||||
"compatible brick instances can share one single "
|
||||
"brick process."},
|
||||
+ {.key = GLUSTERD_VOL_CNT_PER_THRD,
|
||||
+ .voltype = "mgmt/glusterd",
|
||||
+ .value = GLUSTERD_VOL_CNT_PER_THRD_DEFAULT_VALUE,
|
||||
+ .op_version = GD_OP_VERSION_7_0,
|
||||
+ .validate_fn = validate_volume_per_thread_limit,
|
||||
+ .type = GLOBAL_NO_DOC,
|
||||
+ .description =
|
||||
+ "This option can be used to limit the number of volumes "
|
||||
+ "handled by per thread to populate peer data.The option accepts "
|
||||
+ " the value in the range of 5 to 200"},
|
||||
{.key = GLUSTERD_BRICKMUX_LIMIT_KEY,
|
||||
.voltype = "mgmt/glusterd",
|
||||
.value = GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE,
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
|
||||
index 0ac6e63..bd9f509 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd.h
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd.h
|
||||
@@ -57,8 +57,10 @@
|
||||
#define GLUSTER_SHARED_STORAGE "gluster_shared_storage"
|
||||
#define GLUSTERD_SHARED_STORAGE_KEY "cluster.enable-shared-storage"
|
||||
#define GLUSTERD_BRICK_MULTIPLEX_KEY "cluster.brick-multiplex"
|
||||
+#define GLUSTERD_VOL_CNT_PER_THRD "glusterd.vol_count_per_thread"
|
||||
#define GLUSTERD_BRICKMUX_LIMIT_KEY "cluster.max-bricks-per-process"
|
||||
#define GLUSTERD_BRICKMUX_LIMIT_DFLT_VALUE "250"
|
||||
+#define GLUSTERD_VOL_CNT_PER_THRD_DEFAULT_VALUE "100"
|
||||
#define GLUSTERD_LOCALTIME_LOGGING_KEY "cluster.localtime-logging"
|
||||
#define GLUSTERD_DAEMON_LOG_LEVEL_KEY "cluster.daemon-log-level"
|
||||
|
||||
@@ -225,8 +227,16 @@ typedef struct {
|
||||
which might lead the modification of volinfo
|
||||
list.
|
||||
*/
|
||||
+ gf_atomic_t thread_count;
|
||||
} glusterd_conf_t;
|
||||
|
||||
+typedef struct glusterd_add_dict_args {
|
||||
+ xlator_t *this;
|
||||
+ dict_t *voldict;
|
||||
+ int start;
|
||||
+ int end;
|
||||
+} glusterd_add_dict_args_t;
|
||||
+
|
||||
typedef enum gf_brick_status {
|
||||
GF_BRICK_STOPPED,
|
||||
GF_BRICK_STARTED,
|
||||
--
|
||||
1.8.3.1
|
||||
|
108
0110-tier-shd-glusterd-with-shd-mux-the-shd-volfile-path-.patch
Normal file
108
0110-tier-shd-glusterd-with-shd-mux-the-shd-volfile-path-.patch
Normal file
@ -0,0 +1,108 @@
|
||||
From 6e7d333625ecd9f7402c2e839338350fa86eaf45 Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Tue, 16 Apr 2019 17:07:37 +0530
|
||||
Subject: [PATCH 110/124] tier/shd/glusterd: with shd mux, the shd volfile path
|
||||
have to be updated for tier-heald.t
|
||||
|
||||
The volfile path for glustershd has been changed to volume based
|
||||
from node based with the shd mux. And those changes for the
|
||||
tier-heald.t test case have been made in this patch.
|
||||
|
||||
label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I0137f7e02c2bf3721dd51c6dfb215cd81b31d6ef
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168038
|
||||
Reviewed-by: Rafi Kavungal Chundattu Parambil <rkavunga@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
tests/basic/tier/tier-heald.t | 35 ++++++++++++++++++++---------------
|
||||
1 file changed, 20 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/tests/basic/tier/tier-heald.t b/tests/basic/tier/tier-heald.t
|
||||
index a8e634f..0ec9e43 100644
|
||||
--- a/tests/basic/tier/tier-heald.t
|
||||
+++ b/tests/basic/tier/tier-heald.t
|
||||
@@ -11,7 +11,7 @@ cleanup;
|
||||
TEST glusterd
|
||||
TEST pidof glusterd
|
||||
|
||||
-volfile=$(gluster system:: getwd)"/glustershd/glustershd-server.vol"
|
||||
+r2_volfile=$(gluster system:: getwd)"/vols/r2/r2-shd.vol"
|
||||
|
||||
# Commands should fail when both tiers are not of distribute type.
|
||||
# Glustershd shouldn't be running as long as there are no replicate/disperse
|
||||
@@ -34,51 +34,56 @@ TEST $CLI volume tier r2 attach $H0:$B0/r2_hot
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
TEST $CLI volume heal r2 enable
|
||||
EXPECT "enable" volume_option r2 "cluster.self-heal-daemon"
|
||||
-EXPECT "enable" volgen_volume_option $volfile r2-replicate-0 cluster replicate self-heal-daemon
|
||||
+EXPECT "enable" volgen_volume_option $r2_volfile r2-replicate-0 cluster replicate self-heal-daemon
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
TEST $CLI volume heal r2 disable
|
||||
EXPECT "disable" volume_option r2 "cluster.self-heal-daemon"
|
||||
-EXPECT "disable" volgen_volume_option $volfile r2-replicate-0 cluster replicate self-heal-daemon
|
||||
+EXPECT "disable" volgen_volume_option $r2_volfile r2-replicate-0 cluster replicate self-heal-daemon
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
# Commands should work on disperse volume.
|
||||
TEST $CLI volume create ec2 disperse 3 redundancy 1 $H0:$B0/ec2_0 $H0:$B0/ec2_1 $H0:$B0/ec2_2
|
||||
TEST $CLI volume start ec2
|
||||
|
||||
+ec2_volfile=$(gluster system:: getwd)"/vols/ec2/ec2-shd.vol"
|
||||
+
|
||||
TEST $CLI volume tier ec2 attach replica 2 $H0:$B0/ec2_hot{1..4}
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
TEST $CLI volume heal ec2 enable
|
||||
EXPECT "enable" volume_option ec2 "cluster.disperse-self-heal-daemon"
|
||||
-EXPECT "enable" volgen_volume_option $volfile ec2-disperse-0 cluster disperse self-heal-daemon
|
||||
+EXPECT "enable" volgen_volume_option $ec2_volfile ec2-disperse-0 cluster disperse self-heal-daemon
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
TEST $CLI volume heal ec2 disable
|
||||
EXPECT "disable" volume_option ec2 "cluster.disperse-self-heal-daemon"
|
||||
-EXPECT "disable" volgen_volume_option $volfile ec2-disperse-0 cluster disperse self-heal-daemon
|
||||
+EXPECT "disable" volgen_volume_option $ec2_volfile ec2-disperse-0 cluster disperse self-heal-daemon
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid
|
||||
|
||||
#Check that shd graph is rewritten correctly on volume stop/start
|
||||
-EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse
|
||||
-EXPECT "Y" volgen_volume_exists $volfile r2-replicate-0 cluster replicate
|
||||
+EXPECT "Y" volgen_volume_exists $ec2_volfile ec2-disperse-0 cluster disperse
|
||||
+EXPECT "Y" volgen_volume_exists $r2_volfile r2-replicate-0 cluster replicate
|
||||
TEST $CLI volume stop r2
|
||||
-EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse
|
||||
-EXPECT "N" volgen_volume_exists $volfile r2-replicate-0 cluster replicate
|
||||
+EXPECT "Y" volgen_volume_exists $ec2_volfile ec2-disperse-0 cluster disperse
|
||||
+
|
||||
+# Has been commented as the validations after stop using volfile dont hold true.
|
||||
+#EXPECT "N" volgen_volume_exists $r2_volfile r2-replicate-0 cluster replicate
|
||||
TEST $CLI volume stop ec2
|
||||
# When both the volumes are stopped glustershd volfile is not modified just the
|
||||
# process is stopped
|
||||
TEST "[ -z $(get_shd_process_pid) ]"
|
||||
|
||||
TEST $CLI volume start r2
|
||||
-EXPECT "N" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse
|
||||
-EXPECT "Y" volgen_volume_exists $volfile r2-replicate-0 cluster replicate
|
||||
+# Has been commented as the validations after stop using volfile dont hold true.
|
||||
+#EXPECT "N" volgen_volume_exists $ec2_volfile ec2-disperse-0 cluster disperse
|
||||
+EXPECT "Y" volgen_volume_exists $r2_volfile r2-replicate-0 cluster replicate
|
||||
|
||||
TEST $CLI volume start ec2
|
||||
|
||||
-EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse
|
||||
-EXPECT "Y" volgen_volume_exists $volfile ec2-replicate-0 cluster replicate
|
||||
+EXPECT "Y" volgen_volume_exists $ec2_volfile ec2-disperse-0 cluster disperse
|
||||
+EXPECT "Y" volgen_volume_exists $ec2_volfile ec2-replicate-0 cluster replicate
|
||||
|
||||
TEST $CLI volume tier ec2 detach force
|
||||
|
||||
-EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse
|
||||
-EXPECT "N" volgen_volume_exists $volfile ec2-replicate-0 cluster replicate
|
||||
+EXPECT "Y" volgen_volume_exists $ec2_volfile ec2-disperse-0 cluster disperse
|
||||
+EXPECT "N" volgen_volume_exists $ec2_volfile ec2-replicate-0 cluster replicate
|
||||
|
||||
TEST $CLI volume set r2 self-heal-daemon on
|
||||
TEST $CLI volume set r2 cluster.self-heal-daemon off
|
||||
--
|
||||
1.8.3.1
|
||||
|
49
0111-glusterd-fix-loading-ctime-in-client-graph-logic.patch
Normal file
49
0111-glusterd-fix-loading-ctime-in-client-graph-logic.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From 310e09d46cdb293e4af2df0085b8ac45d5c17933 Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Tue, 16 Apr 2019 17:20:34 +0530
|
||||
Subject: [PATCH 111/124] glusterd: fix loading ctime in client graph logic
|
||||
|
||||
Commit efbf8ab wasn't handling all the scenarios of toggling ctime
|
||||
option correctly and more over a ! had completely tossed up the logic.
|
||||
|
||||
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22578/
|
||||
|
||||
>Fixes: bz#1697907
|
||||
>Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d
|
||||
>Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
|
||||
BUG: 1697820
|
||||
Change-Id: If12e2f69045e59878992ee2cd0518cc0eabcce0d
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168048
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-volgen.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
index 324ec2f..da877aa 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
|
||||
@@ -4358,9 +4358,15 @@ client_graph_builder(volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
-
|
||||
- if (conf->op_version >= GD_OP_VERSION_5_0 &&
|
||||
- !dict_get_str_boolean(set_dict, "features.ctime", _gf_false)) {
|
||||
+ /* a. ret will be -1 if features.ctime is not set in the volinfo->dict which
|
||||
+ * means ctime should be loaded into the graph.
|
||||
+ * b. ret will be 1 if features.ctime is explicitly turned on through
|
||||
+ * volume set and in that case ctime should be loaded into the graph.
|
||||
+ * c. ret will be 0 if features.ctime is explicitly turned off and in that
|
||||
+ * case ctime shouldn't be loaded into the graph.
|
||||
+ */
|
||||
+ ret = dict_get_str_boolean(set_dict, "features.ctime", -1);
|
||||
+ if (conf->op_version >= GD_OP_VERSION_5_0 && ret) {
|
||||
xl = volgen_graph_add(graph, "features/utime", volname);
|
||||
if (!xl) {
|
||||
ret = -1;
|
||||
--
|
||||
1.8.3.1
|
||||
|
45
0112-geo-rep-fix-incorrectly-formatted-authorized_keys.patch
Normal file
45
0112-geo-rep-fix-incorrectly-formatted-authorized_keys.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 1df830953b9a09404f9ca6a0539172e9f23ecbf4 Mon Sep 17 00:00:00 2001
|
||||
From: Sunny Kumar <sunkumar@redhat.com>
|
||||
Date: Wed, 17 Apr 2019 15:13:12 +0530
|
||||
Subject: [PATCH 112/124] geo-rep : fix incorrectly formatted authorized_keys
|
||||
|
||||
Problem : While Geo-rep setup when creating an ssh authorized_keys
|
||||
the geo-rep setup inserts an extra space before the "ssh-rsa" label.
|
||||
This gets flagged by an enterprise customer's security scan as a
|
||||
security violation.
|
||||
|
||||
Solution: Remove extra space in GSYNCD_CMD & TAR_CMD.
|
||||
|
||||
>Upstream patch: https://review.gluster.org/#/c/glusterfs/+/22246/
|
||||
>Change-Id: I956f938faef0e0883703bbc337b1dc2770e4a921
|
||||
>fixes: bz#1679401
|
||||
>Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
||||
|
||||
BUG: 1671862
|
||||
Change-Id: I194a2bddcf2ee9b8286b204f8c4da5c480a528b3
|
||||
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168144
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
|
||||
---
|
||||
geo-replication/src/peer_georep-sshkey.py.in | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/geo-replication/src/peer_georep-sshkey.py.in b/geo-replication/src/peer_georep-sshkey.py.in
|
||||
index 2196fd7..58696e9 100644
|
||||
--- a/geo-replication/src/peer_georep-sshkey.py.in
|
||||
+++ b/geo-replication/src/peer_georep-sshkey.py.in
|
||||
@@ -30,8 +30,8 @@ from prettytable import PrettyTable
|
||||
|
||||
SECRET_PEM = "@GLUSTERD_WORKDIR@/geo-replication/secret.pem"
|
||||
TAR_SSH_PEM = "@GLUSTERD_WORKDIR@/geo-replication/tar_ssh.pem"
|
||||
-GSYNCD_CMD = 'command="@GLUSTERFS_LIBEXECDIR@/gsyncd" '
|
||||
-TAR_CMD = 'command="tar ${SSH_ORIGINAL_COMMAND#* }" '
|
||||
+GSYNCD_CMD = 'command="@GLUSTERFS_LIBEXECDIR@/gsyncd" '
|
||||
+TAR_CMD = 'command="tar ${SSH_ORIGINAL_COMMAND#* }" '
|
||||
COMMON_SECRET_FILE = "@GLUSTERD_WORKDIR@/geo-replication/common_secret.pem.pub"
|
||||
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,71 @@
|
||||
From 850d5418fb48417d94ab17e565b2184ba951ccbe Mon Sep 17 00:00:00 2001
|
||||
From: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Date: Wed, 17 Apr 2019 18:04:44 +0530
|
||||
Subject: [PATCH 113/124] spec: Glusterd did not start by default after node
|
||||
reboot
|
||||
|
||||
Problem: After install gluster rpms glusterd service is not enabled
|
||||
so systemctl status is showing "disabled"
|
||||
|
||||
Solution: Update glusterfs.spec.in to enable glusterd after install
|
||||
gluster rpms
|
||||
|
||||
label: DOWNSTREAM ONLY
|
||||
BUG: 1699835
|
||||
|
||||
Change-Id: Ied9be5dfb1bf3bda24868722b1fbd77cb1c1d18c
|
||||
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168168
|
||||
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 10 ++++++----
|
||||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index cb17eaa..ba095b7 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -168,6 +168,8 @@
|
||||
%endif
|
||||
|
||||
%if ( 0%{?_with_systemd:1} )
|
||||
+%global service_enable() /bin/systemctl --quiet enable %1.service || : \
|
||||
+%{nil}
|
||||
%global service_start() /bin/systemctl --quiet start %1.service || : \
|
||||
%{nil}
|
||||
%global service_stop() /bin/systemctl --quiet stop %1.service || :\
|
||||
@@ -181,7 +183,7 @@
|
||||
%global glustereventsd_svcfile %{_unitdir}/glustereventsd.service
|
||||
%global glusterfssharedstorage_svcfile %{_unitdir}/glusterfssharedstorage.service
|
||||
%else
|
||||
-%global systemd_post() /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
|
||||
+%global service_enable() /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
|
||||
%{nil}
|
||||
%global systemd_preun() /sbin/chkconfig --del %1 >/dev/null 2>&1 || : \
|
||||
%{nil}
|
||||
@@ -926,7 +928,7 @@ exit 0
|
||||
|
||||
%if ( 0%{!?_without_events:1} )
|
||||
%post events
|
||||
-%systemd_post glustereventsd
|
||||
+%service_enable glustereventsd
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
@@ -951,9 +953,9 @@ exit 0
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%post server
|
||||
# Legacy server
|
||||
-%systemd_post glusterd
|
||||
+%service_enable glusterd
|
||||
%if ( 0%{_for_fedora_koji_builds} )
|
||||
-%systemd_post glusterfsd
|
||||
+%service_enable glusterfsd
|
||||
%endif
|
||||
# ".cmd_log_history" is renamed to "cmd_history.log" in GlusterFS-3.7 .
|
||||
# While upgrading glusterfs-server package form GlusterFS version <= 3.6 to
|
||||
--
|
||||
1.8.3.1
|
||||
|
46
0114-core-fix-hang-issue-in-__gf_free.patch
Normal file
46
0114-core-fix-hang-issue-in-__gf_free.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From da53d9027d9426c0023176a42e0550d6ccccc941 Mon Sep 17 00:00:00 2001
|
||||
From: Susant Palai <spalai@redhat.com>
|
||||
Date: Mon, 22 Apr 2019 21:18:30 +0530
|
||||
Subject: [PATCH 114/124] core: fix hang issue in __gf_free
|
||||
|
||||
Currently GF_ASSERT is done under mem_accounting lock at some places.
|
||||
On a GF_ASSERT failure, gf_msg_callingfn is called which calls gf_malloc
|
||||
internally and it takes the same mem_accounting lock leading to deadlock.
|
||||
|
||||
This is a temporary fix to avoid any hang issue in master.
|
||||
https://review.gluster.org/#/c/glusterfs/+/22589/ is being worked on
|
||||
in the mean while so that GF_ASSERT can be used under mem_accounting
|
||||
lock.
|
||||
|
||||
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22600/
|
||||
|
||||
>Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a
|
||||
>updates: bz#1700865
|
||||
>Signed-off-by: Susant Palai <spalai@redhat.com>
|
||||
|
||||
Change-Id: I6d67f23979e7edd2695bdc6aab2997dae4a4060a
|
||||
BUG: 1698728
|
||||
Signed-off-by: Susant Palai <spalai@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168474
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Nithya Balachandran <nbalacha@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
libglusterfs/src/mem-pool.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/libglusterfs/src/mem-pool.c b/libglusterfs/src/mem-pool.c
|
||||
index 81badc0..34cb87a 100644
|
||||
--- a/libglusterfs/src/mem-pool.c
|
||||
+++ b/libglusterfs/src/mem-pool.c
|
||||
@@ -348,7 +348,6 @@ __gf_free(void *free_ptr)
|
||||
|
||||
LOCK(&mem_acct->rec[header->type].lock);
|
||||
{
|
||||
- GF_ASSERT(mem_acct->rec[header->type].size >= header->size);
|
||||
mem_acct->rec[header->type].size -= header->size;
|
||||
mem_acct->rec[header->type].num_allocs--;
|
||||
/* If all the instances are freed up then ensure typestr is set
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,56 @@
|
||||
From 4901fcc0cc507accf30e1a4bdd020a5676488751 Mon Sep 17 00:00:00 2001
|
||||
From: Niels de Vos <ndevos@redhat.com>
|
||||
Date: Mon, 8 Apr 2019 12:14:34 +0200
|
||||
Subject: [PATCH 115/124] core: only log seek errors if SEEK_HOLE/SEEK_DATA is
|
||||
available
|
||||
|
||||
On RHEL-6 there is no support for SEEK_HOLE/SEEK_DATA and this causes
|
||||
the POSIX xlator to return errno=EINVAL. Because of this, the rpc-server
|
||||
xlator will log all 'failed' seek attempts. When applications call
|
||||
seek() often, the brick logs can grow very quickly and fill up the
|
||||
disks.
|
||||
|
||||
Messages that get logged are like
|
||||
[server-rpc-fops.c:2091:server_seek_cbk] 0-vol01-server: 4947: SEEK-2 (53920aee-062c-4598-aa50-2b4d7821b204), client: worker.example.com-7808-2019/02/08-18:04:57:903430-vol01-client-0-0-0, error-xlator: vol01-posix [Invalid argument]
|
||||
|
||||
The problem can be reproduced by running a Gluster Server on RHEL-6,
|
||||
with a client running on RHEL-7. The client should execute an
|
||||
application that calls lseek() with SEEK_HOLE/SEEK_DATA.
|
||||
|
||||
>Change-Id: I7b6c16f8e0ba1a183e845cfdb8d5a3f8caeab138
|
||||
>Fixes: bz#1697316
|
||||
>Signed-off-by: Niels de Vos <ndevos@redhat.com>
|
||||
|
||||
upstream patch: https://review.gluster.org/#/c/glusterfs/+/22526/
|
||||
|
||||
BUG: 1696903
|
||||
Change-Id: I7b6c16f8e0ba1a183e845cfdb8d5a3f8caeab138
|
||||
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168527
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
---
|
||||
libglusterfs/src/common-utils.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
|
||||
index a0c83c0..70d5d21 100644
|
||||
--- a/libglusterfs/src/common-utils.c
|
||||
+++ b/libglusterfs/src/common-utils.c
|
||||
@@ -4500,9 +4500,13 @@ fop_log_level(glusterfs_fop_t fop, int op_errno)
|
||||
return GF_LOG_DEBUG;
|
||||
|
||||
if (fop == GF_FOP_SEEK) {
|
||||
+#ifdef HAVE_SEEK_HOLE
|
||||
if (op_errno == ENXIO) {
|
||||
return GF_LOG_DEBUG;
|
||||
}
|
||||
+#else
|
||||
+ return GF_LOG_DEBUG;
|
||||
+#endif
|
||||
}
|
||||
|
||||
return GF_LOG_ERROR;
|
||||
--
|
||||
1.8.3.1
|
||||
|
1931
0116-cluster-ec-fix-fd-reopen.patch
Normal file
1931
0116-cluster-ec-fix-fd-reopen.patch
Normal file
File diff suppressed because it is too large
Load Diff
184
0117-spec-Remove-thin-arbiter-package.patch
Normal file
184
0117-spec-Remove-thin-arbiter-package.patch
Normal file
@ -0,0 +1,184 @@
|
||||
From 70842c77735a655a053ed4a7cb77fec01028355a Mon Sep 17 00:00:00 2001
|
||||
From: Sunil Kumar Acharya <sheggodu@redhat.com>
|
||||
Date: Mon, 22 Apr 2019 12:48:13 +0530
|
||||
Subject: [PATCH 117/124] spec: Remove thin-arbiter package
|
||||
|
||||
Thin-arbiter is not supported in downstream. Updated the
|
||||
code to avoid RPMdiff warnings. Marked thin-arbiter
|
||||
test cases as bad to avoid nightly runs from reporting
|
||||
expected failures.
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
BUG: 1698436
|
||||
Change-Id: Ic36bccdfe1c7039fb7e5ce078a8b64cf71056970
|
||||
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168406
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
---
|
||||
configure.ac | 2 --
|
||||
extras/systemd/Makefile.am | 6 ++---
|
||||
glusterfs.spec.in | 39 +++++----------------------------
|
||||
tests/basic/afr/ta-check-locks.t | 2 ++
|
||||
tests/basic/afr/ta-read.t | 2 ++
|
||||
tests/basic/afr/ta-shd.t | 2 ++
|
||||
tests/basic/afr/ta-write-on-bad-brick.t | 2 ++
|
||||
xlators/features/Makefile.am | 2 +-
|
||||
8 files changed, 18 insertions(+), 39 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 521671b..3065077 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -116,8 +116,6 @@ AC_CONFIG_FILES([Makefile
|
||||
xlators/features/Makefile
|
||||
xlators/features/arbiter/Makefile
|
||||
xlators/features/arbiter/src/Makefile
|
||||
- xlators/features/thin-arbiter/Makefile
|
||||
- xlators/features/thin-arbiter/src/Makefile
|
||||
xlators/features/changelog/Makefile
|
||||
xlators/features/changelog/src/Makefile
|
||||
xlators/features/changelog/lib/Makefile
|
||||
diff --git a/extras/systemd/Makefile.am b/extras/systemd/Makefile.am
|
||||
index 61446a9..b849775 100644
|
||||
--- a/extras/systemd/Makefile.am
|
||||
+++ b/extras/systemd/Makefile.am
|
||||
@@ -1,8 +1,8 @@
|
||||
-CLEANFILES = glusterd.service glustereventsd.service glusterfssharedstorage.service gluster-ta-volume.service
|
||||
-EXTRA_DIST = glusterd.service.in glustereventsd.service.in glusterfssharedstorage.service.in gluster-ta-volume.service.in
|
||||
+CLEANFILES = glusterd.service glustereventsd.service glusterfssharedstorage.service
|
||||
+EXTRA_DIST = glusterd.service.in glustereventsd.service.in glusterfssharedstorage.service.in
|
||||
|
||||
if USE_SYSTEMD
|
||||
-systemd_DATA = gluster-ta-volume.service
|
||||
+systemd_DATA =
|
||||
endif
|
||||
|
||||
if WITH_SERVER
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index ba095b7..bf72a55 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -682,18 +682,6 @@ is in user space and easily manageable.
|
||||
This package provides the glusterfs server daemon.
|
||||
%endif
|
||||
|
||||
-%package thin-arbiter
|
||||
-Summary: GlusterFS thin-arbiter module
|
||||
-Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
-Requires: %{name}-server%{?_isa} = %{version}-%{release}
|
||||
-
|
||||
-%description thin-arbiter
|
||||
-This package provides a tie-breaker functionality to GlusterFS
|
||||
-replicate volume. It includes translators required to provide the
|
||||
-functionality, and also few other scripts required for getting the setup done.
|
||||
-
|
||||
-This package provides the glusterfs thin-arbiter translator.
|
||||
-
|
||||
%package client-xlators
|
||||
Summary: GlusterFS client-side translators
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
@@ -1045,14 +1033,6 @@ fi
|
||||
exit 0
|
||||
%endif
|
||||
|
||||
-%preun thin-arbiter
|
||||
-if [ $1 -eq 0 ]; then
|
||||
- if [ -f %glusterta_svcfile ]; then
|
||||
- %service_stop gluster-ta-volume
|
||||
- %systemd_preun gluster-ta-volume
|
||||
- fi
|
||||
-fi
|
||||
-
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%postun should be placed here and keep them sorted
|
||||
##
|
||||
@@ -1188,6 +1168,12 @@ exit 0
|
||||
%exclude %{_prefix}/lib/ocf/resource.d/heartbeat/*
|
||||
%endif
|
||||
|
||||
+%exclude %{_datadir}/glusterfs/scripts/setup-thin-arbiter.sh
|
||||
+
|
||||
+%if ( 0%{?_without_server:1} )
|
||||
+%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
+%endif
|
||||
+
|
||||
%files api
|
||||
%exclude %{_libdir}/*.so
|
||||
# libgfapi files
|
||||
@@ -1263,19 +1249,6 @@ exit 0
|
||||
%{_bindir}/fusermount-glusterfs
|
||||
%endif
|
||||
|
||||
-%files thin-arbiter
|
||||
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
|
||||
- %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/thin-arbiter.so
|
||||
-%dir %{_datadir}/glusterfs/scripts
|
||||
- %{_datadir}/glusterfs/scripts/setup-thin-arbiter.sh
|
||||
-%config %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
-
|
||||
-%if ( 0%{?_with_systemd:1} )
|
||||
-%{_unitdir}/gluster-ta-volume.service
|
||||
-%endif
|
||||
-
|
||||
-
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
%files geo-replication
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs-georep
|
||||
diff --git a/tests/basic/afr/ta-check-locks.t b/tests/basic/afr/ta-check-locks.t
|
||||
index c0102c3..c51aa39 100644
|
||||
--- a/tests/basic/afr/ta-check-locks.t
|
||||
+++ b/tests/basic/afr/ta-check-locks.t
|
||||
@@ -66,3 +66,5 @@ TEST ta_start_brick_process brick0
|
||||
EXPECT_WITHIN $HEAL_TIMEOUT "0" get_lock_count_on_ta
|
||||
|
||||
cleanup;
|
||||
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=0000000
|
||||
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=0000000
|
||||
diff --git a/tests/basic/afr/ta-read.t b/tests/basic/afr/ta-read.t
|
||||
index f2b3c38..1b36dba 100644
|
||||
--- a/tests/basic/afr/ta-read.t
|
||||
+++ b/tests/basic/afr/ta-read.t
|
||||
@@ -58,3 +58,5 @@ TEST [ -z $TA_PID ]
|
||||
# Read must now succeed.
|
||||
TEST cat $M0/FILE
|
||||
cleanup;
|
||||
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=0000000
|
||||
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=0000000
|
||||
diff --git a/tests/basic/afr/ta-shd.t b/tests/basic/afr/ta-shd.t
|
||||
index bb2e58b..4b1ea85 100644
|
||||
--- a/tests/basic/afr/ta-shd.t
|
||||
+++ b/tests/basic/afr/ta-shd.t
|
||||
@@ -47,3 +47,5 @@ TEST ta_start_mount_process $M0
|
||||
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" ta_up_status $V0 $M0 0
|
||||
EXPECT "Hello" cat $M0/a.txt
|
||||
cleanup;
|
||||
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=0000000
|
||||
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=0000000
|
||||
diff --git a/tests/basic/afr/ta-write-on-bad-brick.t b/tests/basic/afr/ta-write-on-bad-brick.t
|
||||
index 18cb65b..77cbf5f 100644
|
||||
--- a/tests/basic/afr/ta-write-on-bad-brick.t
|
||||
+++ b/tests/basic/afr/ta-write-on-bad-brick.t
|
||||
@@ -49,3 +49,5 @@ EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" afr_child_up_status_meta $M0 $V0-replicate
|
||||
TEST dd if=/dev/zero of=$M0/a.txt bs=1M count=5
|
||||
|
||||
cleanup;
|
||||
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=0000000
|
||||
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=0000000
|
||||
diff --git a/xlators/features/Makefile.am b/xlators/features/Makefile.am
|
||||
index 545c02b..537c148 100644
|
||||
--- a/xlators/features/Makefile.am
|
||||
+++ b/xlators/features/Makefile.am
|
||||
@@ -4,7 +4,7 @@ endif
|
||||
|
||||
SUBDIRS = locks quota read-only quiesce marker index barrier arbiter upcall \
|
||||
compress changelog gfid-access snapview-client snapview-server trash \
|
||||
- shard bit-rot leases selinux sdfs namespace $(CLOUDSYNC_DIR) thin-arbiter \
|
||||
+ shard bit-rot leases selinux sdfs namespace $(CLOUDSYNC_DIR) \
|
||||
utime changetimerecorder
|
||||
|
||||
CLEANFILES =
|
||||
--
|
||||
1.8.3.1
|
||||
|
31
0118-tests-mark-thin-arbiter-test-ta.t-as-bad.patch
Normal file
31
0118-tests-mark-thin-arbiter-test-ta.t-as-bad.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From 24c2430e3cd629665851fdb2921d754e3ecef3b4 Mon Sep 17 00:00:00 2001
|
||||
From: Atin Mukherjee <amukherj@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 07:47:32 +0530
|
||||
Subject: [PATCH 118/124] tests: mark thin-arbiter test ta.t as bad
|
||||
|
||||
As thin-arbiter isn't packaged and tested at RHGS 3.5
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
BUG: 1698436
|
||||
Change-Id: Ideab570f58fc0b2daecb2be4ed4b6740362d0b35
|
||||
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168613
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
---
|
||||
tests/basic/afr/ta.t | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/tests/basic/afr/ta.t b/tests/basic/afr/ta.t
|
||||
index 05d4843..cbd1b56 100644
|
||||
--- a/tests/basic/afr/ta.t
|
||||
+++ b/tests/basic/afr/ta.t
|
||||
@@ -52,3 +52,5 @@ TEST ! ls $B0/brick0/c.txt
|
||||
TEST ! ls $B0/brick1/c.txt
|
||||
|
||||
cleanup;
|
||||
+#G_TESTDEF_TEST_STATUS_CENTOS6=BAD_TEST,BUG=0000000
|
||||
+#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=0000000
|
||||
--
|
||||
1.8.3.1
|
||||
|
53
0119-glusterd-provide-a-way-to-detach-failed-node.patch
Normal file
53
0119-glusterd-provide-a-way-to-detach-failed-node.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From a325e7b3bbe5c1f67b999f375b83d2e2f1b2c1c6 Mon Sep 17 00:00:00 2001
|
||||
From: Sanju Rakonde <srakonde@redhat.com>
|
||||
Date: Tue, 9 Apr 2019 13:56:24 +0530
|
||||
Subject: [PATCH 119/124] glusterd: provide a way to detach failed node
|
||||
|
||||
When a gluster node in trusted storage pool has failed
|
||||
due to hardware issues, volume delete operation fails
|
||||
saying "Not all peers are up" and peer detach for failed
|
||||
node fails saying "Brick(s) with peer <peer_ip> exists
|
||||
in cluster".
|
||||
|
||||
The idea here is to use either replace-brick or remove-brick
|
||||
command to remove all the bricks hosted by failed node and
|
||||
then re-attempting the peer detach. This change adds this
|
||||
trick in peer detach error message.
|
||||
|
||||
> upstream patch : https://review.gluster.org/22534
|
||||
|
||||
>fixes: bz#1697866
|
||||
>Change-Id: I0c58887479d31db603ad8d6535ea9d547880ccc8
|
||||
>Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
|
||||
|
||||
BUG: 1696334
|
||||
Change-Id: I0c58887479d31db603ad8d6535ea9d547880ccc8
|
||||
Signed-off-by: Sanju Rakonde <srakonde@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168614
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-handler.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
index 6147995..af8a8a4 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
|
||||
@@ -4134,8 +4134,11 @@ set_deprobe_error_str(int op_ret, int op_errno, char *op_errstr, char *errstr,
|
||||
|
||||
case GF_DEPROBE_BRICK_EXIST:
|
||||
snprintf(errstr, len,
|
||||
- "Brick(s) with the peer "
|
||||
- "%s exist in cluster",
|
||||
+ "Peer %s hosts one or more bricks. If the peer is in "
|
||||
+ "not recoverable state then use either replace-brick "
|
||||
+ "or remove-brick command with force to remove all "
|
||||
+ "bricks from the peer and attempt the peer detach "
|
||||
+ "again.",
|
||||
hostname);
|
||||
break;
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,62 @@
|
||||
From c429d3c63601e6ea15af76aa684c30bbeb746467 Mon Sep 17 00:00:00 2001
|
||||
From: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Date: Tue, 23 Apr 2019 13:03:28 +0530
|
||||
Subject: [PATCH 120/124] glusterd/shd: Keep a ref on volinfo until attach rpc
|
||||
execute cbk
|
||||
|
||||
When svc attach execute for multiplexing a daemon, we have to keep
|
||||
a ref on volinfo until it finish the execution. Because, if the attach
|
||||
is an aysnc call, then a parallel volume delete can lead to free the
|
||||
volinfo
|
||||
|
||||
> upstream patch : https://review.gluster.org/#/c/glusterfs/+/22606/
|
||||
|
||||
>Change-Id: Ibc02b89557baaed2f63db63d7fb1a7480444ae0d
|
||||
>fixes: bz#1702185
|
||||
>Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
|
||||
Change-Id: Ibc02b89557baaed2f63db63d7fb1a7480444ae0d
|
||||
BUG: 1702240
|
||||
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168616
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/mgmt/glusterd/src/glusterd-shd-svc.c | 3 +++
|
||||
xlators/mgmt/glusterd/src/glusterd-svc-helper.c | 4 ++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
index 19eca9f..a9eab42 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-shd-svc.c
|
||||
@@ -452,8 +452,11 @@ glusterd_shdsvc_start(glusterd_svc_t *svc, int flags)
|
||||
}
|
||||
|
||||
if (shd->attached) {
|
||||
+ glusterd_volinfo_ref(volinfo);
|
||||
+ /* Unref will happen from glusterd_svc_attach_cbk */
|
||||
ret = glusterd_attach_svc(svc, volinfo, flags);
|
||||
if (ret) {
|
||||
+ glusterd_volinfo_unref(volinfo);
|
||||
gf_msg("glusterd", GF_LOG_ERROR, 0, GD_MSG_VOLINFO_GET_FAIL,
|
||||
"Failed to attach shd svc(volume=%s) to pid=%d. Starting"
|
||||
"a new process",
|
||||
diff --git a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
index 02945b1..f7be394 100644
|
||||
--- a/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
+++ b/xlators/mgmt/glusterd/src/glusterd-svc-helper.c
|
||||
@@ -695,6 +695,10 @@ out:
|
||||
if (flag) {
|
||||
GF_FREE(flag);
|
||||
}
|
||||
+
|
||||
+ if (volinfo)
|
||||
+ glusterd_volinfo_unref(volinfo);
|
||||
+
|
||||
GF_ATOMIC_DEC(conf->blockers);
|
||||
STACK_DESTROY(frame->root);
|
||||
return 0;
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,42 @@
|
||||
From e4209dfb27faeca5544a09474ac524546e5d11e0 Mon Sep 17 00:00:00 2001
|
||||
From: Hari Gowtham <hgowtham@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 18:14:33 +0530
|
||||
Subject: [PATCH 121/124] spec: glusterfs-devel for client-build should not
|
||||
depend on server
|
||||
|
||||
Found that libgfdb.pc was included in client package.
|
||||
It was earlier removed from glusterfs-devel client package
|
||||
as a part of:
|
||||
40eb62a8872ce061416e899fb6c0784b6253ab16
|
||||
|
||||
Made it back into downstream when tier was introduced again.
|
||||
Removing it in this patch.
|
||||
|
||||
label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I5fd5f5b0a6b06c677f8ea3693eb0392af51abaf1
|
||||
Signed-off-by: Hari Gowtham <hgowtham@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168670
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Milind Changire <mchangir@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index bf72a55..d20b062 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -1210,7 +1210,7 @@ exit 0
|
||||
%exclude %{_libdir}/pkgconfig/libgfchangelog.pc
|
||||
%exclude %{_libdir}/libgfchangelog.so
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
-%{_libdir}/pkgconfig/libgfdb.pc
|
||||
+%exclude %{_libdir}/pkgconfig/libgfdb.pc
|
||||
%endif
|
||||
%else
|
||||
%{_libdir}/pkgconfig/libgfchangelog.pc
|
||||
--
|
||||
1.8.3.1
|
||||
|
312
0122-posix-ctime-Fix-stat-time-attributes-inconsistency-d.patch
Normal file
312
0122-posix-ctime-Fix-stat-time-attributes-inconsistency-d.patch
Normal file
@ -0,0 +1,312 @@
|
||||
From 2f07d12f902e371d8cb8c76007d558e3a727b56a Mon Sep 17 00:00:00 2001
|
||||
From: Kotresh HR <khiremat@redhat.com>
|
||||
Date: Tue, 9 Apr 2019 18:23:05 +0530
|
||||
Subject: [PATCH 122/124] posix/ctime: Fix stat(time attributes) inconsistency
|
||||
during readdirp
|
||||
|
||||
Problem:
|
||||
Creation of tar file on gluster volume throws warning
|
||||
'file changed as we read it'
|
||||
|
||||
Cause:
|
||||
During readdirp, for few of the files whose inode is not
|
||||
present, time attributes were served from backend. This caused
|
||||
the ctime of few files to be different between before readdir
|
||||
and after readdir by tar.
|
||||
|
||||
Solution:
|
||||
If ctime feature is enabled and inode is not present, don't
|
||||
serve the time attributes from backend file, serve it from xattr.
|
||||
|
||||
Backport of:
|
||||
> Patch: https://review.gluster.org/22540
|
||||
> fixes: bz#1698078
|
||||
> Change-Id: I427ef865f97399475faf5aa6ca495f7e317603ae
|
||||
> Signed-off-by: Kotresh HR <khiremat@redhat.com>
|
||||
|
||||
BUG: 1699709
|
||||
Change-Id: I427ef865f97399475faf5aa6ca495f7e317603ae
|
||||
Signed-off-by: Kotresh HR <khiremat@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168687
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
tests/basic/ctime/ctime-readdir.c | 29 +++++++++++++++++
|
||||
tests/basic/ctime/ctime-readdir.t | 50 ++++++++++++++++++++++++++++++
|
||||
xlators/storage/posix/src/posix-helpers.c | 29 +++++++++++------
|
||||
xlators/storage/posix/src/posix-metadata.c | 41 ++++++++++++++----------
|
||||
4 files changed, 123 insertions(+), 26 deletions(-)
|
||||
create mode 100644 tests/basic/ctime/ctime-readdir.c
|
||||
create mode 100644 tests/basic/ctime/ctime-readdir.t
|
||||
|
||||
diff --git a/tests/basic/ctime/ctime-readdir.c b/tests/basic/ctime/ctime-readdir.c
|
||||
new file mode 100644
|
||||
index 0000000..8760db2
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ctime/ctime-readdir.c
|
||||
@@ -0,0 +1,29 @@
|
||||
+#include <stdio.h>
|
||||
+#include <dirent.h>
|
||||
+#include <string.h>
|
||||
+#include <assert.h>
|
||||
+
|
||||
+int
|
||||
+main(int argc, char **argv)
|
||||
+{
|
||||
+ DIR *dir = NULL;
|
||||
+ struct dirent *entry = NULL;
|
||||
+ int ret = 0;
|
||||
+ char *path = NULL;
|
||||
+
|
||||
+ assert(argc == 2);
|
||||
+ path = argv[1];
|
||||
+
|
||||
+ dir = opendir(path);
|
||||
+ if (!dir) {
|
||||
+ printf("opendir(%s) failed.\n", path);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ while ((entry = readdir(dir)) != NULL) {
|
||||
+ }
|
||||
+ if (dir)
|
||||
+ closedir(dir);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
diff --git a/tests/basic/ctime/ctime-readdir.t b/tests/basic/ctime/ctime-readdir.t
|
||||
new file mode 100644
|
||||
index 0000000..4564fc1
|
||||
--- /dev/null
|
||||
+++ b/tests/basic/ctime/ctime-readdir.t
|
||||
@@ -0,0 +1,50 @@
|
||||
+#!/bin/bash
|
||||
+
|
||||
+. $(dirname $0)/../../include.rc
|
||||
+. $(dirname $0)/../../volume.rc
|
||||
+
|
||||
+cleanup;
|
||||
+
|
||||
+TEST glusterd
|
||||
+
|
||||
+TEST $CLI volume create $V0 replica 3 ${H0}:$B0/brick{1,2,3};
|
||||
+TEST $CLI volume set $V0 performance.stat-prefetch on
|
||||
+TEST $CLI volume set $V0 performance.readdir-ahead off
|
||||
+TEST $CLI volume start $V0;
|
||||
+
|
||||
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
|
||||
+
|
||||
+TEST mkdir $M0/dir0
|
||||
+TEST "echo hello_world > $M0/dir0/FILE"
|
||||
+
|
||||
+ctime1=$(stat -c %Z $M0/dir0/FILE)
|
||||
+echo "Mount change time: $ctime1"
|
||||
+
|
||||
+sleep 2
|
||||
+
|
||||
+#Write to back end directly to modify ctime of backend file
|
||||
+TEST "echo write_from_backend >> $B0/brick1/dir0/FILE"
|
||||
+TEST "echo write_from_backend >> $B0/brick2/dir0/FILE"
|
||||
+TEST "echo write_from_backend >> $B0/brick3/dir0/FILE"
|
||||
+echo "Backend change time"
|
||||
+echo "brick1: $(stat -c %Z $B0/brick1/dir0/FILE)"
|
||||
+echo "brick2: $(stat -c %Z $B0/brick2/dir0/FILE)"
|
||||
+echo "brick3: $(stat -c %Z $B0/brick3/dir0/FILE)"
|
||||
+
|
||||
+#Stop and start to hit the case of no inode for readdir
|
||||
+TEST umount $M0
|
||||
+TEST $CLI volume stop $V0
|
||||
+TEST $CLI volume start $V0
|
||||
+TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0;
|
||||
+
|
||||
+TEST build_tester $(dirname $0)/ctime-readdir.c
|
||||
+
|
||||
+#Do readdir
|
||||
+TEST ./$(dirname $0)/ctime-readdir $M0/dir0
|
||||
+
|
||||
+EXPECT "$ctime1" stat -c %Z $M0/dir0/FILE
|
||||
+echo "Mount change time after readdir $(stat -c %Z $M0/dir0/FILE)"
|
||||
+
|
||||
+cleanup_tester $(dirname $0)/ctime-readdir
|
||||
+
|
||||
+cleanup;
|
||||
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
|
||||
index 193afc5..37e33a9 100644
|
||||
--- a/xlators/storage/posix/src/posix-helpers.c
|
||||
+++ b/xlators/storage/posix/src/posix-helpers.c
|
||||
@@ -832,17 +832,26 @@ posix_pstat(xlator_t *this, inode_t *inode, uuid_t gfid, const char *path,
|
||||
|
||||
iatt_from_stat(&stbuf, &lstatbuf);
|
||||
|
||||
- if (inode && priv->ctime) {
|
||||
- if (!inode_locked) {
|
||||
- ret = posix_get_mdata_xattr(this, path, -1, inode, &stbuf);
|
||||
+ if (priv->ctime) {
|
||||
+ if (inode) {
|
||||
+ if (!inode_locked) {
|
||||
+ ret = posix_get_mdata_xattr(this, path, -1, inode, &stbuf);
|
||||
+ } else {
|
||||
+ ret = __posix_get_mdata_xattr(this, path, -1, inode, &stbuf);
|
||||
+ }
|
||||
+ if (ret) {
|
||||
+ gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_GETMDATA_FAILED,
|
||||
+ "posix get mdata failed on gfid: %s",
|
||||
+ uuid_utoa(inode->gfid));
|
||||
+ goto out;
|
||||
+ }
|
||||
} else {
|
||||
- ret = __posix_get_mdata_xattr(this, path, -1, inode, &stbuf);
|
||||
- }
|
||||
- if (ret) {
|
||||
- gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_GETMDATA_FAILED,
|
||||
- "posix get mdata failed on gfid: %s",
|
||||
- uuid_utoa(inode->gfid));
|
||||
- goto out;
|
||||
+ ret = __posix_get_mdata_xattr(this, path, -1, NULL, &stbuf);
|
||||
+ if (ret) {
|
||||
+ gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_GETMDATA_FAILED,
|
||||
+ "posix get mdata failed on path: %s", path);
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c
|
||||
index 0ea9099..7ff5225 100644
|
||||
--- a/xlators/storage/posix/src/posix-metadata.c
|
||||
+++ b/xlators/storage/posix/src/posix-metadata.c
|
||||
@@ -79,6 +79,7 @@ posix_fetch_mdata_xattr(xlator_t *this, const char *real_path_arg, int _fd,
|
||||
fd_based_fop = _gf_true;
|
||||
}
|
||||
if (!(fd_based_fop || real_path_arg)) {
|
||||
+ GF_VALIDATE_OR_GOTO(this->name, inode, out);
|
||||
MAKE_HANDLE_PATH(real_path, this, inode->gfid, NULL);
|
||||
if (!real_path) {
|
||||
uuid_utoa_r(inode->gfid, gfid_str);
|
||||
@@ -114,14 +115,14 @@ posix_fetch_mdata_xattr(xlator_t *this, const char *real_path_arg, int _fd,
|
||||
key,
|
||||
real_path ? real_path
|
||||
: (real_path_arg ? real_path_arg : "null"),
|
||||
- uuid_utoa(inode->gfid));
|
||||
+ inode ? uuid_utoa(inode->gfid) : "null");
|
||||
} else {
|
||||
gf_msg(this->name, GF_LOG_DEBUG, *op_errno, P_MSG_XATTR_FAILED,
|
||||
"getxattr failed"
|
||||
" on %s gfid: %s key: %s ",
|
||||
real_path ? real_path
|
||||
: (real_path_arg ? real_path_arg : "null"),
|
||||
- uuid_utoa(inode->gfid), key);
|
||||
+ inode ? uuid_utoa(inode->gfid) : "null", key);
|
||||
}
|
||||
op_ret = -1;
|
||||
goto out;
|
||||
@@ -148,7 +149,7 @@ posix_fetch_mdata_xattr(xlator_t *this, const char *real_path_arg, int _fd,
|
||||
"getxattr failed on "
|
||||
" on %s gfid: %s key: %s ",
|
||||
real_path ? real_path : (real_path_arg ? real_path_arg : "null"),
|
||||
- uuid_utoa(inode->gfid), key);
|
||||
+ inode ? uuid_utoa(inode->gfid) : "null", key);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -233,9 +234,14 @@ __posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
|
||||
int ret = -1;
|
||||
int op_errno = 0;
|
||||
|
||||
- GF_VALIDATE_OR_GOTO(this->name, inode, out);
|
||||
+ /* Handle readdirp: inode might be null, time attributes should be served
|
||||
+ * from xattr not from backend's file attributes */
|
||||
+ if (inode) {
|
||||
+ ret = __inode_ctx_get1(inode, this, (uint64_t *)&mdata);
|
||||
+ } else {
|
||||
+ ret = -1;
|
||||
+ }
|
||||
|
||||
- ret = __inode_ctx_get1(inode, this, (uint64_t *)&mdata);
|
||||
if (ret == -1 || !mdata) {
|
||||
mdata = GF_CALLOC(1, sizeof(posix_mdata_t), gf_posix_mt_mdata_attr);
|
||||
if (!mdata) {
|
||||
@@ -251,7 +257,9 @@ __posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
|
||||
* is hit when in-memory status is lost due to brick
|
||||
* down scenario
|
||||
*/
|
||||
- __inode_ctx_set1(inode, this, (uint64_t *)&mdata);
|
||||
+ if (inode) {
|
||||
+ __inode_ctx_set1(inode, this, (uint64_t *)&mdata);
|
||||
+ }
|
||||
} else {
|
||||
/* Failed to get mdata from disk, xattr missing.
|
||||
* This happens on two cases.
|
||||
@@ -278,7 +286,8 @@ __posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
|
||||
*/
|
||||
gf_msg(this->name, GF_LOG_WARNING, op_errno,
|
||||
P_MSG_FETCHMDATA_FAILED, "file: %s: gfid: %s key:%s ",
|
||||
- real_path ? real_path : "null", uuid_utoa(inode->gfid),
|
||||
+ real_path ? real_path : "null",
|
||||
+ inode ? uuid_utoa(inode->gfid) : "null",
|
||||
GF_XATTR_MDATA_KEY);
|
||||
GF_FREE(mdata);
|
||||
ret = 0;
|
||||
@@ -297,6 +306,10 @@ __posix_get_mdata_xattr(xlator_t *this, const char *real_path, int _fd,
|
||||
stbuf->ia_atime = mdata->atime.tv_sec;
|
||||
stbuf->ia_atime_nsec = mdata->atime.tv_nsec;
|
||||
}
|
||||
+ /* Not set in inode context, hence free mdata */
|
||||
+ if (!inode) {
|
||||
+ GF_FREE(mdata);
|
||||
+ }
|
||||
|
||||
out:
|
||||
return ret;
|
||||
@@ -416,6 +429,11 @@ posix_set_mdata_xattr(xlator_t *this, const char *real_path, int fd,
|
||||
}
|
||||
}
|
||||
|
||||
+ if ((flag->ctime == 0) && (flag->mtime == 0) && (flag->atime == 0)) {
|
||||
+ ret = 0;
|
||||
+ goto unlock;
|
||||
+ }
|
||||
+
|
||||
/* Earlier, mdata was updated only if the existing time is less
|
||||
* than the time to be updated. This would fail the scenarios
|
||||
* where mtime can be set to any time using the syscall. Hence
|
||||
@@ -486,7 +504,6 @@ out:
|
||||
stbuf->ia_atime_nsec = mdata->atime.tv_nsec;
|
||||
}
|
||||
|
||||
-
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -604,10 +621,6 @@ posix_set_ctime(call_frame_t *frame, xlator_t *this, const char *real_path,
|
||||
|
||||
if (priv->ctime) {
|
||||
(void)posix_get_mdata_flag(frame->root->flags, &flag);
|
||||
- if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
if (frame->root->ctime.tv_sec == 0) {
|
||||
gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_SETMDATA_FAILED,
|
||||
"posix set mdata failed, No ctime : %s gfid:%s", real_path,
|
||||
@@ -643,9 +656,6 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
|
||||
|
||||
if (inode && priv->ctime) {
|
||||
(void)posix_get_parent_mdata_flag(frame->root->flags, &flag);
|
||||
- if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
|
||||
- goto out;
|
||||
- }
|
||||
ret = posix_set_mdata_xattr(this, real_path, fd, inode,
|
||||
&frame->root->ctime, stbuf, &flag,
|
||||
_gf_false);
|
||||
@@ -655,7 +665,6 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
|
||||
uuid_utoa(inode->gfid));
|
||||
}
|
||||
}
|
||||
-out:
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
79
0123-ctime-Fix-log-repeated-logging-during-open.patch
Normal file
79
0123-ctime-Fix-log-repeated-logging-during-open.patch
Normal file
@ -0,0 +1,79 @@
|
||||
From 03c0395a1ead769167046713a99662bc5c5233fa Mon Sep 17 00:00:00 2001
|
||||
From: Kotresh HR <khiremat@redhat.com>
|
||||
Date: Fri, 19 Apr 2019 11:34:37 +0530
|
||||
Subject: [PATCH 123/124] ctime: Fix log repeated logging during open
|
||||
|
||||
The log "posix set mdata failed, No ctime" logged repeatedly
|
||||
after the fix [1]. Those could be internal fops. This patch
|
||||
fixes the same.
|
||||
|
||||
[1] https://review.gluster.org/22540
|
||||
|
||||
Backport of:
|
||||
> Patch: https://review.gluster.org/22591
|
||||
> fixes: bz#1701457
|
||||
> Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650
|
||||
> Signed-off-by: Kotresh HR <khiremat@redhat.com>
|
||||
|
||||
BUG: 1699709
|
||||
Change-Id: I42799a90b976982cedb0ca11fa224d555eb05650
|
||||
Signed-off-by: Kotresh HR <khiremat@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168688
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
xlators/storage/posix/src/posix-metadata.c | 15 +++++----------
|
||||
1 file changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/xlators/storage/posix/src/posix-metadata.c b/xlators/storage/posix/src/posix-metadata.c
|
||||
index 7ff5225..e96f222 100644
|
||||
--- a/xlators/storage/posix/src/posix-metadata.c
|
||||
+++ b/xlators/storage/posix/src/posix-metadata.c
|
||||
@@ -429,11 +429,6 @@ posix_set_mdata_xattr(xlator_t *this, const char *real_path, int fd,
|
||||
}
|
||||
}
|
||||
|
||||
- if ((flag->ctime == 0) && (flag->mtime == 0) && (flag->atime == 0)) {
|
||||
- ret = 0;
|
||||
- goto unlock;
|
||||
- }
|
||||
-
|
||||
/* Earlier, mdata was updated only if the existing time is less
|
||||
* than the time to be updated. This would fail the scenarios
|
||||
* where mtime can be set to any time using the syscall. Hence
|
||||
@@ -621,13 +616,9 @@ posix_set_ctime(call_frame_t *frame, xlator_t *this, const char *real_path,
|
||||
|
||||
if (priv->ctime) {
|
||||
(void)posix_get_mdata_flag(frame->root->flags, &flag);
|
||||
- if (frame->root->ctime.tv_sec == 0) {
|
||||
- gf_msg(this->name, GF_LOG_WARNING, errno, P_MSG_SETMDATA_FAILED,
|
||||
- "posix set mdata failed, No ctime : %s gfid:%s", real_path,
|
||||
- inode ? uuid_utoa(inode->gfid) : "No inode");
|
||||
+ if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
|
||||
goto out;
|
||||
}
|
||||
-
|
||||
ret = posix_set_mdata_xattr(this, real_path, fd, inode,
|
||||
&frame->root->ctime, stbuf, &flag,
|
||||
_gf_false);
|
||||
@@ -656,6 +647,9 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
|
||||
|
||||
if (inode && priv->ctime) {
|
||||
(void)posix_get_parent_mdata_flag(frame->root->flags, &flag);
|
||||
+ if ((flag.ctime == 0) && (flag.mtime == 0) && (flag.atime == 0)) {
|
||||
+ goto out;
|
||||
+ }
|
||||
ret = posix_set_mdata_xattr(this, real_path, fd, inode,
|
||||
&frame->root->ctime, stbuf, &flag,
|
||||
_gf_false);
|
||||
@@ -665,6 +659,7 @@ posix_set_parent_ctime(call_frame_t *frame, xlator_t *this,
|
||||
uuid_utoa(inode->gfid));
|
||||
}
|
||||
}
|
||||
+out:
|
||||
return;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.1
|
||||
|
39
0124-spec-remove-duplicate-references-to-files.patch
Normal file
39
0124-spec-remove-duplicate-references-to-files.patch
Normal file
@ -0,0 +1,39 @@
|
||||
From e7112224eebaa91c529397a944e94254e482f48f Mon Sep 17 00:00:00 2001
|
||||
From: Milind Changire <mchangir@redhat.com>
|
||||
Date: Thu, 25 Apr 2019 13:07:19 +0530
|
||||
Subject: [PATCH 124/124] spec: remove duplicate references to files
|
||||
|
||||
Label: DOWNSTREAM ONLY
|
||||
|
||||
Change-Id: I446fbeadaaab96aa215f4fd784d951f825486008
|
||||
Signed-off-by: Milind Changire <mchangir@redhat.com>
|
||||
Reviewed-on: https://code.engineering.redhat.com/gerrit/168735
|
||||
Tested-by: RHGS Build Bot <nigelb@redhat.com>
|
||||
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
|
||||
---
|
||||
glusterfs.spec.in | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
|
||||
index d20b062..86a1527 100644
|
||||
--- a/glusterfs.spec.in
|
||||
+++ b/glusterfs.spec.in
|
||||
@@ -1214,7 +1214,6 @@ exit 0
|
||||
%endif
|
||||
%else
|
||||
%{_libdir}/pkgconfig/libgfchangelog.pc
|
||||
-%{_libdir}/libgfchangelog.so
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
%{_libdir}/pkgconfig/libgfdb.pc
|
||||
%endif
|
||||
@@ -1469,7 +1468,6 @@ exit 0
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
-%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/quotad
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/scrub
|
||||
--
|
||||
1.8.3.1
|
||||
|
351
glusterfs.spec
351
glusterfs.spec
@ -52,11 +52,6 @@
|
||||
# rpmbuild -ta glusterfs-6.0.tar.gz --without georeplication
|
||||
%{?_without_georeplication:%global _without_georeplication --disable-georeplication}
|
||||
|
||||
# gnfs
|
||||
# if you wish to compile an rpm with the legacy gNFS server xlator
|
||||
# rpmbuild -ta glusterfs-6.0.tar.gz --with gnfs
|
||||
%{?_with_gnfs:%global _with_gnfs --enable-gnfs}
|
||||
|
||||
# ipv6default
|
||||
# if you wish to compile an rpm with IPv6 default...
|
||||
# rpmbuild -ta glusterfs-6.0.tar.gz --with ipv6default
|
||||
@ -153,7 +148,7 @@
|
||||
%if 0%{?_without_server:1}
|
||||
%global _without_events --disable-events
|
||||
%global _without_georeplication --disable-georeplication
|
||||
%global _with_gnfs %{nil}
|
||||
%global _without_tiering --disable-tiering
|
||||
%global _without_ocf --without-ocf
|
||||
%endif
|
||||
|
||||
@ -173,6 +168,8 @@
|
||||
%endif
|
||||
|
||||
%if ( 0%{?_with_systemd:1} )
|
||||
%global service_enable() /bin/systemctl --quiet enable %1.service || : \
|
||||
%{nil}
|
||||
%global service_start() /bin/systemctl --quiet start %1.service || : \
|
||||
%{nil}
|
||||
%global service_stop() /bin/systemctl --quiet stop %1.service || :\
|
||||
@ -186,7 +183,7 @@
|
||||
%global glustereventsd_svcfile %{_unitdir}/glustereventsd.service
|
||||
%global glusterfssharedstorage_svcfile %{_unitdir}/glusterfssharedstorage.service
|
||||
%else
|
||||
%global systemd_post() /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
|
||||
%global service_enable() /sbin/chkconfig --add %1 >/dev/null 2>&1 || : \
|
||||
%{nil}
|
||||
%global systemd_preun() /sbin/chkconfig --del %1 >/dev/null 2>&1 || : \
|
||||
%{nil}
|
||||
@ -234,7 +231,7 @@ Release: 0.1%{?prereltag:.%{prereltag}}%{?dist}
|
||||
%else
|
||||
Name: glusterfs
|
||||
Version: 6.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
ExcludeArch: i686
|
||||
%endif
|
||||
License: GPLv2 or LGPLv3+
|
||||
@ -288,6 +285,9 @@ BuildRequires: libuuid-devel
|
||||
%if ( 0%{?_with_cmocka:1} )
|
||||
BuildRequires: libcmocka-devel >= 1.0.1
|
||||
%endif
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
BuildRequires: sqlite-devel
|
||||
%endif
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
BuildRequires: libattr-devel
|
||||
%endif
|
||||
@ -300,7 +300,6 @@ Obsoletes: hekafs
|
||||
Obsoletes: %{name}-common < %{version}-%{release}
|
||||
Obsoletes: %{name}-core < %{version}-%{release}
|
||||
Obsoletes: %{name}-ufo
|
||||
Obsoletes: %{name}-ganesha
|
||||
%if ( 0%{!?_with_gnfs:1} )
|
||||
Obsoletes: %{name}-gnfs
|
||||
%endif
|
||||
@ -359,6 +358,78 @@ Patch0049: 0049-transport-socket-log-shutdown-msg-occasionally.patch
|
||||
Patch0050: 0050-geo-rep-Fix-syncing-multiple-rename-of-symlink.patch
|
||||
Patch0051: 0051-spec-update-rpm-install-condition.patch
|
||||
Patch0052: 0052-geo-rep-IPv6-support.patch
|
||||
Patch0053: 0053-Revert-packaging-ganesha-remove-glusterfs-ganesha-su.patch
|
||||
Patch0054: 0054-Revert-glusterd-storhaug-remove-ganesha.patch
|
||||
Patch0055: 0055-Revert-storhaug-HA-first-step-remove-resource-agents.patch
|
||||
Patch0056: 0056-common-ha-fixes-for-Debian-based-systems.patch
|
||||
Patch0057: 0057-ganesha-scripts-Remove-export-entries-from-ganesha.c.patch
|
||||
Patch0058: 0058-glusterd-ganesha-During-volume-delete-remove-the-gan.patch
|
||||
Patch0059: 0059-glusterd-ganesha-throw-proper-error-for-gluster-nfs-.patch
|
||||
Patch0060: 0060-ganesha-scripts-Stop-ganesha-process-on-all-nodes-if.patch
|
||||
Patch0061: 0061-ganesha-allow-refresh-config-and-volume-export-unexp.patch
|
||||
Patch0062: 0062-glusterd-ganesha-perform-removal-of-ganesha.conf-on-.patch
|
||||
Patch0063: 0063-glusterd-ganesha-update-cache-invalidation-properly-.patch
|
||||
Patch0064: 0064-glusterd-ganesha-return-proper-value-in-pre_setup.patch
|
||||
Patch0065: 0065-ganesha-scripts-remove-dependency-over-export-config.patch
|
||||
Patch0066: 0066-glusterd-ganesha-add-proper-NULL-check-in-manage_exp.patch
|
||||
Patch0067: 0067-ganesha-minor-improvments-for-commit-e91cdf4-17081.patch
|
||||
Patch0068: 0068-common-ha-surviving-ganesha.nfsd-not-put-in-grace-on.patch
|
||||
Patch0069: 0069-common-ha-enable-and-disable-selinux-ganesha_use_fus.patch
|
||||
Patch0070: 0070-packaging-glusterfs-ganesha-update-sometimes-fails-s.patch
|
||||
Patch0071: 0071-common-ha-enable-and-disable-selinux-gluster_use_exe.patch
|
||||
Patch0072: 0072-ganesha-ha-don-t-set-SELinux-booleans-if-SELinux-is-.patch
|
||||
Patch0073: 0073-build-remove-ganesha-dependency-on-selinux-policy.patch
|
||||
Patch0074: 0074-common-ha-enable-pacemaker-at-end-of-setup.patch
|
||||
Patch0075: 0075-common-ha-Fix-an-incorrect-syntax-during-setup.patch
|
||||
Patch0076: 0076-glusterd-ganesha-change-voltype-for-ganesha.enable-i.patch
|
||||
Patch0077: 0077-glusterd-ganesha-create-remove-export-file-only-from.patch
|
||||
Patch0078: 0078-common-ha-scripts-pass-the-list-of-servers-properly-.patch
|
||||
Patch0079: 0079-common-ha-All-statd-related-files-need-to-be-owned-b.patch
|
||||
Patch0080: 0080-glusterd-ganesha-Skip-non-ganesha-nodes-properly-for.patch
|
||||
Patch0081: 0081-ganesha-ha-ensure-pacemaker-is-enabled-after-setup.patch
|
||||
Patch0082: 0082-build-Add-dependency-on-netstat-for-glusterfs-ganesh.patch
|
||||
Patch0083: 0083-common-ha-enable-and-disable-selinux-ganesha_use_fus.patch
|
||||
Patch0084: 0084-glusterd-Fix-duplicate-client_op_version-in-info-fil.patch
|
||||
Patch0085: 0085-Revert-all-remove-code-which-is-not-being-considered.patch
|
||||
Patch0086: 0086-Revert-tiering-remove-the-translator-from-build-and-.patch
|
||||
Patch0087: 0087-ganesha-fixing-minor-issues-after-the-backport-from-.patch
|
||||
Patch0088: 0088-tier-fix-failures-noticed-during-tier-start-and-tier.patch
|
||||
Patch0089: 0089-glusterd-gNFS-On-post-upgrade-to-3.2-disable-gNFS-fo.patch
|
||||
Patch0090: 0090-Revert-build-conditionally-build-legacy-gNFS-server-.patch
|
||||
Patch0091: 0091-glusterd-gNFS-explicitly-set-nfs.disable-to-off-afte.patch
|
||||
Patch0092: 0092-logging-Fix-GF_LOG_OCCASSIONALLY-API.patch
|
||||
Patch0093: 0093-glusterd-Change-op-version-of-cache-invalidation-in-.patch
|
||||
Patch0094: 0094-glusterd-load-ctime-in-the-client-graph-only-if-it-s.patch
|
||||
Patch0095: 0095-cluster-afr-Remove-local-from-owners_list-on-failure.patch
|
||||
Patch0096: 0096-core-Brick-is-not-able-to-detach-successfully-in-bri.patch
|
||||
Patch0097: 0097-glusterd-tier-while-doing-an-attach-tier-the-self-he.patch
|
||||
Patch0098: 0098-mgmt-shd-Implement-multiplexing-in-self-heal-daemon.patch
|
||||
Patch0099: 0099-client-fini-return-fini-after-rpc-cleanup.patch
|
||||
Patch0100: 0100-clnt-rpc-ref-leak-during-disconnect.patch
|
||||
Patch0101: 0101-shd-mux-Fix-coverity-issues-introduced-by-shd-mux-pa.patch
|
||||
Patch0102: 0102-rpc-transport-Missing-a-ref-on-dict-while-creating-t.patch
|
||||
Patch0103: 0103-dht-NULL-check-before-setting-error-flag.patch
|
||||
Patch0104: 0104-afr-shd-Cleanup-self-heal-daemon-resources-during-af.patch
|
||||
Patch0105: 0105-core-Log-level-changes-do-not-effect-on-running-clie.patch
|
||||
Patch0106: 0106-libgfchangelog-use-find_library-to-locate-shared-lib.patch
|
||||
Patch0107: 0107-gfapi-add-function-to-set-client-pid.patch
|
||||
Patch0108: 0108-afr-add-client-pid-to-all-gf_event-calls.patch
|
||||
Patch0109: 0109-glusterd-Optimize-glusterd-handshaking-code-path.patch
|
||||
Patch0110: 0110-tier-shd-glusterd-with-shd-mux-the-shd-volfile-path-.patch
|
||||
Patch0111: 0111-glusterd-fix-loading-ctime-in-client-graph-logic.patch
|
||||
Patch0112: 0112-geo-rep-fix-incorrectly-formatted-authorized_keys.patch
|
||||
Patch0113: 0113-spec-Glusterd-did-not-start-by-default-after-node-re.patch
|
||||
Patch0114: 0114-core-fix-hang-issue-in-__gf_free.patch
|
||||
Patch0115: 0115-core-only-log-seek-errors-if-SEEK_HOLE-SEEK_DATA-is-.patch
|
||||
Patch0116: 0116-cluster-ec-fix-fd-reopen.patch
|
||||
Patch0117: 0117-spec-Remove-thin-arbiter-package.patch
|
||||
Patch0118: 0118-tests-mark-thin-arbiter-test-ta.t-as-bad.patch
|
||||
Patch0119: 0119-glusterd-provide-a-way-to-detach-failed-node.patch
|
||||
Patch0120: 0120-glusterd-shd-Keep-a-ref-on-volinfo-until-attach-rpc-.patch
|
||||
Patch0121: 0121-spec-glusterfs-devel-for-client-build-should-not-dep.patch
|
||||
Patch0122: 0122-posix-ctime-Fix-stat-time-attributes-inconsistency-d.patch
|
||||
Patch0123: 0123-ctime-Fix-log-repeated-logging-during-open.patch
|
||||
Patch0124: 0124-spec-remove-duplicate-references-to-files.patch
|
||||
|
||||
%description
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
@ -509,6 +580,48 @@ is in user space and easily manageable.
|
||||
This package provides support to FUSE based clients and inlcudes the
|
||||
glusterfs(d) binary.
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%package ganesha
|
||||
Summary: NFS-Ganesha configuration
|
||||
Group: Applications/File
|
||||
|
||||
Requires: %{name}-server%{?_isa} = %{version}-%{release}
|
||||
Requires: nfs-ganesha-gluster >= 2.4.1
|
||||
Requires: pcs, dbus
|
||||
%if ( 0%{?rhel} && 0%{?rhel} == 6 )
|
||||
Requires: cman, pacemaker, corosync
|
||||
%endif
|
||||
|
||||
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} > 5 )
|
||||
# we need portblock resource-agent in 3.9.5 and later.
|
||||
Requires: resource-agents >= 3.9.5
|
||||
Requires: net-tools
|
||||
%endif
|
||||
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%if ( 0%{?rhel} )
|
||||
Requires: selinux-policy >= 3.13.1-160
|
||||
Requires(post): policycoreutils-python
|
||||
Requires(postun): policycoreutils-python
|
||||
%else
|
||||
Requires(post): policycoreutils-python-utils
|
||||
Requires(postun): policycoreutils-python-utils
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description ganesha
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
petabytes. It aggregates various storage bricks over Infiniband RDMA
|
||||
or TCP/IP interconnect into one large parallel network file
|
||||
system. GlusterFS is one of the most sophisticated file systems in
|
||||
terms of features and extensibility. It borrows a powerful concept
|
||||
called Translators from GNU Hurd kernel. Much of the code in GlusterFS
|
||||
is in user space and easily manageable.
|
||||
|
||||
This package provides the configuration and related files for using
|
||||
NFS-Ganesha as the NFS server using GlusterFS
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
%package geo-replication
|
||||
Summary: GlusterFS Geo-replication
|
||||
@ -534,25 +647,6 @@ is in userspace and easily manageable.
|
||||
This package provides support to geo-replication.
|
||||
%endif
|
||||
|
||||
%if ( 0%{?_with_gnfs:1} )
|
||||
%package gnfs
|
||||
Summary: GlusterFS gNFS server
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release}
|
||||
Requires: nfs-utils
|
||||
|
||||
%description gnfs
|
||||
GlusterFS is a distributed file-system capable of scaling to several
|
||||
petabytes. It aggregates various storage bricks over Infiniband RDMA
|
||||
or TCP/IP interconnect into one large parallel network file
|
||||
system. GlusterFS is one of the most sophisticated file systems in
|
||||
terms of features and extensibility. It borrows a powerful concept
|
||||
called Translators from GNU Hurd kernel. Much of the code in GlusterFS
|
||||
is in user space and easily manageable.
|
||||
|
||||
This package provides the glusterfs legacy gNFS server xlator
|
||||
%endif
|
||||
|
||||
%package libs
|
||||
Summary: GlusterFS common libraries
|
||||
|
||||
@ -668,6 +762,7 @@ Requires: %{name}-api%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release}
|
||||
# lvm2 for snapshot, and nfs-utils and rpcbind/portmap for gnfs server
|
||||
Requires: lvm2
|
||||
Requires: nfs-utils
|
||||
%if ( 0%{?_with_systemd:1} )
|
||||
%{?systemd_requires}
|
||||
%else
|
||||
@ -713,18 +808,6 @@ is in user space and easily manageable.
|
||||
This package provides the glusterfs server daemon.
|
||||
%endif
|
||||
|
||||
%package thin-arbiter
|
||||
Summary: GlusterFS thin-arbiter module
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: %{name}-server%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description thin-arbiter
|
||||
This package provides a tie-breaker functionality to GlusterFS
|
||||
replicate volume. It includes translators required to provide the
|
||||
functionality, and also few other scripts required for getting the setup done.
|
||||
|
||||
This package provides the glusterfs thin-arbiter translator.
|
||||
|
||||
%package client-xlators
|
||||
Summary: GlusterFS client-side translators
|
||||
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
|
||||
@ -803,16 +886,39 @@ do
|
||||
for doc in ${EXCLUDE_DOCS}; do
|
||||
EXCLUDE_DOCS_OPT="--exclude=$doc $EXCLUDE_DOCS_OPT"
|
||||
done
|
||||
# apply the patch with 'git apply'
|
||||
git apply -p1 --exclude=rfc.sh \
|
||||
--exclude=.gitignore \
|
||||
--exclude=.testignore \
|
||||
--exclude=MAINTAINERS \
|
||||
--exclude=extras/checkpatch.pl \
|
||||
--exclude=build-aux/checkpatch.pl \
|
||||
--exclude='tests/*' \
|
||||
${EXCLUDE_DOCS_OPT} \
|
||||
$p
|
||||
|
||||
# HACK to fix build
|
||||
bn=$(basename $p)
|
||||
if [ "$bn" == "0085-Revert-all-remove-code-which-is-not-being-considered.patch" ]; then
|
||||
(patch -p1 -u -F3 < $p || :)
|
||||
if [ -f libglusterfs/Makefile.am.rej ]; then
|
||||
sed -i -e 's/^SUBDIRS = src/SUBDIRS = src src\/gfdb/g;s/^CLEANFILES = /CLEANFILES =/g' libglusterfs/Makefile.am
|
||||
fi
|
||||
elif [ "$bn" == "0053-Revert-packaging-ganesha-remove-glusterfs-ganesha-su.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
elif [ "$bn" == "0055-Revert-storhaug-HA-first-step-remove-resource-agents.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
elif [ "$bn" == "0090-Revert-build-conditionally-build-legacy-gNFS-server-.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
elif [ "$bn" == "0117-spec-Remove-thin-arbiter-package.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
elif [ "$bn" == "0023-hooks-remove-selinux-hooks.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
elif [ "$bn" == "0042-spec-client-server-Builds-are-failing-on-rhel-6.patch" ]; then
|
||||
(patch -p1 < $p || :)
|
||||
else
|
||||
# apply the patch with 'git apply'
|
||||
git apply -p1 --exclude=rfc.sh \
|
||||
--exclude=.gitignore \
|
||||
--exclude=.testignore \
|
||||
--exclude=MAINTAINERS \
|
||||
--exclude=extras/checkpatch.pl \
|
||||
--exclude=build-aux/checkpatch.pl \
|
||||
--exclude='tests/*' \
|
||||
${EXCLUDE_DOCS_OPT} \
|
||||
$p
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
%if ( ! %{_usepython3} )
|
||||
@ -848,7 +954,6 @@ export LDFLAGS
|
||||
%{?_with_cmocka} \
|
||||
%{?_with_debug} \
|
||||
%{?_with_firewalld} \
|
||||
%{?_with_gnfs} \
|
||||
%{?_with_tmpfilesdir} \
|
||||
%{?_with_tsan} \
|
||||
%{?_with_valgrind} \
|
||||
@ -860,6 +965,7 @@ export LDFLAGS
|
||||
%{?_without_rdma} \
|
||||
%{?_without_server} \
|
||||
%{?_without_syslog} \
|
||||
%{?_without_tiering} \
|
||||
%{?_with_ipv6default} \
|
||||
%{?_without_libtirpc}
|
||||
|
||||
@ -941,6 +1047,15 @@ sed -i 's|option working-directory /etc/glusterd|option working-directory %{_sha
|
||||
install -D -p -m 0644 extras/glusterfs-logrotate \
|
||||
%{buildroot}%{_sysconfdir}/logrotate.d/glusterfs
|
||||
|
||||
# ganesha ghosts
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
mkdir -p %{buildroot}%{_sysconfdir}/ganesha
|
||||
touch %{buildroot}%{_sysconfdir}/ganesha/ganesha-ha.conf
|
||||
mkdir -p %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/
|
||||
touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
|
||||
touch %{buildroot}%{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
mkdir -p %{buildroot}%{_sharedstatedir}/glusterd/geo-replication
|
||||
touch %{buildroot}%{_sharedstatedir}/glusterd/geo-replication/gsyncd_template.conf
|
||||
@ -1000,7 +1115,15 @@ exit 0
|
||||
|
||||
%if ( 0%{!?_without_events:1} )
|
||||
%post events
|
||||
%systemd_post glustereventsd
|
||||
%service_enable glustereventsd
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%post ganesha
|
||||
semanage boolean -m ganesha_use_fusefs --on
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
@ -1017,9 +1140,9 @@ exit 0
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%post server
|
||||
# Legacy server
|
||||
%systemd_post glusterd
|
||||
%service_enable glusterd
|
||||
%if ( 0%{_for_fedora_koji_builds} )
|
||||
%systemd_post glusterfsd
|
||||
%service_enable glusterfsd
|
||||
%endif
|
||||
# ".cmd_log_history" is renamed to "cmd_history.log" in GlusterFS-3.7 .
|
||||
# While upgrading glusterfs-server package form GlusterFS version <= 3.6 to
|
||||
@ -1109,14 +1232,6 @@ fi
|
||||
exit 0
|
||||
%endif
|
||||
|
||||
%preun thin-arbiter
|
||||
if [ $1 -eq 0 ]; then
|
||||
if [ -f %glusterta_svcfile ]; then
|
||||
%service_stop gluster-ta-volume
|
||||
%systemd_preun gluster-ta-volume
|
||||
fi
|
||||
fi
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%postun should be placed here and keep them sorted
|
||||
##
|
||||
@ -1135,6 +1250,36 @@ fi
|
||||
exit 0
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%postun ganesha
|
||||
semanage boolean -m ganesha_use_fusefs --off
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%trigger should be placed here and keep them sorted
|
||||
##
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%trigger ganesha -- selinux-policy-targeted
|
||||
semanage boolean -m ganesha_use_fusefs --on
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%triggerun should be placed here and keep them sorted
|
||||
##
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%if ( 0%{?fedora} && 0%{?fedora} > 25 || ( 0%{?rhel} && 0%{?rhel} > 6 ) )
|
||||
%triggerun ganesha -- selinux-policy-targeted
|
||||
semanage boolean -m ganesha_use_fusefs --off
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
##-----------------------------------------------------------------------------
|
||||
## All %%files should be placed here and keep them grouped
|
||||
##
|
||||
@ -1215,6 +1360,19 @@ exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if ( 0%{?_without_server:1} )
|
||||
#exclude ganesha related files
|
||||
%exclude %{_sysconfdir}/ganesha/ganesha-ha.conf.sample
|
||||
%exclude %{_libexecdir}/ganesha/*
|
||||
%exclude %{_prefix}/lib/ocf/resource.d/heartbeat/*
|
||||
%endif
|
||||
|
||||
%exclude %{_datadir}/glusterfs/scripts/setup-thin-arbiter.sh
|
||||
|
||||
%if ( 0%{?_without_server:1} )
|
||||
%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
%endif
|
||||
|
||||
%files api
|
||||
%exclude %{_libdir}/*.so
|
||||
# libgfapi files
|
||||
@ -1250,9 +1408,14 @@ exit 0
|
||||
%if ( 0%{?_without_server:1} )
|
||||
%exclude %{_libdir}/pkgconfig/libgfchangelog.pc
|
||||
%exclude %{_libdir}/libgfchangelog.so
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
%exclude %{_libdir}/pkgconfig/libgfdb.pc
|
||||
%endif
|
||||
%else
|
||||
%{_libdir}/pkgconfig/libgfchangelog.pc
|
||||
%{_libdir}/libgfchangelog.so
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
%{_libdir}/pkgconfig/libgfdb.pc
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%files client-xlators
|
||||
@ -1284,30 +1447,6 @@ exit 0
|
||||
%{_bindir}/fusermount-glusterfs
|
||||
%endif
|
||||
|
||||
%if ( 0%{?_with_gnfs:1} && 0%{!?_without_server:1} )
|
||||
%files gnfs
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/server.so
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
%endif
|
||||
|
||||
%files thin-arbiter
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/thin-arbiter.so
|
||||
%dir %{_datadir}/glusterfs/scripts
|
||||
%{_datadir}/glusterfs/scripts/setup-thin-arbiter.sh
|
||||
%config %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
|
||||
%if ( 0%{?_with_systemd:1} )
|
||||
%{_unitdir}/gluster-ta-volume.service
|
||||
%endif
|
||||
|
||||
|
||||
%if ( 0%{!?_without_georeplication:1} )
|
||||
%files geo-replication
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs-georep
|
||||
@ -1348,6 +1487,10 @@ exit 0
|
||||
%files libs
|
||||
%{_libdir}/*.so.*
|
||||
%exclude %{_libdir}/libgfapi.*
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
# libgfdb is only needed server-side
|
||||
%exclude %{_libdir}/libgfdb.*
|
||||
%endif
|
||||
|
||||
%files -n python%{_pythonver}-gluster
|
||||
# introducing glusterfs module in site packages.
|
||||
@ -1377,6 +1520,19 @@ exit 0
|
||||
%exclude %{_datadir}/glusterfs/tests/vagrant
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_server:1} )
|
||||
%files ganesha
|
||||
%dir %{_libexecdir}/ganesha
|
||||
%{_sysconfdir}/ganesha/ganesha-ha.conf.sample
|
||||
%{_libexecdir}/ganesha/*
|
||||
%{_prefix}/lib/ocf/resource.d/heartbeat/*
|
||||
%{_sharedstatedir}/glusterd/hooks/1/start/post/S31ganesha-start.sh
|
||||
%ghost %attr(0644,-,-) %config(noreplace) %{_sysconfdir}/ganesha/ganesha-ha.conf
|
||||
%ghost %dir %attr(0755,-,-) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha
|
||||
%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha.conf
|
||||
%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/run/gluster/shared_storage/nfs-ganesha/ganesha-ha.conf
|
||||
%endif
|
||||
|
||||
%if ( 0%{!?_without_ocf:1} )
|
||||
%files resource-agents
|
||||
# /usr/lib is the standard for OCF, also on x86_64
|
||||
@ -1390,11 +1546,6 @@ exit 0
|
||||
%config(noreplace) %{_sysconfdir}/glusterfs
|
||||
%exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
|
||||
%exclude %{_sysconfdir}/glusterfs/eventsconfig.json
|
||||
%exclude %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
%exclude %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
%if ( 0%{?_with_gnfs:1} )
|
||||
%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/*
|
||||
%endif
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/glusterd
|
||||
%if ( 0%{_for_fedora_koji_builds} )
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd
|
||||
@ -1428,6 +1579,10 @@ exit 0
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/bit-rot.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/bitrot-stub.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/sdfs.so
|
||||
%if ( 0%{!?_without_tiering:1} )
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/changetimerecorder.so
|
||||
%{_libdir}/libgfdb.so.*
|
||||
%endif
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/index.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/locks.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/posix*
|
||||
@ -1438,6 +1593,7 @@ exit 0
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/trash.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/upcall.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/leases.so
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs*
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt
|
||||
%{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt/glusterd.so
|
||||
%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/protocol
|
||||
@ -1454,6 +1610,7 @@ exit 0
|
||||
|
||||
# /var/lib/glusterd, e.g. hookscripts, etc.
|
||||
%ghost %attr(0644,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/glusterd.info
|
||||
%ghost %attr(0600,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/options
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/bitd
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/groups
|
||||
@ -1506,7 +1663,10 @@ exit 0
|
||||
%dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S30samba-stop.sh
|
||||
%attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh
|
||||
%config(noreplace) %ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
|
||||
%ghost %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/quotad
|
||||
%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/scrub
|
||||
@ -1972,6 +2132,11 @@ fi
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Thu Apr 25 2019 Milind Changire <mchangir@redhat.com> - 6.0-2
|
||||
- fixes bugs bz#1471742 bz#1652461 bz#1671862 bz#1676495 bz#1691620
|
||||
bz#1696334 bz#1696903 bz#1697820 bz#1698436 bz#1698728 bz#1699709 bz#1699835
|
||||
bz#1702240
|
||||
|
||||
* Mon Apr 08 2019 Milind Changire <mchangir@redhat.com> - 6.0-1
|
||||
- rebase to upstream glusterfs at v6.0
|
||||
- fixes bugs bz#1493284 bz#1578703 bz#1600918 bz#1670415 bz#1691620
|
||||
|
Loading…
Reference in New Issue
Block a user