Bug 1395133

Summary: Rename is failing with ENOENT while remove-brick start operation is in progress
Product: Red Hat Gluster Storage Reporter: Prasad Desala <tdesala>
Component: distributeAssignee: Nithya Balachandran <nbalacha>
Status: CLOSED WONTFIX QA Contact: Prasad Desala <tdesala>
Severity: medium Docs Contact:
Priority: high    
Version: rhgs-3.2CC: amukherj, moagrawa, nbalacha, rhinduja, rhs-bugs, spalai, storage-qa-internal
Target Milestone: ---Keywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: dht-rename-file
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1398554 (view as bug list) Environment:
Last Closed: 2019-09-30 05:09:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1286127, 1395217    
Bug Blocks: 1398554    

Description Prasad Desala 2016-11-15 09:08:14 UTC
Description of problem:
=======================
Rename is failing with ENOENT while remove-brick start operation is in progress.

Version-Release number of selected component (if applicable):
3.8.4-5.el7rhgs.x86_64

How reproducible:
=================
Always

Steps to Reproduce:
===================
1) Create an EC volume and start it (Distributed replicate volume can also be used here, the issue is seen with Distributed replicate volume as well).
2) FUSE mount the volume on a client.
3) Create a big file of size 10Gb on the FUSE mount.
dd if=/dev/urandom of=BIG bs=1024k count=10000
4) Identify the bricks on which the file 'BIG' is located and remove those bricks so that the BIG file gets migrated.
5) While remove-brick start operation is in progress, rename the file from the mount point. 

We can see the below error,
mv: cannot move ‘BIG’ to ‘BIG_rename’: No such file or directory

Actual results:
===============
Renaming is fialing with ENOENT.

Expected results:
=================
Rename should be successful.

Comment 3 Nithya Balachandran 2016-11-15 10:06:44 UTC
Looks like the same issue as reported by BZ 1286127. Marking it depends on 1286127 for now.

Comment 4 Mohit Agrawal 2016-11-25 08:55:58 UTC
RCA of rename failing with ENOENT is same as mentioned in BZ 1286127.
rename is failing with ENOENT because file is not available on cached_subvol that has changed during migration process.
To resolve it pass a new rename fops(dht_rename2) (in case of failure) to dht_rebalance_complete_check ,it will call dht_rename2 after complete migration process.