Bug 1113023 - create_vol.sh should do all validation(wrong argument count etc) before running volume create command
Summary: create_vol.sh should do all validation(wrong argument count etc) before runni...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: rhs-hadoop-install
Version: rhgs-3.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: Release Candidate
: ---
Assignee: Jeff Vance
QA Contact: amainkar
URL:
Whiteboard:
Depends On:
Blocks: 1159155
TreeView+ depends on / blocked
 
Reported: 2014-06-25 09:59 UTC by Rachana Patel
Modified: 2015-04-20 11:57 UTC (History)
6 users (show)

Fixed In Version: 1.28-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-24 11:54:44 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2014:1275 0 normal SHIPPED_LIVE Red Hat Storage Server 3 Hadoop plug-in enhancement update 2014-11-24 16:53:36 UTC

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


Note You need to log in before you can comment on or make changes to this bug.