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

"rucio download --no-subdir" behavior is different from its documentation #4323

Closed
rcarpa opened this issue Feb 12, 2021 · 7 comments
Closed

Comments

@rcarpa
Copy link
Contributor

rcarpa commented Feb 12, 2021

Motivation

Rucio documentation for file download states that the "--no-subdir" will overwrite files if they exist in the destination folder.

  --no-subdir           Don't create a subdirectory for the scope of the
                        files. Existing files in the directory will be
                        overwritten.

However, the files are not overwitten, as shown by the following example :

$ echo "some_content" > /tmp/test/a_file
$ rucio upload --rse XRD1 --scope test /tmp/test/a_file
$ echo "other_content" > /tmp/test/a_file 
$ rucio download --no-subdir --dir /tmp/test/ test:a_file
   ----------------------------------
   Download summary
   ----------------------------------------
   DID mock:a_file
   Total files:                                  1
   Downloaded files:                             0
   Files already found locally:                  1
   Files that cannot be downloaded:              0
$ cat /tmp/test/a_file 
other_content
$ rm /tmp/test/a_file
$ rucio download --no-subdir --dir /tmp/test/ test:a_file
   ----------------------------------
   Download summary
   ----------------------------------------
   DID mock:a_file
   Total files:                                  1
   Downloaded files:                             1
   Files already found locally:                  0
   Files that cannot be downloaded:              0
# cat /tmp/test/a_file 
some_content

Modification

Either the documentation must be updated to note that existing files will not be overwritten, or the files must be overwritten.

@rcarpa
Copy link
Contributor Author

rcarpa commented Feb 17, 2021

Do we want to implement the documented behavior; or to fix documentation ?

@mlassnig
Copy link
Contributor

I think pilot expects this behaviour, so again, asking @PalNilsson :-)

@bziemons
Copy link
Member

I implemented the other in #3737 and I missed the cli documentation, probably because it was marked a "bug". I am expecting the files to be overwritten, if they differ.

@rcarpa
Copy link
Contributor Author

rcarpa commented Feb 17, 2021

So we want to overwrite files if they differ; but skip them if their checksum is correct ?

@bziemons
Copy link
Member

that's my understanding, yes. CC: @bari12

@rcarpa
Copy link
Contributor Author

rcarpa commented Feb 17, 2021

Seems logical to me. It is probably worth also doing the same thing in the case when "--no-subdir" is not set. To have a consistent behavior. If file present but checksum different : redownload. If checksum correct, don't do anything.

@bari12
Copy link
Member

bari12 commented Feb 17, 2021

Yes, consistent behaviour would be good here I think. --no-subdir or not should not change that.

rcarpa added a commit to rcarpa/rucio that referenced this issue Feb 17, 2021
…#4323

Also update the "no-subdir" option documentation.

In the past, rucio was changing its behavior of overwriting existing
files depending on the 'no-subdir' option. If this option was set,
local files were always overwritten. If the option was not set, the
files were always let intact. This was counter-intuitive and was fixed
in a recent commit as being a bug. Leaving an incorrect documentation.

The discussion in the linked issue suggested that it will be the most
intuitive to check the checksum of existing files. If their checksum
is correct: leave them intact, but overwrite files in case of a
miss-match.
rcarpa added a commit to rcarpa/rucio that referenced this issue Feb 17, 2021
…#4323

Also update the "no-subdir" option documentation.

In the past, rucio was changing its behavior of overwriting existing
files depending on the 'no-subdir' option. If this option was set,
local files were always overwritten. If the option was not set, the
files were always let intact. This was counter-intuitive and was fixed
in a recent commit as being a bug. Leaving an incorrect documentation.

The discussion in the linked issue suggested that it will be the most
intuitive to check the checksum of existing files. If their checksum
is correct: leave them intact, but overwrite files in case of a
miss-match.
rcarpa added a commit to rcarpa/rucio that referenced this issue Feb 17, 2021
…#4323

Also update the "no-subdir" option documentation.

In the past, rucio was changing its behavior of overwriting existing
files depending on the 'no-subdir' option. If this option was set,
local files were always overwritten. If the option was not set, the
files were always let intact. This was counter-intuitive and was fixed
in a recent commit as being a bug. Leaving an incorrect documentation.

The discussion in the linked issue suggested that it will be the most
intuitive to check the checksum of existing files. If their checksum
is correct: leave them intact, but overwrite files in case of a
miss-match.
@bari12 bari12 closed this as completed in d722b5c Feb 23, 2021
bari12 added a commit that referenced this issue Feb 23, 2021
…_redownload

Clients: re-download existing files if checksum is wrong. Fixes #4323
bari12 pushed a commit that referenced this issue Feb 23, 2021
Also update the "no-subdir" option documentation.

In the past, rucio was changing its behavior of overwriting existing
files depending on the 'no-subdir' option. If this option was set,
local files were always overwritten. If the option was not set, the
files were always let intact. This was counter-intuitive and was fixed
in a recent commit as being a bug. Leaving an incorrect documentation.

The discussion in the linked issue suggested that it will be the most
intuitive to check the checksum of existing files. If their checksum
is correct: leave them intact, but overwrite files in case of a
miss-match.
@bari12 bari12 added this to the 1.24.5-clients milestone Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants