Bug 1284823 - fops-during-migration.t fails if hot and cold tiers are dist-rep
Summary: fops-during-migration.t fails if hot and cold tiers are dist-rep
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: GlusterFS
Classification: Community
Component: replicate
Version: mainline
Hardware: All
OS: All
high
high
Target Milestone: ---
Assignee: Nithya Balachandran
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1285625 1285783 1293827
TreeView+ depends on / blocked
 
Reported: 2015-11-24 09:55 UTC by Nithya Balachandran
Modified: 2016-06-16 13:46 UTC (History)
3 users (show)

Fixed In Version: glusterfs-3.8rc2
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1285625 1285783 1293827 (view as bug list)
Environment:
Last Closed: 2016-06-16 13:46:08 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Nithya Balachandran 2015-11-24 09:55:31 UTC
Description of problem:

tests/basic/tier/fop-during-migration.t was written using pure distribute hot and cold tiers
If the test is modified to have dist-rep cold and hot tiers, the following operation fails with EINVAL:

echo $TEST_STR > $M0/dir1/FILE1



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Modify tests/basic/tier/fop-during-migration.t to use dist-rep tiers
2. run tests/basic/tier/fop-during-migration.t
3.

Actual results:

Fails with EINVAL

Expected results:

The test should pass.

Additional info:

Comment 1 Nithya Balachandran 2015-11-24 09:58:28 UTC
Analysis:

echo $TEST_STR > $M0/dir1/FILE1

performs an ftruncate operation.

Investigation reveals that when a file is being migrated by the tier layer, the redirection of the ftruncate FOP to the dst subvol fails as posix_ftruncate fails in sys_ftruncate with op_errno EINVAL. This is because the fd being used has flags=0.

AFR calls afr_fix_open() to open the fd on the dst subvol but ends up using flags = 0 (instead of using the required flags). This causes the ftruncate to fail with EINVAL.

Comment 2 Vijay Bellur 2015-11-25 15:50:27 UTC
REVIEW: http://review.gluster.org/12750 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#1) for review on master by N Balachandran (nbalacha)

Comment 3 Vijay Bellur 2015-11-30 04:41:03 UTC
REVIEW: http://review.gluster.org/12750 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#2) for review on master by N Balachandran (nbalacha)

Comment 4 Vijay Bellur 2015-12-16 15:59:57 UTC
REVIEW: http://review.gluster.org/12985 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#1) for review on master by N Balachandran (nbalacha)

Comment 5 Vijay Bellur 2015-12-17 09:34:34 UTC
REVIEW: http://review.gluster.org/12985 (WIP cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#2) for review on master by N Balachandran (nbalacha)

Comment 6 Vijay Bellur 2015-12-17 10:01:03 UTC
REVIEW: http://review.gluster.org/12985 (WIP cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#3) for review on master by N Balachandran (nbalacha)

Comment 7 Vijay Bellur 2015-12-17 18:12:37 UTC
REVIEW: http://review.gluster.org/12985 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#4) for review on master by N Balachandran (nbalacha)

Comment 8 Vijay Bellur 2015-12-22 10:59:47 UTC
REVIEW: http://review.gluster.org/12985 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#5) for review on master by N Balachandran (nbalacha)

Comment 9 Vijay Bellur 2015-12-22 19:13:05 UTC
COMMIT: http://review.gluster.org/12985 committed in master by Dan Lambright (dlambrig) 
------
commit 430ad405294993ebb16387232281cc5a4f854c75
Author: N Balachandran <nbalacha>
Date:   Wed Dec 16 21:09:22 2015 +0530

    cluster/dht : Ftruncate on migrating file fails with EINVAL
    
    What:
    If dht_open is called on a migrating file after the inode_ctx is set,
    subsequent FOPs on that fd do not open the fd on the dst subvol.
    This is seen when the open-ftruncate-close sequence is repeatedly
    called on a migrating file.
    A second call to the sequence described above causes dht_truncate_cbk
    to call dht_truncate2 as the dht_inode_ctx was already set by the first
    call. As dht_rebalance_in_progress_check is not called, the fd is not
    opened on the dst subvol.
    On a distributed-replicate volume, this causes AFR to
    open the fd using afr_fix_open, but with the wrong flags, causing
    posix_ftruncate to fail with EINVAL.
    The fix: We require fd specific information to make a decision while
    handling migrating files.
    Set the fd_ctx to indicate the fd has been opened on the dst subvol
    and check if it has been set while processing Phase1/Phase2 checks
    in the FOP callback functions.
    
    Change-Id: I43cdcd8017b4a11e18afdd210469de7cd9a5ef14
    BUG: 1284823
    Signed-off-by: N Balachandran <nbalacha>
    Reviewed-on: http://review.gluster.org/12985
    Reviewed-by: Raghavendra G <rgowdapp>
    Tested-by: Gluster Build System <jenkins.com>
    Reviewed-by: Dan Lambright <dlambrig>
    Tested-by: Dan Lambright <dlambrig>

Comment 10 Vijay Bellur 2015-12-23 08:16:18 UTC
REVIEW: http://review.gluster.org/13070 (cluster/dht : Ftruncate on migrating file fails with EINVAL) posted (#1) for review on release-3.7 by N Balachandran (nbalacha)

Comment 11 Niels de Vos 2016-06-16 13:46:08 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.8.0, please open a new bug report.

glusterfs-3.8.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://blog.gluster.org/2016/06/glusterfs-3-8-released/
[2] http://thread.gmane.org/gmane.comp.file-systems.gluster.user


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