[Gluster-devel] AFR self-heal bug with rmdir (Directory not empty)

Corentin Chary corentin.chary at gmail.com
Wed Sep 30 09:13:44 UTC 2009


Hi,
I'm trying to use glusterfs with afr.
My setup have 2 servers and 2 clients. / is mounted with user_xattr.
It seems that if you shutdown a server, remove a directory with one or
more childs, then restart the server, the changes won't be replicated
because rmdir is not recursive in afr-self-heal-entry.c

The bug is affecting  2.0.2 and the current git (and probably all 2.x)
1.3.10 works as excepted.

Here is my test case:
$ bin/clients.sh  # launch 2 clients

$ tree mnt/ export/
mnt/
|-- 1
`-- 2
export/
|-- 1
`-- 2

$ mkdir + touch

$ tree mnt/1
mnt/1
|-- dir-empty
|-- dir-with-file
|   `-- file
`-- dir-with-subdir
   `-- subdir

$ kill server 2

$ rm mnt/1/dir* -rf

$ start server 2

$ tree mnt/
mnt/
|-- 1
`-- 2

$ tree export/
export/
|-- 1
|-- 2
   |-- dir-with-file
   |   `-- file
   `-- dir-with-subdir
       `-- subdir

Log:
[2009-09-28 15:30:09] D
[afr-self-heal-entry.c:1865:afr_sh_entry_sync_prepare] afr:
self-healing directory / from subvolume brick1 to 1 other
[2009-09-28 15:30:09] D
[afr-self-heal-entry.c:455:afr_sh_entry_expunge_remove_cbk] afr:
removing /dir-with-subdir on brick2 failed (Directory not empty)
[2009-09-28 15:30:09] D
[afr-self-heal-entry.c:455:afr_sh_entry_expunge_remove_cbk] afr:
removing /dir-with-file on brick2 failed (Directory not empty)
[2009-09-28 15:30:09] D
[afr-self-heal-entry.c:449:afr_sh_entry_expunge_remove_cbk] afr:
removed /dir-empty on brick2


# server-x.vol
volume brick
 type storage/posix
 option directory /home/iksaif/tmp/glusterfs/export/1
end-volume

volume brick-lock
 type features/posix-locks
 option mandatory-locks on
 subvolumes brick
end-volume

volume server
 type protocol/server
 option transport-type tcp
 option transport.socket.bind-address 127.0.0.1
 option transport.socket.listen-port 7001
 subvolumes brick-lock
 option auth.addr.brick-lock.allow *
end-volume

# client.vol
volume brick1
 type protocol/client
 option transport-type tcp
 option remote-host 127.0.0.1
 option remote-port 7001
 option remote-subvolume brick-lock
end-volume

volume brick2
 type protocol/client
 option transport-type tcp
 option remote-host 127.0.0.1
 option remote-port 7002
 option remote-subvolume brick-lock
end-volume

volume afr
 type cluster/afr
 subvolumes brick1 brick2
end-volume

Thanks;

-- 
Corentin Chary
http://xf.iksaif.net





More information about the Gluster-devel mailing list