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

[Bug] Dokan: Files are not sync when using git annex. #414

Closed
fbewivpjsbsby opened this issue Apr 4, 2024 · 6 comments
Closed

[Bug] Dokan: Files are not sync when using git annex. #414

fbewivpjsbsby opened this issue Apr 4, 2024 · 6 comments
Assignees

Comments

@fbewivpjsbsby
Copy link

fbewivpjsbsby commented Apr 4, 2024

Version, approach of installation, operating system

  1. What version of ouisync are you using?
    v0.7.8
  2. What approach of installation do you install ouisync?
    github release exe.
  3. What is your operating system?
    Windows 10

Description

Files are not sync when using git annex.
Maybe it Copying files failed when writing in parallel.

Steps to reproduce

  1. Start ouisync and create a repository.
  2. Create a git annex repository using git bash. The ouisync repository cannot be used because it does not support some metadata. It is mean create the file on any drive other than the drive where ouisync is mounted, such as C: or D:, but not O: (ouisync).
mkdir "C:\test"
cd "C:\test"
git init
git annex init
  1. Set ouisync repository as git annex remote, we use 1MiB chunk.
git annex initremote test type=directory encryption=none directory="O:\[ouisync repository name]" chunk=1MiB
  1. Add some files to the git annex in the ouisync repository.
dd if=/dev/zero of=test bs=4MiB count=1
git annex add .
git commit -m "test"
git annex sync --no-push --no-pull --no-content
git annex copy --to test
  1. In the ouisync repository, the git annex remote looks like /BASE_DIR/aa/bb/FILEKEY/FILEKEY. Open aa/bb, we need to see 4 files in the directory (4MiB is 4 chunks). But sometimes we only see 1 file and other files are located in /BASE_DIR/tmp/FILEKEY/FILEKEY.
    If we delete the local file, copy ouisync repository file to local, we get the error.
git annex drop
git annex copy --from test
@inetic
Copy link
Member

inetic commented May 3, 2024

Hello, thank you for creating this issue. I looked into it briefly. What seems to be going on is that git annex copy -to test creates a file in /BASE_DIR/tmp/FILEKEY/FILEKEY then calls close on it and later tries to move the file to /BASE_DIR/aa/bb/FILEKEY/FILEKEY.

What I see is that sometimes the close operation takes longer and does not finish before the moving from /tmp/ to /aa/bb/ starts. The close operation internally calls flush on the file and because it has not yet finished, the move operation may not see the file in /tmp/ or it may not see all of the file's content.

More detailed, this close_file operation does not finish before this move_file operation starts.

It may be that I misunderstood Windows FS or Dokan's semantics in that when a file is to be re-opened (in this case in the move operation) perhaps we in our code need to ensure that the close operation finished.

inetic added a commit to equalitie/ouisync that referenced this issue May 3, 2024
inetic added a commit to equalitie/ouisync that referenced this issue May 13, 2024
@inetic inetic self-assigned this May 16, 2024
@inetic
Copy link
Member

inetic commented May 27, 2024

@fbewivpjsbsby this should now be fixed in the latest v0.8.0 release. I'm going to close the issue, but please feel free to reopen if you still see issues.

@inetic inetic closed this as completed May 27, 2024
@fbewivpjsbsby
Copy link
Author

@fbewivpjsbsby this should now be fixed in the latest v0.8.0 release. I'm going to close the issue, but please feel free to reopen if you still see issues.

I tested ouisync cli 5ddb344, lgtm.
But in ouisync-app 0.8.0 exe, It has error.

copy test (from test...)

  Verification of content failed
failed
copy: 1 failed

In /BASE_DIR/tmp is blank, looks good.
But in /BASE_DIR/aa/bb/FILEKEY/FILEKEY, I see all file size is 0b.

@inetic inetic reopened this Jun 6, 2024
@inetic
Copy link
Member

inetic commented Sep 4, 2024

There was a silly error and unfortunately due to our slow release process it took a lot of time to release. If it's still relevant to you and would like to give it a test, it should now be available in v0.8.1 release.

We are trying to improve the slow release and testing process and we modified the CI script to create artifacts. It can be found in GitHub > Actions> [Successful build] > Artifacts

@fbewivpjsbsby
Copy link
Author

There was a silly error and unfortunately due to our slow release process it took a lot of time to release. If it's still relevant to you and would like to give it a test, it should now be available in v0.8.1 release.

We are trying to improve the slow release and testing process and we modified the CI script to create artifacts. It can be found in GitHub > Actions> [Successful build] > Artifacts

In ouisync-app 0.8.1 exe lgtm.

@inetic
Copy link
Member

inetic commented Sep 23, 2024

Thanks, closing. If it re-appears, we can reopen the ticket.

@inetic inetic closed this as completed Sep 23, 2024
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

No branches or pull requests

2 participants