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

Enable ORA remote to recover from an interupted upload #6267

Merged
merged 5 commits into from
Dec 2, 2021

Conversation

mih
Copy link
Member

@mih mih commented Dec 1, 2021

Fixes #6252 which comprises two problems.

ORA remote used the uuid of the remote to place a file in transfer
in a tmp dir. But this actually causes transfer conflicts with
simultanous uploads of the same key from multiple clones.

This is fixed by using the here uuid.

The second issue is a test for existence of the transfer file, and
failing if there is one already. This prevents the first issue from
having practical relevance re data integrity. With the usage of here
uuids, the conflict can no longer happen, and the test is obsolete.

The fix involves import and instantiation of AnnexRepo(). The
additional cost for that is minimal (~10-50ms on my machine) and is only
payed once per process at PREPARE. This newly available repo API, will
enable removal of custom code from the implementation in subsequent
changes.

Additional changes

Fixes datalad#6252 which comprises two problems.

ORA remote used the uuid of the *remote* to place a file in transfer
in a tmp dir. But this actually causes transfer conflicts with
simultanous uploads of the same key from multiple clones.

This is fixed by using the `here` uuid.

The second issue is a test for existence of the transfer file, and
failing if there is one already. This prevents the first issue from
having practical relevance re data integrity. With the usage of `here`
uuids, the conflict can no longer happen, and the test is obsolete.

The fix involves import and instantiation of `AnnexRepo()`. The
additional cost for that is minimal (~10-50ms on my machine) and is only
payed once per process at PREPARE. This newly available repo API, will
enable removal of custom code from the implementation in subsequent
changes.
This is a bit of a hack, because the repo might be bare.
ConfigManager works in this case, but datalad#6264
causes it to ignore the dataset/branch config.
@mih mih added the semver-patch Increment the patch version when merged label Dec 1, 2021
@codecov
Copy link

codecov bot commented Dec 1, 2021

Codecov Report

Merging #6267 (7559733) into master (46120fe) will decrease coverage by 1.49%.
The diff coverage is 11.11%.

❗ Current head 7559733 differs from pull request most recent head e7f27ad. Consider uploading reports for the commit e7f27ad to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6267      +/-   ##
==========================================
- Coverage   89.62%   88.13%   -1.50%     
==========================================
  Files         323      323              
  Lines       41984    41950      -34     
==========================================
- Hits        37629    36973     -656     
- Misses       4355     4977     +622     
Impacted Files Coverage Δ
datalad/customremotes/ria_utils.py 95.23% <ø> (ø)
datalad/tests/test_utils.py 96.83% <ø> (+0.08%) ⬆️
datalad/distributed/ora_remote.py 31.33% <11.11%> (-0.14%) ⬇️
datalad/version.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/wtf.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/addurls.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/interface/clean.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/interface/rerun.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/no_annex.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/interface/unlock.py 0.00% <0.00%> (-100.00%) ⬇️
... and 88 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46120fe...e7f27ad. Read the comment docs.

@mih
Copy link
Member Author

mih commented Dec 1, 2021

@loj You could give this a try, whenever you hit this problem again.

@mih mih merged commit dbc3447 into datalad:master Dec 2, 2021
@mih mih deleted the rf-ora branch December 2, 2021 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ORA remote cannot recover from interrupted transfer
2 participants