Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #69: Copy-up fix #70

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

pralaydak
Copy link

@pralaydak pralaydak commented Jun 19, 2017

Fixed copy-up code by introducing a metafile (with suffix "_COPYUP~") to indicate copy-up is in progress, so that other processes/threads call read() or stat() on lower branch.

In addition, copy-up race condition is fixed when two processes/threads try to copy-up same file. A file lock (locking the metedata file) is introduced for serializing competing processes.

Added a new test file test_copyup.py separately to test copy-up. This is not added in default test file test_all.py, because it is non-deterministic without instrumenting main code (e.g. adding some delay in copy_file function).

Given copy-up is triggered by a write() operation, any
file access in the file (either get_attr or read) should happen
from lower branch.
- when two competing processes trigger copy-up at the same time
  (because of write-op), they step on each other.
  This fix solves this problem by locking the metadata file.
- do not create path while just checking the copyup meta data file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant