Bug 1451998 - [RHEL-6] gluster-swift cannot use volume names having underscore
Summary: [RHEL-6] gluster-swift cannot use volume names having underscore
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: gluster-swift
Version: rhgs-3.1
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: RHGS 3.3.0
Assignee: Venkata R Edara
QA Contact: surabhi
URL:
Whiteboard:
Depends On: 1447684
Blocks: 1417151
TreeView+ depends on / blocked
 
Reported: 2017-05-18 06:41 UTC by Sahina Bose
Modified: 2017-09-21 04:49 UTC (History)
11 users (show)

Fixed In Version: swiftonfile-1.13.1-11.el6rhs
Doc Type: Bug Fix
Doc Text:
Previously, volume names with underscore symbol [ _ ] could not be used, as swift-gen-builders syntax recognized underscore symbol as a delimiter for device and metadata. With this update, you can now use a verbose syntax with swift-gen-builders and volume names can now contain underscores.
Clone Of: 1447684
Environment:
Last Closed: 2017-09-21 04:49:42 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2783 0 normal SHIPPED_LIVE gluster-swift bug fix and enhancement update 2017-09-21 08:23:02 UTC

Description Sahina Bose 2017-05-18 06:41:43 UTC
+++ This bug was initially created as a clone of Bug #1447684 +++

Description of problem:

Gluster swift has issues handling volume names having underscores.

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


How reproducible:

Always.



Please see https://bugs.launchpad.net/swiftonfile/+bug/1274834

This bugzilla is a spin off of #1446375 which would need swift to handle volumes with underscores properly.


--- Additional comment from Venkata R Edara on 2017-05-05 04:43:57 EDT ---

RCA
====================
gluster-swift-gen-builders uses swift-ring-builder add, which seperates the devicename and meta with underscore according to following syntax.
swift-ring-builder <builder_file> add
    [r<region>]z<zone>-<ip>:<port>[R<r_ip>:<r_port>]/<device_name>_<meta>
     <weight>
    [[r<region>]z<zone>-<ip>:<port>[R<r_ip>:<r_port>]/<device_name>_<meta>
     <weight>] ...

so the swift is thinking the 1st underscore is delimiter and takes device name as "ram" in ram_1234 and treats postfix "1234_
" as meta info. The actual problem is not in gluster-swift , it is in swift syntax itself, which unpickles the device name which is prefix part of "_" .

we can exclusively specify device name using following syntax in gluster-swift-gen-builders. This fixes the problem.

swift-ring-builder <builder_file> add --region <region> --zone <zone> --ip <ip or hostname> --port <port>
    [--replication-ip <r_ip or r_hostname>] [--replication-port <r_port>]
    --device <device_name> --weight <weight>
    [--meta <meta>]

Before Fixing the problem: volume name is "ram_1234"
===============================================
root@localhost swift]# /usr/bin/gluster-swift-gen-builders -v ram_1234 
WARNING: No region specified for z1-127.0.0.1:6012/ram_1234_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6012R127.0.0.1:6012/ram_"1234_" with 100.0 weight got id 0
Reassigned 2 (100.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00
account.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1 (0:59:59 remaining)
The overload factor is 0.00% (0.000000)
Ring file account.ring.gz is up-to-date
Devices:   id region zone ip address:port replication ip:port  name weight partitions balance flags meta
            0      1    1  127.0.0.1:6012      127.0.0.1:6012   ram 100.00          2    0.00       1234_

After changing gluster-swift-gen-builders with following syntax in add function
swift-ring-builder $1 add --region 1 --zone $2 --ip 127.0.0.1 --port $3 --device $4 --meta "_" --weight 100.0

After Fixing gluster-swift-gen-builders:
==========================================
[root@localhost swift]# /usr/bin/gluster-swift-gen-builders -v ram_1234 

Device d0r1z1-127.0.0.1:6012R127.0.0.1:6012/ram_1234_"_" with 100.0 weight got id 0
Reassigned 2 (100.00%) partitions. Balance is now 0.00.  Dispersion is now 0.00
account.builder, build version 2
2 partitions, 1.000000 replicas, 1 regions, 1 zones, 1 devices, 0.00 balance, 0.00 dispersion
The minimum number of hours before a partition can be reassigned is 1 (0:59:59 remaining)
The overload factor is 0.00% (0.000000)
Ring file account.ring.gz is up-to-date
Devices:   id region zone ip address:port replication ip:port  name weight partitions balance flags meta
            0      1    1  127.0.0.1:6012      127.0.0.1:6012 ram_1234 100.00          2    0.00       _


Now the device_name is ram_1234, for which we can create buckets/objects.
using swift3

--- Additional comment from Venkata R Edara on 2017-05-05 04:45:10 EDT ---

After fixing the problem , creating bucket is successful.

root@localhost s3-curl]# ./s3curl.pl --id 'ram_1234' --key 'blah' --put /dev/null -- -k -v -s http://localhost:8080/bucket 

Will sleep and continue despite this problem.
Please set up /root/.s3curl for future requests.
*   Trying ::1...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> PUT /bucket HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.47.1
> Accept: */*
> Transfer-Encoding: chunked
> Date: Fri, 05 May 2017 08:27:54 +0000
> Authorization: AWS ram_1234:+VyXRN8SJ+hfNhJqn4be/lR0VpI=
> Expect: 100-continue
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 200 OK
< x-amz-id-2: txe9850a52e6024c07abae2-00590c378a
< Content-Length: 0
< x-amz-request-id: txe9850a52e6024c07abae2-00590c378a
< Content-Type: text/html; charset=UTF-8
< Location: /bucket
< X-Trans-Id: txe9850a52e6024c07abae2-00590c378a
< Date: Fri, 05 May 2017 08:27:54 GMT
<

--- Additional comment from Venkata R Edara on 2017-05-10 08:19:37 EDT ---

Code Review link : https://review.gluster.org/#/c/17236/

Comment 2 Venkata R Edara 2017-06-01 10:34:29 UTC
Fixed in swiftonfile-1.13.1-11.el6rhs .

Comment 5 Venkata R Edara 2017-08-29 06:59:48 UTC
Doctext looks good.

Comment 6 Pratik Mulay 2017-09-07 14:05:55 UTC
Minor changes in Doc Text based on Peer Review.

Comment 8 errata-xmlrpc 2017-09-21 04:49:42 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://access.redhat.com/errata/RHBA-2017:2783


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