geo-rep: Handle RMDIR recursively
If RMDIR is recorded in brick changelog which is due to self heal traffic then it will not have UNLINK entries for child files. Geo-rep hangs with ENOTEMPTY error on slave. Now geo-rep recursively deletes the dir if it gets ENOTEMPTY. BUG: 1129702 Change-Id: Iacfe6a05d4b3a72b68c3be7fd19f10af0b38bcd1 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/8477 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Venky Shankar <vshankar@redhat.com> Tested-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
parent
718f10e0d6
commit
2510af1674
@ -26,6 +26,7 @@ import subprocess
|
||||
from errno import EEXIST, ENOENT, ENODATA, ENOTDIR, ELOOP
|
||||
from errno import EISDIR, ENOTEMPTY, ESTALE, EINVAL
|
||||
from select import error as SelectError
|
||||
import shutil
|
||||
|
||||
from gconf import gconf
|
||||
import repce
|
||||
@ -616,6 +617,17 @@ class Server(object):
|
||||
while True:
|
||||
er = entry_purge(entry, gfid)
|
||||
if isinstance(er, int):
|
||||
if er == ENOTEMPTY and op == 'RMDIR':
|
||||
er1 = errno_wrap(shutil.rmtree,
|
||||
[os.path.join(pg, bname)],
|
||||
[ENOENT])
|
||||
if not isinstance(er1, int):
|
||||
logging.info("Removed %s/%s recursively" %
|
||||
(pg, bname))
|
||||
break
|
||||
|
||||
logging.warn("Failed to remove %s => %s/%s. %s" %
|
||||
(gfid, pg, bname, os.strerror(er)))
|
||||
time.sleep(1)
|
||||
else:
|
||||
break
|
||||
|
Loading…
x
Reference in New Issue
Block a user