Red Hat Bugzilla – Bug 1259995
fd migration to new xlator graph after graph-switch fails for unlinked files.
Last modified: 2015-09-04 04:51:40 EDT
Created attachment 1070159 [details]
regression test to trigger fd-migration failure
Description of problem:
Consider following sequence of operations:
1. fd = open ("/mnt/glusterfs/file");
2. unlink ("/mnt/glusterfs/file");
3. Do a graph-switch, lets say by adding a new brick to volume.
4. migration of fd to new graph fails. This is because as part of migration we do a lookup and open. But, lookup fails as file is already deleted and hence migration fails and fd is marked bad.
In fact this test case is already present in our regression tests, though the test checks whether the fd is just marked as bad. But the expectation of filing this bug is that migration should succeed. This is possible since there is an fd opened on brick through old-graph and hence can be duped using dup syscall.
Of course the solution outlined here doesn't cover the case where file is not present on brick at all. For eg., a new brick was added to replica set and that new brick doesn't contain the file. Now, since the file is deleted, how do replica heals that file to another brick etc.
But atleast this can be solved for those cases where file was present on a brick and fd was already opened.
I've attached regression test which can trigger this failure.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
*** This bug has been marked as a duplicate of bug 990089 ***