Bug 1196292

Summary: RFE: change interface of bin/add_dirs.sh script
Product: [Red Hat Storage] Red Hat Gluster Storage Reporter: Martin Bukatovic <mbukatov>
Component: rhs-hadoop-installAssignee: Jeff Vance <jvance>
Status: CLOSED ERRATA QA Contact: Martin Bukatovic <mbukatov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rhgs-3.0CC: bchilds, divya, eboyd, esammons, jvance, matt, mkudlej, nlevinki, rcyriac
Target Milestone: ---Keywords: FutureFeature, ZStream
Target Release: RHGS 3.0.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 2.44-1 Doc Type: Enhancement
Doc Text:
Now you must use bin/gen_dirs.sh in conjunction with bin/add_dirs.sh to create list of Hadoop directories on the volume.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-31 10:18: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: 1182947    

Description Martin Bukatovic 2015-02-25 16:10:45 UTC
Description of problem
======================

As described in BZ1062401#c19, script bin/add_dirs.sh has been changed:

> As of version 2.35 the syntax of bin/add_dirs.sh changed. The -d|-l|-p option
> has been removed, and instead, add_dirs accepts the directory-prefix (as it
> always has) followed by a list of directory-tuples to add. A dir-tuple is of
> the form "<dirname>:<octal-perms>:<owner>".
>
> Eg.
> bin/add_dirs /mnt/glusterfs dir1:0755:foo dir1/dir2:0775:bar   ...
> or
> bin/add_dirs /mnt/brick1/hadoop $(bin/gen_dirs.sh -l)

Since this script is expected to be executed both indirectly (by the
rhs-hadoop-install scripts themselves) and directly (by admin during Brownfield
use case), this change breaks the user facing interface established in previous
release and so we need to have a BZ for it.

Comment 3 Divya 2015-03-17 10:51:20 UTC
Jeff,

Could you please provide the doc text in the Doc Text field for this bug?

Comment 4 Jeff Vance 2015-03-17 15:55:06 UTC
The bin/add_dirs.sh script has the following syntax:
  add_dir.sh <mount-path> <dir-perm-owner list>

where <mount-path> is the path prefix prepended to the directory names in the dir-perm-owner list. If the mount path is a volume mount then the volume name must be included, eg. /mnt/glusterfs/HadoopVol.

The format of the dir-perm-owner list is:
  <dir>:<octal-permissions>:<owner-name> ...

The <dir> above is appended to <mount-path> and the resulting directory is created with the perms and owner supplied.

Example:
   bin/add_dirs.sh /mnt/glusterfs/HadoopVol mapred:0770:mapred \
                   mapred/system:0755:mapred mr-history:0755:yarn ...

add_dirs.sh should be more commonly used in conjunction with bin/gen_dirs.sh, eg.
   bin/add_dirs.sh /mnt/gluster/HadoopVol \
                   $(bin/gen_dirs.sh -d)

Comment 5 Martin Bukatovic 2015-03-18 15:49:08 UTC
I'm going to compare previous stable version rhs-hadoop-install-2_29-1.el6rhs
with the new version rhs-hadoop-install-2_44-1.el6rhs. Both are expected to
produce the same results (directory name, rights and ownership are checked).

Syntax change
-------------

Here is an example of syntax change for flag '-d':

Old syntax:

    # bin/add_dirs.sh -d /mnt/glusterfs/HadoopVol1

New syntax:

    # bin/add_dirs.sh /mnt/glusterfs/HadoopVol1 $(bin/gen_dirs.sh -d)

Results
-------

flag -d produces the same resutls in both versions
flag -l produces the same resutls in both versions
flag -p produces different resutls, new version doesn't create directory `apps/falcon`
flag -a is not present in previous verion, nothing to compare

Since we don't support Falcon (see eg. BZ 1159157), I'm ok with the results.

Comment 11 errata-xmlrpc 2015-03-31 10:18: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-2015-0761.html