Bug 764915 - (GLUSTER-3183) When creating volumes brick paths are not handled properly.
When creating volumes brick paths are not handled properly.
Status: CLOSED CURRENTRELEASE
Product: GlusterFS
Classification: Community
Component: cli (Show other bugs)
mainline
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Sachidananda Urs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-16 12:48 EDT by Sachidananda Urs
Modified: 2015-12-01 11:45 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions: master
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sachidananda Urs 2011-07-16 12:48:48 EDT
When creating volumes brick paths are not handled properly.

1. If the volume creation contain same path: /tmp///foo and /tmp/foo, volume gets created with bricks /tmp///foo and /tmp/foo and eventually when the file system is mounted duplicate files are seen.

2. If the path is /tmp/foo and /tmp/bar is a symbolic link to /tmp/foo, volume creation with /tmp/foo and /tmp/bar succeeds. Eventually unexpected results are seen on mount point with duplicate files and directory deletion failing.

root@odin:/tmp/data# gluster volume create foo odin:/tmp///data/foo odin:/tmp/data/foo
Creation of volume foo has been successful. Please start the volume to access data.
root@odin:/tmp/data# gluster volume info

Volume Name: drep
Type: Distribute
Status: Stopped
Number of Bricks: 4
Transport-type: tcp
Bricks:
Brick1: odin:/media/disk-1
Brick2: odin:/media/disk-2
Brick3: odin:/media/disk-3
Brick4: odin:/media/disk-4

Volume Name: foo
Type: Distribute
Status: Created
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: odin:/tmp///data/foo
Brick2: odin:/tmp/data/foo
root@odin:/tmp/data# 

===========

Symbolic links have to be checked at volume creation time. Directory path with duplicate `/' has to be handled to validate above case.
Comment 1 Sachidananda Urs 2011-07-17 06:36:26 EDT
Same as the case with replace-brick, remove-brick, log-filename, log-locate, top.

Replace brick:

root@odin:~# gluster volume info bar
 
Volume Name: bar
Type: Distribute
Status: Created
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: odin:/tmp/exports/bar-a
Brick2: odin:/tmp/exports/bar-b
root@odin:~# gluster volume start bar
Starting volume bar has been successful
root@odin:~# gluster volume replace-brick bar odin://tmp//exports//bar-b odin:/tmp//exports//bar-rep start
brick: odin://tmp//exports//bar-b does not exist in volume: bar
root@odin:~# 

root@odin:~# gluster volume replace-brick bar odin:/tmp/exports/bar-b odin:/tmp//exports//bar-rep start
replace-brick started successfully
root@odin:~# gluster volume replace-brick bar odin:/tmp/exports/bar-b odin:/tmp//exports//bar-rep commit
replace-brick commit successful
root@odin:~# gluster volume info bar
 
Volume Name: bar
Type: Distribute
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: odin:/tmp/exports/bar-a
Brick2: odin:/tmp//exports//bar-rep
root@odin:~#
Comment 2 Anand Avati 2011-07-17 07:46:03 EDT
PATCH: http://patches.gluster.com/patch/7958 in master (Canonicalize path names while creating volumes.)
Comment 3 Amar Tumballi 2011-07-17 23:04:04 EDT
Sac sent a patch to fix it. Need to add test cases for testing it.
Comment 4 Anand Avati 2011-07-17 23:19:10 EDT
PATCH: http://patches.gluster.com/patch/7959 in master (Strip extra `/' from filenames.)
Comment 5 Anand Avati 2011-07-31 23:39:23 EDT
CHANGE: http://review.gluster.com/124 (Use cli_canonicalize_path instead, to remove trailing/duplicate slashes.) merged in master by Anand Avati (avati@gluster.com)
Comment 6 Raghavendra Bhat 2011-08-25 01:37:15 EDT
Checked with glusterfs-3.3 qa releases. Its detecting duplicate entries.

 gluster volume create new hyperspace:/tmp/1 hyperspace:/tmp//////1
Found duplicate exports hyperspace:/tmp/1
Usage: volume create <NEW-VOLNAME> [stripe <COUNT>] [replica <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK> ...
root@hyperspace:/home/raghu# ls /tmp/
d49b05d8102906fba502e89e84ae32ad.socket  logs.tgz   orbit-raghu  pulse-2L9K88eMlGn7  pulse-vVuBdxd2plCp  virtual-raghu.NAU091
keyring-HYkTZv                           orbit-gdm  plugtmp      pulse-PKdhtXMmr18n  ssh-bJCGoGHW2119
root@hyperspace:/home/raghu# mkdir /tmp/1
root@hyperspace:/home/raghu# mkdir /tmp////1
mkdir: cannot create directory `/tmp////1': File exists
root@hyperspace:/home/raghu# cd /tmp/
root@hyperspace:/tmp# ls
1                                        keyring-HYkTZv  orbit-gdm    plugtmp             pulse-PKdhtXMmr18n  ssh-bJCGoGHW2119
d49b05d8102906fba502e89e84ae32ad.socket  logs.tgz        orbit-raghu  pulse-2L9K88eMlGn7  pulse-vVuBdxd2plCp  virtual-raghu.NAU091
root@hyperspace:/tmp# ln -s 2 1
root@hyperspace:/tmp# 
root@hyperspace:/tmp# ls
1                                        keyring-HYkTZv  orbit-gdm    plugtmp             pulse-PKdhtXMmr18n  ssh-bJCGoGHW2119
d49b05d8102906fba502e89e84ae32ad.socket  logs.tgz        orbit-raghu  pulse-2L9K88eMlGn7  pulse-vVuBdxd2plCp  virtual-raghu.NAU091
root@hyperspace:/tmp# ln -s 1 2
root@hyperspace:/tmp# 
root@hyperspace:/tmp# ls
1  d49b05d8102906fba502e89e84ae32ad.socket  logs.tgz   orbit-raghu  pulse-2L9K88eMlGn7  pulse-vVuBdxd2plCp  virtual-raghu.NAU091
2  keyring-HYkTZv                           orbit-gdm  plugtmp      pulse-PKdhtXMmr18n  ssh-bJCGoGHW2119
root@hyperspace:/tmp# stat 2
  File: `2' -> `1'
  Size: 1         	Blocks: 0          IO Block: 4096   symbolic link
Device: 803h/2051d	Inode: 678840      Links: 1
Access: (0777/lrwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2011-08-25 14:05:31.000000000 +0530
Modify: 2011-08-25 14:05:31.000000000 +0530
Change: 2011-08-25 14:05:31.000000000 +0530
root@hyperspace:/tmp# cd
root@hyperspace:~# gluster volume create new hyperspace:/tmp/1 hyperspace:/tmp/2
Found duplicate exports hyperspace:/tmp/1
Usage: volume create <NEW-VOLNAME> [stripe <COUNT>] [replica <COUNT>] [transport <tcp|rdma|tcp,rdma>] <NEW-BRICK> ...
root@hyperspace:~#

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