From 2ae4b4058691b324535d802f4e6d24cce89a10e5 Mon Sep 17 00:00:00 2001 From: Sanoj Unnikrishnan Date: Wed, 22 Mar 2017 15:02:12 +0530 Subject: Fixes quota aux mount failure The aux mount is created on the first limit/remove_limit/list command and it remains until volume is stopped / deleted / (quota is disabled) , where we do a lazy unmount. If the process is uncleanly terminated, then the mount entry remains and we get (Transport disconnected) error on subsequent attempts to run quota list/limit-usage/remove commands. Second issue, There is also a risk of inadvertent rm -rf on the /var/run/gluster causing data loss for the user. Ideally, /var/run is a temp path for application use and should not cause any data loss to persistent storage. Solution: 1) unmount the aux mount after each use. 2) clean stale mount before mounting, if any. One caveat with doing mount/unmount on each command is that we cannot use same mount point for both list and limit commands. The reason for this is that list command needs mount to be accessible in cli after response from glusterd, So it could be unmounted by a limit command if executed in parallel (had we used same mount point) Hence we use separate mount points for list and limit commands. Change-Id: I4f9e39da2ac2b65941399bffb6440db8a6ba59d0 BUG: 1433906 Signed-off-by: Sanoj Unnikrishnan Reviewed-on: https://review.gluster.org/16938 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Reviewed-by: Manikandan Selvaganesh CentOS-regression: Gluster Build System Reviewed-by: Raghavendra G Reviewed-by: Atin Mukherjee --- tests/volume.rc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests/volume.rc') diff --git a/tests/volume.rc b/tests/volume.rc index 5419e399d8f..5c53bba2efd 100644 --- a/tests/volume.rc +++ b/tests/volume.rc @@ -615,8 +615,9 @@ function num_graphs function get_aux() { ##Check if a auxiliary mount is there +local aux_suffix=$1 local rundir=$(gluster --print-statedumpdir) -local pidfile="${rundir}/${V0}.pid" +local pidfile="${rundir}/${V0}$aux_suffix.pid" if [ -f $pidfile ]; then local pid=$(cat ${rundir}/${V0}.pid) @@ -633,6 +634,18 @@ else fi } +function get_list_aux() +{ +# check for quota list aux mount + get_aux "_quota_list" +} + +function get_limit_aux() +{ +# check for quota list aux mount + get_aux "_quota_limit" +} + function check_for_xattr { local xattr=$1 local filepath=$2 @@ -717,6 +730,10 @@ function quota_hl_exceeded() } +function quota_object_hard_limit() +{ + quota_object_list_field $1 2 +} function scrub_status() { -- cgit