Bug 1465123
Summary: | Fd based fops fail with EBADF on file migration | ||
---|---|---|---|
Product: | [Community] GlusterFS | Reporter: | Shyamsundar <srangana> |
Component: | distribute | Assignee: | Nithya Balachandran <nbalacha> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 3.12 | CC: | alexander, atumball, bugs, kdhananj, nbalacha, stefano.stagnaro |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | glusterfs-4.1.4 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | 1465075 | Environment: | |
Last Closed: | 2018-10-08 10:41:59 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: | |
Embargoed: | |||
Bug Depends On: | 1465075 | ||
Bug Blocks: |
Description
Shyamsundar
2017-06-26 17:22:30 UTC
REVIEW: https://review.gluster.org/17631 (Revert "Revert "glusterd: disallow rebalance & remove-brick on a sharded volume"") posted (#2) for review on release-3.11 by Shyamsundar Ranganathan (srangana) COMMIT: https://review.gluster.org/17631 committed in release-3.11 by Shyamsundar Ranganathan (srangana) ------ commit c5ca4e8981bcf6a854eb3f708aa96fe6ff1f8e05 Author: Shyamsundar Ranganathan <srangana> Date: Mon Jun 26 16:23:45 2017 +0000 Revert "Revert "glusterd: disallow rebalance & remove-brick on a sharded volume"" This is being reverted as a new bug around rebalance has been uncovered. As a result we would like to retain the warning in the code and in the release-notes. The new bug being, https://bugzilla.redhat.com/show_bug.cgi?id=1465075 This reverts commit 9c5403587517b5922cb87bff75033839e96d56ab. Change-Id: Ifd38ae0a41539aeb67723eb3ee704c18c50571b0 BUG: 1465123 Signed-off-by: Shyam <srangana> Reviewed-on: https://review.gluster.org/17631 Smoke: Gluster Build System <jenkins.org> CentOS-regression: Gluster Build System <jenkins.org> Reviewed-by: Atin Mukherjee <amukherj> REVIEW: https://review.gluster.org/17643 (cluster/dht: Check if fd is opened on dst subvol) posted (#1) for review on release-3.11 by N Balachandran (nbalacha) Once this bug is fixed, please use the same bug to revert the change introduced in https://review.gluster.org/17631 COMMIT: https://review.gluster.org/17643 committed in release-3.11 by Shyamsundar Ranganathan (srangana) ------ commit 26a81d878c6669cfecb81892a4460bd904512196 Author: N Balachandran <nbalacha> Date: Mon Jun 26 21:12:56 2017 +0530 cluster/dht: Check if fd is opened on dst subvol If an fd is opened on a file, the file is migrated and the cached subvol is updated in the inode_ctx before an fd based fop is sent, the fop is sent to the dst subvol on which the fd is not opened. This causes the FOP to fail with EBADF. Now, every fd based fop will check to see that the fd has been opened on the dst subvol before winding it down. > BUG: 1465075 > Signed-off-by: N Balachandran <nbalacha> > Reviewed-on: https://review.gluster.org/17630 > Smoke: Gluster Build System <jenkins.org> > Reviewed-by: Raghavendra G <rgowdapp> > Reviewed-by: Susant Palai <spalai> > CentOS-regression: Gluster Build System <jenkins.org> (cherry picked from commit 91db0d47ca267aecfc6124a3f337a4e2f2c9f1e2) Change-Id: Id92ef5eb7a5b5226688e2d2868b15e383f5f240e BUG: 1465123 Signed-off-by: N Balachandran <nbalacha> Reviewed-on: https://review.gluster.org/17643 Smoke: Gluster Build System <jenkins.org> Reviewed-by: Raghavendra G <rgowdapp> CentOS-regression: Gluster Build System <jenkins.org> REVIEW: https://review.gluster.org/17751 (cluster/dht: Fix fd check race) posted (#1) for review on release-3.11 by N Balachandran (nbalacha) COMMIT: https://review.gluster.org/17751 committed in release-3.11 by Shyamsundar Ranganathan (srangana) ------ commit 856aa0ff090fa08629493e7848e5c446a93a9f2d Author: N Balachandran <nbalacha> Date: Mon Jul 10 09:38:54 2017 +0530 cluster/dht: Fix fd check race There is a another race between the cached subvol being updated in the inode_ctx and the fd being opened on the target. 1. fop1 -> fd1 -> subvol0 2. file migrated from subvol0 to subvol1 and cached_subvol changed to subvol1 in inode_ctx 3. fop2 -> fd1 -> subvol1 [takes new cached subvol] 4. fop2 -> checks fd ctx (fd not open on subvol1) -> opens fd1 on subvol1 5. fop1 -> checks fd ctx (fd not open on subvol0) -> tries to open fd1 on subvol0 -> fails with "No such file on directory". Fix: If dht_fd_open_on_dst fails with ENOENT or ESTALE, wind to old subvol and let the phase1/phase2 checks handle it. > BUG: 1465075 > Signed-off-by: N Balachandran <nbalacha> > Reviewed-on: https://review.gluster.org/17731 > Smoke: Gluster Build System <jenkins.org> > CentOS-regression: Gluster Build System <jenkins.org> > Reviewed-by: Raghavendra G <rgowdapp> > Reviewed-by: Amar Tumballi <amarts> (cherry picked from commit f7a450c17fee7e43c544473366220887f0534ed7) Change-Id: I34f8011574a8b72e3bcfe03b0cc4f024b352f225 BUG: 1465123 Signed-off-by: N Balachandran <nbalacha> Reviewed-on: https://review.gluster.org/17751 Smoke: Gluster Build System <jenkins.org> Reviewed-by: Raghavendra G <rgowdapp> CentOS-regression: Gluster Build System <jenkins.org> @nithya for 3.12.1 I think we need to revert the glusterd changes to allow rebalance on sharded volumes without the warning. This fix (among others) have been available to users for some time (from 3.11 and 3.10 update releases as well), and we have not heard back on any new problems. As a result, moving the version on this bug to 3.12 (as 3.11 will be EOL'd when 3.12 releases) and we could target 3.12.1 to remove the warning as stated in comment #4 I'm concerned about the fxattrops not handling migrating files. That could cause issues with updating the size attribute. @Krutika, what do you think? We have not managed to hit this in our tests but we know it exists. It depends on which copy DHT on the client uses to serve metadata fops. 1. If it is guaranteed that the xattr value on the src and dst copy will eventually be in sync without any out-of-order updates causing them to deviate, then i'm guessing it should be OK. 2. If until migration completes, DHT on the client serves iatts as part of lookup, stat etc from the correct copy (the copy that has witnessed all the xattrops wound by shard as part of ongoing writes), then it is probably ok. (In reply to Krutika Dhananjay from comment #10) > It depends on which copy DHT on the client uses to serve metadata fops. > > 1. If it is guaranteed that the xattr value on the src and dst copy will > eventually be in sync without any out-of-order updates causing them to > deviate, then i'm guessing it should be OK. > > 2. If until migration completes, DHT on the client serves iatts as part of > lookup, stat etc from the correct copy (the copy that has witnessed all the > xattrops wound by shard as part of ongoing writes), then it is probably ok. What happens if an fxattrop is sent to a migrating file after all xattrs have been copied off the src file? That information would not be copied to the dst as dht_fxattrop does not perform migration checks. (In reply to Nithya Balachandran from comment #11) > (In reply to Krutika Dhananjay from comment #10) > > It depends on which copy DHT on the client uses to serve metadata fops. > > > > 1. If it is guaranteed that the xattr value on the src and dst copy will > > eventually be in sync without any out-of-order updates causing them to > > deviate, then i'm guessing it should be OK. > > > > > 2. If until migration completes, DHT on the client serves iatts as part of > > lookup, stat etc from the correct copy (the copy that has witnessed all the > > xattrops wound by shard as part of ongoing writes), then it is probably ok. > > > What happens if an fxattrop is sent to a migrating file after all xattrs > have been copied off the src file? That information would not be copied to > the dst as dht_fxattrop does not perform migration checks. Do you mean to say that the fxattrop will only be wound on the src file which will subsequently be unlinked without any further syncing to destination copy? If so, then it will be a problem. VM operations are very sensitive to incorrect image size. Lot of our vm-corruption/vm-not-booting problems in the past have been because somewhere the size read/cached of the image was wrong. -Krutika > Do you mean to say that the fxattrop will only be wound on the src file > which will subsequently be unlinked without any further syncing to > destination copy? Yes, that is correct. I had started on https://review.gluster.org/#/c/17776/ for this reason. If so, then it will be a problem. VM operations are very > sensitive to incorrect image size. Lot of our vm-corruption/vm-not-booting > problems in the past have been because somewhere the size read/cached of the > image was wrong. > > -Krutika The patch https://review.gluster.org/#/c/19382/ handles fxattrops for migrating files. This should fix all the corruption issues. Where can I find the warning displayed when attempting to rebalancing sharded volumes? (In reply to Nithya Balachandran from comment #14) > The patch https://review.gluster.org/#/c/19382/ handles fxattrops for > migrating files. This should fix all the corruption issues. > > > Where can I find the warning displayed when attempting to rebalancing > sharded volumes? So this was the original patch on master that introduced the warning - https://review.gluster.org/#/c/17160/ ... which I'd reverted @ https://review.gluster.org/#/c/17506/ based on initial feedback from some of the users after they tested some of the fixes. |