summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2013-08-07 17:09:17 +0530
committerAnand Avati <avati@redhat.com>2013-09-04 19:29:17 -0700
commit3bfa0dde137f35d68e7f935ddd562136b4829e21 (patch)
tree6214447af984b00de54db07d9b667ce8f46e803c /geo-replication
parent59d37265acf250b1b29c186020c55e9df0ef4215 (diff)
glusterd/gverify.sh: Stops session being created with invalid slave details
create force will fail with proper message, if the ip is not reachable, or is unable to fetch slave details. Change-Id: I44a3ba777b37702ffd0e48e9cb46c51e293327d4 BUG: 988314 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/5516 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'geo-replication')
-rwxr-xr-xgeo-replication/src/gverify.sh25
1 files changed, 16 insertions, 9 deletions
diff --git a/geo-replication/src/gverify.sh b/geo-replication/src/gverify.sh
index f10e21e..49ed2e9 100755
--- a/geo-replication/src/gverify.sh
+++ b/geo-replication/src/gverify.sh
@@ -96,6 +96,15 @@ function slave_stats()
function main()
{
+ log_file=$4
+ > $log_file
+
+ ping -w 5 $2;
+ if [ $? -ne 0 ]; then
+ echo "$2 not reachable." > $log_file
+ exit 1;
+ fi;
+
ERRORS=0;
master_data=$(master_stats $1);
slave_data=$(slave_stats $2 $3);
@@ -104,24 +113,22 @@ function main()
master_version=$(echo $master_data | cut -f2 -d':');
slave_version=$(echo $slave_data | cut -f2 -d':');
slave_no_of_files=$(echo $slave_data | cut -f3 -d':');
- log_file=$4
- > $log_file
+ slave_vol_test=$5
if [[ "x$master_size" = "x" || "x$master_version" = "x" || "$master_size" -eq "0" ]]; then
- echo "Unable to fetch master volume details." > $log_file;
+ echo "Unable to fetch master volume details. Please check the master cluster and master volume." > $log_file;
exit 1;
fi;
if [[ "x$slave_size" = "x" || "x$slave_version" = "x" || "$slave_size" -eq "0" ]]; then
- ping -w 5 $2;
- if [ $? -ne 0 ]; then
- echo "$2 not reachable." > $log_file
- exit 1;
- fi;
- echo "Unable to fetch slave volume details." > $log_file;
+ echo "Unable to fetch slave volume details. Please check the slave cluster and slave volume." > $log_file;
exit 1;
fi;
+ if [ ! -z $slave_vol_test ]; then
+ exit $ERRORS;
+ fi
+
if [ ! $slave_size -ge $(($master_size - $BUFFER_SIZE )) ]; then
echo "Total size of master is greater than available size of slave." >> $log_file;
ERRORS=$(($ERRORS + 1));