Project

General

Profile

Bug #18661

Test failure: test_open_inode

Added by Zheng Yan 3 months ago. Updated 2 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
01/25/2017
Due date:
% Done:

0%

Source:
Tags:
Backport:
kraken,jewel
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Release:
Component(FS):
Needs Doc:
No


Related issues

Copied to Backport #18899: kraken: Test failure: test_open_inode Resolved
Copied to Backport #18900: jewel: Test failure: test_open_inode In Progress

History

#1 Updated by Zheng Yan 3 months ago

2017-01-17 09:28:32.263766 7f0a7f5d4700 10 client.4432 send_request client_request(unknown.0:9 create #1/open_file 2017-01-17 09:28:32.263717) v3 to mds.0
...
2017-01-17 09:28:34.417892 7f0a7fdd5700 10 client.4432 send_request client_request(unknown.0:11 unlink #1/open_file 2017-01-17 09:28:34.417762) v3 to mds.0
...
2017-01-17 09:28:34.462320 7f0a7fdd5700 10 client.4432 send_request client_request(unknown.0:13 create #1/open_file 2017-01-17 09:28:34.462246) v3 to mds.0
    def test_open_inode(self):
        """ 
        That the case of a dentry unlinked while a client holds an
        inode open is handled correctly.

        The inode should be moved into a stray dentry, while the original
        dentry and directory should be purged.

        The inode's data should be purged when the client eventually closes
        it.
        """ 
        mount_a_client_id = self.mount_a.get_global_id()

        # Write some bytes to a file
        size_mb = 8
        self.mount_a.write_n_mb("open_file", size_mb)
        open_file_ino = self.mount_a.path_to_ino("open_file")

        # Hold the file open
        p = self.mount_a.open_background("open_file")

        self.assertEqual(self.get_session(mount_a_client_id)['num_caps'], 2)

        # Unlink the dentry
        self.mount_a.run_shell(["rm", "-f", "open_file"])

seems like the background open was executed after unlink

#2 Updated by Zheng Yan 3 months ago

  • Status changed from New to Verified

#3 Updated by John Spray 3 months ago

You're right, that piece of test code is racy :-/ Need to get the remote python code running inside open_background to signal somehow when it opens the file, and have the test code block until then.

#4 Updated by John Spray 3 months ago

  • Status changed from Verified to Need Review

#5 Updated by Nathan Cutler 3 months ago

  • Backport set to kraken,jewel

#6 Updated by John Spray 2 months ago

  • Status changed from Need Review to Pending Backport

#7 Updated by Loic Dachary 2 months ago

#8 Updated by Loic Dachary 2 months ago

Also available in: Atom PDF