Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1451998 - [RHEL-6] gluster-swift cannot use volume names having underscore
[RHEL-6] gluster-swift cannot use volume names having underscore
Status: CLOSED ERRATA
Product: Red Hat Gluster Storage
Classification: Red Hat
Component: gluster-swift (Show other bugs)
3.1
Unspecified Linux
medium Severity medium
: ---
: RHGS 3.3.0
Assigned To: Venkata R Edara
surabhi
:
Depends On: 1447684
Blocks: 1417151
  Show dependency treegraph
 
Reported: 2017-05-18 02:41 EDT by Sahina Bose
Modified: 2017-09-21 00:49 EDT (History)
11 users (show)

See Also:
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.
Story Points: ---
Clone Of: 1447684
Environment:
Last Closed: 2017-09-21 00:49:42 EDT
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2783 normal SHIPPED_LIVE gluster-swift bug fix and enhancement update 2017-09-21 04:23:02 EDT

  None (edit)
Description Sahina Bose 2017-05-18 02:41:43 EDT
+++ 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 06:34:29 EDT
Fixed in swiftonfile-1.13.1-11.el6rhs .
Comment 5 Venkata R Edara 2017-08-29 02:59:48 EDT
Doctext looks good.
Comment 6 Pratik Mulay 2017-09-07 10:05:55 EDT
Minor changes in Doc Text based on Peer Review.
Comment 8 errata-xmlrpc 2017-09-21 00:49:42 EDT
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.