Bug 1113023

Summary: create_vol.sh should do all validation(wrong argument count etc) before running volume create command
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Rachana Patel <racpatel>
Component: rhs-hadoop-installAssignee: Jeff Vance <jvance>
Status: CLOSED ERRATA QA Contact: amainkar
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: bchilds, eboyd, matt, mkudlej, nlevinki, okomarek
Target Milestone: Release CandidateKeywords: UpcomingRelease, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 1.28-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-24 11:54:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1159155    

Description Rachana Patel 2014-06-25 09:59:57 UTC
Description of problem:
========================
while creating volume using create_vol.sh, it is not doing all validation in begining.
e.g. if brick count is not multiple of replica count it should exit script before running any gluster command rather than giving error later


Version-Release number of selected component (if applicable):
=============================================================
gluster - 3.6.0.20-1.el6rhs.x86_64

rhs-hadoop:-
rhs-hadoop-install-1_20-1.el6rhs.noarch
rhs-hadoop-2.3.2-2.noarch


How reproducible:
==================
always



Steps to Reproduce:
===================
1. give even no of brick

/usr/share/rhs-hadoop-install/create_vol.sh vol /mnt/gfs --debug rhs-gp-srv7.lab.eng.blr.redhat.com:/bk1 rhs-gp-srv4.lab.eng.blr.redhat.com:/bk1  rhs-gp-srv7.lab.eng.blr.redhat.com:/bk2 

...
...
Creating new volume vol. Continue? [y|N] y
--- creating the new vol volume...
DEBUG: bricks: rhs-gp-srv7.lab.eng.blr.redhat.com:/bk1/vol rhs-gp-srv4.lab.eng.blr.redhat.com:/bk1/vol rhs-gp-srv7.lab.eng.blr.redhat.com:/bk2/vol 
ERROR 1: gluster vol create vol rhs-gp-srv7.lab.eng.blr.redhat.com:/bk1/vol rhs-gp-srv4.lab.eng.blr.redhat.com:/bk1/vol rhs-gp-srv7.lab.eng.blr.redhat.com:/bk2/vol : number of bricks is not a multiple of replica count
Usage: volume create <NEW-VOLNAME> [stripe <COUNT>] [replica <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK>?<vg_name>... [force]
...
...


Actual results:
==============
It throws error when volume create command is giving error


Expected results:
=================
It's better to do all validation in begining and throw error when even no of bricks are supplied rather than waiting for gluster command to give error


Additional info:

Comment 2 Jeff Vance 2014-07-10 20:50:08 UTC
fixed in 1.28

Comment 3 Jeff Vance 2014-07-12 01:17:09 UTC
added to 1.28

Comment 4 Ondřej Komárek 2014-07-31 16:00:48 UTC
Tested with:
rhs-hadoop-install-1_34-1.el6rhs.noarch

Results:
I got installed machine from beaker with only setup_common runned. Then I proceeded by our hadoop installation and configuration guide to point 3. I runned create_vol.sh as mentioned in BZ description. 

./create_vol.sh vol /mnt/glusterfs --debug mrg-qe-vm-c2-201.lab.eng.brq.redhat.com:/mnt/brick1 mrg-qe-vm-c2-301.lab.eng.brq.redhat.com:/mnt/brick1 mrg-qe-vm-c2-201.lab.eng.brq.redhat.com:/mnt/brick2

It resulted in this output:

***
*** create_vol: version 1.34
***
ERROR: the number of bricks must be a multiple of the replica, which is 2

This indicates, that error is handled without running gluster command. I also found code in create_vol.sh that handles this error.

This issue is fixed -> VERIFIED.

Comment 6 errata-xmlrpc 2014-11-24 11:54:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHEA-2014-1275.html