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.
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:~#
PATCH: http://patches.gluster.com/patch/7958 in master (Canonicalize path names while creating volumes.)
Sac sent a patch to fix it. Need to add test cases for testing it.
PATCH: http://patches.gluster.com/patch/7959 in master (Strip extra `/' from filenames.)
CHANGE: http://review.gluster.com/124 (Use cli_canonicalize_path instead, to remove trailing/duplicate slashes.) merged in master by Anand Avati (avati)
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:~#