Bug 1001033 - [Builders] Various issues with gluster-swift-gen-builders
[Builders] Various issues with gluster-swift-gen-builders
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gluster-swift (Show other bugs)
2.1
x86_64 Linux
medium Severity medium
: ---
: RHGS 2.1.2
Assigned To: crisbud@redhat.com
pushpesh sharma
: ZStream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-26 07:15 EDT by pushpesh sharma
Modified: 2015-05-15 14:35 EDT (History)
7 users (show)

See Also:
Fixed In Version: glusterfs-3.4.0.50rhs
Doc Type: Enhancement
Doc Text:
Enhancements have been made to the gluster-swift-gen-builders utility of Object Store by providing a man page and options to display outputs in verbose and non-verbose mode.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-02-25 02:35:48 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description pushpesh sharma 2013-08-26 07:15:38 EDT
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:

1. There is no man page for this very important step of having a RHS-object store setup.I think this should be fixed in the very next update of RHS2.1. 

[root@dhcp207-149 swift]# man gluster-swift-gen-builders
No manual entry for gluster-swift-gen-builders

2. There is no validation check on gluster volumes passed with the command line.

[root@dhcp207-149 swift]# gluster-swift-gen-builders  notavol1 notavol2
cp: cannot stat `/etc/swift/*.ring.gz': No such file or directory
WARNING: No region specified for z1-127.0.0.1:6012/notavol1_. Defaulting to region 1.
Device r1z1-127.0.0.1:6012/notavol1_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6012/notavol2_. Defaulting to region 1.
Device r1z2-127.0.0.1:6012/notavol2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
account.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6012  notavol1 100.00          1   0.00 
             1     1     2       127.0.0.1  6012  notavol2 100.00          1   0.00 
mkdir: cannot create directory `/etc/swift/backup_rings': File exists
WARNING: No region specified for z1-127.0.0.1:6011/notavol1_. Defaulting to region 1.
Device r1z1-127.0.0.1:6011/notavol1_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6011/notavol2_. Defaulting to region 1.
Device r1z2-127.0.0.1:6011/notavol2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
container.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6011  notavol1 100.00          1   0.00 
             1     1     2       127.0.0.1  6011  notavol2 100.00          1   0.00 
mkdir: cannot create directory `/etc/swift/backup_rings': File exists
WARNING: No region specified for z1-127.0.0.1:6010/notavol1_. Defaulting to region 1.
Device r1z1-127.0.0.1:6010/notavol1_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6010/notavol2_. Defaulting to region 1.
Device r1z2-127.0.0.1:6010/notavol2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
object.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6010  notavol1 100.00          1   0.00 
             1     1     2       127.0.0.1  6010  notavol2 100.00          1   0.00 

[root@dhcp207-149 swift]# gluster volume info
Volume Name: test2
Type: Distributed-Replicate
Volume ID: 22ac011c-3c38-4093-ba77-a32065e5fd9a
Status: Started
Number of Bricks: 3 x 2 = 6
Transport-type: tcp
Bricks:
Brick1: ip1:/mnt/lv4/lv4
Brick2: ip2:/mnt/lv4/lv4
Brick3: ip1:/mnt/lv5/lv5
Brick4: ip2:/mnt/lv5/lv5
Brick5: ip1:/mnt/lv6/lv6
Brick6: ip2:/mnt/lv6/lv6
 
Volume Name: test
Type: Distributed-Replicate
Volume ID: 671ee4a2-d5db-44b2-abb7-238617ba17a3
Status: Started
Number of Bricks: 3 x 2 = 6
Transport-type: tcp
Bricks:
Brick1: ip1:/mnt/lv1/lv1
Brick2: ip2/mnt/lv1/lv1
Brick3: ip1:/mnt/lv2/lv2
Brick4: ip2:/mnt/lv2/lv2
Brick5: ip1:/mnt/lv3/lv3
Brick6: ip2:/mnt/lv3/lv3

[root@dhcp207-149 swift]# gluster-swift-gen-builders 
Please specify the gluster volume name to use.

[root@dhcp207-149 swift]# mount
/dev/mapper/vg_dhcp207149-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

3. There is no check whether the volumes has been mounted under the default directory /mnt/gluster-object(or the one mentioned in the config file)
 
However it has been mentioned as a pre-requisite in the doc. "Here
VOLUME is a Red Hat Storage volume which has been mounted locally under the directory mentioned in the configuration files (default value is
/mnt/gluster-object)"

[root@dhcp207-149 swift]# mount
/dev/mapper/vg_dhcp207149-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/vda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

[root@dhcp207-149 swift]# gluster-swift-gen-builders test

mkdir: cannot create directory `/etc/swift/backup_rings': File exists
WARNING: No region specified for z1-127.0.0.1:6012/test_. Defaulting to region 1.
Device r1z1-127.0.0.1:6012/test_"" with 100.0 weight got id 0
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
account.builder, build version 1
2 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6012      test 100.00          2   0.00 
mkdir: cannot create directory `/etc/swift/backup_rings': File exists
WARNING: No region specified for z1-127.0.0.1:6011/test_. Defaulting to region 1.
Device r1z1-127.0.0.1:6011/test_"" with 100.0 weight got id 0
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
container.builder, build version 1
2 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6011      test 100.00          2   0.00 
mkdir: cannot create directory `/etc/swift/backup_rings': File exists
WARNING: No region specified for z1-127.0.0.1:6010/test_. Defaulting to region 1.
Device r1z1-127.0.0.1:6010/test_"" with 100.0 weight got id 0
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
object.builder, build version 1
2 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port      name weight partitions balance meta
             0     1     1       127.0.0.1  6010      test 100.00          2   0.00 


####################
4.These kind of messages are misleading and should not be there: -

"mkdir: cannot create directory `/etc/swift/backup_rings': File exists" 

5. This warning message is misleading as it suggest a region should be specified for gluster-swift volume

"WARNING: No region specified for z1-127.0.0.1:6012/test_. Defaulting to region 1."

6. IMHO the whole output given with the issue of the command is unnecessary and misleading, there should only be message suggesting the addition of the volume to the ring is successful or not.(like :- vol1, vol2 gluster volumes has been added to the ring successfully and ready to be used as RHS-object-store)
  
 
Actual results:

Expected results:

Additional info:
Comment 1 Scott Haines 2013-09-23 19:18:46 EDT
Retargeting for 2.1.z U2 (Corbett) release.
Comment 2 Luis Pabón 2013-10-21 22:40:23 EDT
Is this still an issue?
Comment 3 crisbud@redhat.com 2013-10-22 03:07:40 EDT
Hi Pushpesh,

 #1 : Man page for gluster-swift-gen-builder.
     --Need to discuss with Luis. 

 #2 Validation on the gluster volume names provided. 
    --What kind of validation is expected ? This gluster-swift-gen-builder is a wrapper script over Openstack Swift's ring builder. So is gluster-swift-gen-builder is restricted by swift's validations.

----
I think the gluster-swift-gen-builder's whole point is t provide names to ring to be prepared and has nothing to do with gluster-volume's characteristics. 
---

#3 Mount check for those gluster volumes is required. 
   It is not expected to have volume mounted prior starting the swift services. Swift services would mount the volumes provided via ring files. Hence I think we can skip this.

#4 Misleading messages like : "mkdir: cannot create directory `/etc/swift/backup_rings': File exists" 

 is fixed in master branch (HAVANA) and in the release branch 1.8. And hence should go to grizzly ? 

 http://review.gluster.org/#/c/5658/
 http://review.gluster.org/#/c/5667/

#5 Out come of the script is too verbose. 

 -- Yes this can be done. Output cane be directed to NULL device and gluster-swift-gen-builder would only point to the location of the ring files as expected else would throw errors on console.


Please update the bug accordingly.
Comment 4 pushpesh sharma 2013-10-22 03:33:12 EDT
1. Man page is urgent need, as this has been raised in one of the customer issue as well.

2. "mkdir: cannot create directory `/etc/swift/backup_rings': File exists"  part has already been fixed, and does not require further attention. 

3. In the description for point 2-3 , I still feel either the doc or the behaviour of builder should be changed. The better words for doc would be "The builder unconditionally creates the ring files, for the arguments   provided in the command,however it is expected that the same argument names should be used to mount the gluster volumes under the /mnt/gluster-object/ location (or the configured one)." 

4. "Yes this can be done. Output cane be directed to NULL device and gluster-swift-gen-builder would only point to the location of the ring files as expected else would throw errors on console."

+1 from me.
Comment 5 crisbud@redhat.com 2013-10-24 04:52:55 EDT
Code changes have been posted for review. 

http://review.gluster.org/#/c/6121/
Comment 6 crisbud@redhat.com 2013-11-19 00:56:39 EST
http://review.gluster.org/#/c/6121/ (bug fix)
http://review.gluster.org/#/c/6294/ (man page)

Additional change for Man page for the utility.
Comment 7 crisbud@redhat.com 2013-11-27 01:14:46 EST
http://review.gluster.org/#/c/6121/ (bug fix master)
http://review.gluster.org/#/c/6294/ (man page master)

http://review.gluster.org/#/c/6310/ (bug fix havana)
http://review.gluster.org/#/c/6352/ (man page havana) 

are merged. Marking this as Modified.
Comment 8 pushpesh sharma 2013-12-24 00:44:21 EST
Looks good to me, marking as verfied.

[root@mater ~]# rpm -qa|grep swift
gluster-swift-object-1.10.0-2.el6rhs.noarch
python-swiftclient-1.4.0-2.el6ost.noarch
gluster-swift-1.10.0-2.el6rhs.noarch
gluster-swift-proxy-1.10.0-2.el6rhs.noarch
gluster-swift-account-1.10.0-2.el6rhs.noarch
gluster-swift-plugin-1.10.0-3.el6rhs.noarch
gluster-swift-container-1.10.0-2.el6rhs.noarch


[root@mater ~]# gluster-swift-gen-builders -h

        NAME
            gluster-swift-gen-builders - Registers GlusterFS volumes to be accessed by
            object storage.
        SYNOPSIS
            gluster-swift-gen-builders [-v] [-h] volumes...
        DESCRIPTION
            Register GlusterFS volumes to be accessed over OpenStack Swift object
            storage.
        OPTIONS
            -v or --verbose
              Verbose
            -h or --help
              Prints help screen
        EXAMPLES
            gluster-swift-gen-builders myvol1 myvol2
            -Creates new ring files with myvol1 and myvol2

            gluster-swift-gen-builders myvol2
            -Creates new ring files by removing myvol1
            
[root@mater ~]# gluster-swift-gen-builders test test2
Ring files are prepared in /etc/swift. Please restart object store services
[root@mater ~]# gluster-swift-gen-builders -v test test2
WARNING: No region specified for z1-127.0.0.1:6012/test_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6012R127.0.0.1:6012/test_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6012/test2_. Defaulting to region 1.
Device d1r1z2-127.0.0.1:6012R127.0.0.1:6012/test2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
account.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       127.0.0.1  6012       127.0.0.1              6012      test 100.00          1    0.00 
             1       1     2       127.0.0.1  6012       127.0.0.1              6012     test2 100.00          1    0.00 
WARNING: No region specified for z1-127.0.0.1:6011/test_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6011R127.0.0.1:6011/test_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6011/test2_. Defaulting to region 1.
Device d1r1z2-127.0.0.1:6011R127.0.0.1:6011/test2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
container.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       127.0.0.1  6011       127.0.0.1              6011      test 100.00          1    0.00 
             1       1     2       127.0.0.1  6011       127.0.0.1              6011     test2 100.00          1    0.00 
WARNING: No region specified for z1-127.0.0.1:6010/test_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6010R127.0.0.1:6010/test_"" with 100.0 weight got id 0
WARNING: No region specified for z2-127.0.0.1:6010/test2_. Defaulting to region 1.
Device d1r1z2-127.0.0.1:6010R127.0.0.1:6010/test2_"" with 100.0 weight got id 1
Reassigned 2 (100.00%) partitions. Balance is now 0.00.
object.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 2 zones, 2 devices, 0.00 balance
The minimum number of hours before a partition can be reassigned is 1
Devices:    id  region  zone      ip address  port  replication ip  replication port      name weight partitions balance meta
             0       1     1       127.0.0.1  6010       127.0.0.1              6010      test 100.00          1    0.00 
             1       1     2       127.0.0.1  6010       127.0.0.1              6010     test2 100.00          1    0.00 
Ring files are prepared in /etc/swift. Please restart object store services
[root@mater ~]# 

gluster-swift-gen-builders(8)    Red Hat Inc.    gluster-swift-gen-builders(8)

NAME
       gluster-swift-gen-builders - Registers GlusterFS volumes to be accessed by OpenStack Swift.

SYNOPSIS
       gluster-swift-gen-builders [-v] [-h] volumes...

DESCRIPTION
       Register GlusterFS volumes to be accessed over OpenStack Swift.

OPTIONS
       -v or --verbose

               Verbose

       -h or --help

               Prints help screen

EXAMPLES
       gluster-swift-gen-builders vol1 vol2

               Creates new ring files with vol1 and vol2

       gluster-swift-gen-builders vol2

               Creates new ring files by removing vol1

       gluster-swift-gen-builders -v vol1

               Create new ring files with vol1, (Verbose).

:
       gluster-swift-gen-builders -h

               Displays help screen

COPYRIGHT
       Copyright(c) 2013 RedHat, Inc. <http://www.redhat.com>

18 November 2013         gluster-swift helper utigluster-swift-gen-builders(8)
(END)
Comment 9 crisbud@redhat.com 2013-12-31 05:34:51 EST
Doc text : 

Cause: The enhancement bug for gluster-swift-gen-builders utility.

Consequence: 

Fix: The gluster-swift-gen-builder utility has a man page and more options to work with verbose and non verbose mode. 

Result:
Comment 10 Pavithra 2014-01-02 03:56:50 EST
Pushpesh,

The doc text reads like an enhancement and not a bug fix. I had a discussion with Chetan Risbud and he confirmed that this is an enhancement. Can you please confirm? If it is an enhancement, can you please change the "Doc Type" field to "Enhancement"?
Comment 11 pushpesh sharma 2014-01-02 04:28:52 EST
I changed the doc type to enhancement.
Comment 12 Pavithra 2014-01-02 05:09:50 EST
The doc type change was not getting reflected. So I tried to change it again.

Chetan,

Is this doc text technically correct? I edited it a bit.
Comment 13 crisbud@redhat.com 2014-01-06 02:38:56 EST
Good to Go.
Comment 15 errata-xmlrpc 2014-02-25 02:35:48 EST
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.

http://rhn.redhat.com/errata/RHEA-2014-0208.html

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