gluster-swift cannot use volume names having underscore

Bug #1274834 reported by Prashanth Pai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
swiftonfile
New
Medium
Unassigned

Bug Description

My Setup:
* Latest "master" branch of gluster-swift source with appropriate Swift
* No authentication filter in pipeline
* Two glusterfs volumes - test and a_b

Steps to reproduce:

[root@pp swift]# gluster volume create a_b pp:/export/eo/eo
volume create: a_b: success: please start the volume to access data

[root@pp swift]# gluster volume start a_b
volume start: a_b: success

[root@pp swift]# gluster-swift-gen-builders test a_b
Ring files are prepared in /etc/swift. Please restart object store services

[root@pp swift]# swift-init main start
Starting proxy-server...(/etc/swift/proxy-server.conf)
Starting container-server...(/etc/swift/container-server.conf)
Starting account-server...(/etc/swift/account-server.conf)
Starting object-server...(/etc/swift/object-server.conf)

[root@pp swift]# curl -v -X PUT http://127.0.0.1:8080/v1/test/c1
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> PUT /v1/test/c1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8080
> Accept: */*
>
< HTTP/1.1 201 Created
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx248546510ca94e15a94b6-0052eb5832
< Date: Fri, 31 Jan 2014 08:00:50 GMT
<
* Connection #0 to host 127.0.0.1 left intact

[root@pp swift]# curl -v -X PUT http://127.0.0.1:8080/v1/a_b/c1
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> PUT /v1/a_b/c1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8080
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Length: 70
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx734ec22862684f0aa64f1-0052eb5839
< Date: Fri, 31 Jan 2014 08:00:57 GMT
<
* Connection #0 to host 127.0.0.1 left intact
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>

[root@pp swift]# curl -v -X PUT http://127.0.0.1:8080/v1/AUTH_a_b/c1
* About to connect() to 127.0.0.1 port 8080 (#0)
* Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> PUT /v1/AUTH_a_b/c1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: 127.0.0.1:8080
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Length: 70
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx5030c113255d4268a83e5-0052eb5844
< Date: Fri, 31 Jan 2014 08:01:08 GMT
<
* Connection #0 to host 127.0.0.1 left intact
<html><h1>Not Found</h1><p>The resource could not be found.</p></html>
[root@pp swift]#

Logs:
Jan 31 13:30:50 pp container-server: 127.0.0.1 - - [31/Jan/2014:08:00:50 +0000] "PUT /test/0/test/c1" 201 - "tx248546510ca94e15a94b6-0052eb5832" "PUT http://127.0.0.1:8080/v1/test/c1" "proxy-server 19569" 0.0088
Jan 31 13:30:50 pp proxy-server: 127.0.0.1 127.0.0.1 31/Jan/2014/08/00/50 PUT /v1/test/c1 HTTP/1.0 201 - curl/7.29.0 - - - - tx248546510ca94e15a94b6-0052eb5832 - 0.0133 - - 1391155250.544230938 1391155250.557531118
Jan 31 13:30:57 pp account-server: STDOUT: ERROR:root:No export found in ['gsmetadata', 'test', 'test2', 'a_b'] matching drive, volume_not_in_ring (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp account-server: 127.0.0.1 - - [31/Jan/2014:08:00:57 +0000] "HEAD /volume_not_in_ring/1/a_b" 507 - "tx734ec22862684f0aa64f1-0052eb5839" "HEAD http://127.0.0.1:8080/v1/a_b" "proxy-server 19569" 0.0344 ""
Jan 31 13:30:57 pp proxy-server: ERROR Insufficient Storage 127.0.0.1:6012/volume_not_in_ring (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp proxy-server: Account HEAD returning 503 for [507] (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp proxy-server: Container GET returning 503 for (503,) (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp proxy-server: Could not autocreate account '/a_b' (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp proxy-server: Account HEAD returning 503 for [] (txn: tx734ec22862684f0aa64f1-0052eb5839)
Jan 31 13:30:57 pp proxy-server: 127.0.0.1 127.0.0.1 31/Jan/2014/08/00/57 PUT /v1/a_b/c1 HTTP/1.0 404 - curl/7.29.0 - - 70 - tx734ec22862684f0aa64f1-0052eb5839 - 0.0420 - - 1391155257.391767025 1391155257.433722019
Jan 31 13:31:08 pp proxy-server: Account HEAD returning 503 for [] (txn: tx5030c113255d4268a83e5-0052eb5844)
Jan 31 13:31:08 pp proxy-server: Container GET returning 503 for (503,) (txn: tx5030c113255d4268a83e5-0052eb5844)
Jan 31 13:31:08 pp proxy-server: Could not autocreate account '/AUTH_a_b' (txn: tx5030c113255d4268a83e5-0052eb5844)
Jan 31 13:31:08 pp proxy-server: Account HEAD returning 503 for [] (txn: tx5030c113255d4268a83e5-0052eb5844)
Jan 31 13:31:08 pp proxy-server: 127.0.0.1 127.0.0.1 31/Jan/2014/08/01/08 PUT /v1/AUTH_a_b/c1 HTTP/1.0 404 - curl/7.29.0 - - 70 - tx5030c113255d4268a83e5-0052eb5844 - 0.0042 - - 1391155268.221762896 1391155268.225977898

Prashanth Pai (ppai)
description: updated
Revision history for this message
Chetan Risbud (chetan-risbud) wrote :

Couple of things noticed the way glluster-swift-gen-builder works with gluster volume names :

Normal account name : "test"

[root@cbox gluster]# gluster-swift-gen-builders -v test
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
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 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 2 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
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 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 2 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
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 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 2 0.00
Ring files are prepared in /etc/swift. Please restart object store services

But in a case of gluster volume having underscores in it :

volume name : a_b

Revision history for this message
Chetan Risbud (chetan-risbud) wrote :

[root@cbox gluster]# gluster-swift-gen-builders -v a_b
WARNING: No region specified for z1-127.0.0.1:6012/a_b_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6012R127.0.0.1:6012/a_"b_" 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 replication ip replication port name weight partitions balance meta
             0 1 1 127.0.0.1 6012 127.0.0.1 6012 a 100.00 2 0.00 b_
WARNING: No region specified for z1-127.0.0.1:6011/a_b_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6011R127.0.0.1:6011/a_"b_" 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 replication ip replication port name weight partitions balance meta
             0 1 1 127.0.0.1 6011 127.0.0.1 6011 a 100.00 2 0.00 b_
WARNING: No region specified for z1-127.0.0.1:6010/a_b_. Defaulting to region 1.
Device d0r1z1-127.0.0.1:6010R127.0.0.1:6010/a_"b_" 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 replication ip replication port name weight partitions balance meta
             0 1 1 127.0.0.1 6010 127.0.0.1 6010 a 100.00 2 0.00 b_
Ring files are prepared in /etc/swift. Please restart object store services

Revision history for this message
Chetan Risbud (chetan-risbud) wrote :

Looking more to how swift-ring-builder deals with underscores and is there a special handling around it.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.