-
Notifications
You must be signed in to change notification settings - Fork 155
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
s3cmd sync and put/get with -r option is not working #367
Comments
Thank you for your report.
|
If I gonna do s3cmd sync s3://test/leo_commons/ work/ If there are deep directory level like docker registry, sync is not working as above comment. |
|
This is probably related to how leo_gateway handles delimiter. s3cmd first fetch object list of the bucket without delimiter, therefore a complete object list of every objects (including those in logical "sub-dir") should be returned (flat namespace) While in LeoFS, delimiter is always assumed to be "/", therefore always return objects and "DIR"s of the current directory level (hierarchical structure) Example of Prefix & Delimiter |
@windkit Thank you for surveying this issue. |
@windkit Thanks 👍 |
@yosukehara @mocchira are you working on this? If not I will check it. |
@windkit Thanks, please go ahead 👍 |
DescriptionTo summarize the situation about prefix and delimiter. S3 SpecRetrieve Keys starting with the prefix, group until the first occurrence of the delimiter LeoFSPrefix is treated as a directory path, delimiter is assumed to be This Issues3cmd does not specify delimiter character, it would retrieve the list of all files (recursively) under the directory IdeaAs a quick fix, we can have a separate code path to handle the case when there is not delimiter specified. Effectively, |
@windkit +1. |
I have made a PR for the quick fix at Test Result$ ./s3cmd ls -r s3://test
2015-11-06 05:13 1602 s3://test/Makefile
2015-11-06 05:13 1602 s3://test/dir1/Makefile
2015-11-06 05:13 1602 s3://test/dir1/dir2/Makefile $ ./s3cmd sync s3://test temp/
s3://test/Makefile -> <fdopen> [1 of 1]
1602 of 1602 100% in 0s 151.61 kB/s done
Done. Downloaded 1602 bytes in 1.0 seconds, 1602.00 B/s
$ ls -lR temp
temp:
total 8
drwxrwxr-x 3 user user 4096 11月 6 14:05 dir1
-rwxrwxr-x 1 user user 1602 11月 6 05:13 Makefile
temp/dir1:
total 8
drwxrwxr-x 2 user user 4096 11月 6 14:05 dir2
-rwxrwxr-x 1 user user 1602 11月 6 05:13 Makefile
temp/dir1/dir2:
total 4
-rwxrwxr-x 1 user user 1602 11月 6 05:13 Makefile $ ./s3cmd get -r s3://test temp2
s3://test/Makefile -> temp2/Makefile [1 of 3]
1602 of 1602 100% in 0s 250.35 kB/s done
s3://test/dir1/Makefile -> temp2/dir1/Makefile [2 of 3]
1602 of 1602 100% in 0s 184.44 kB/s done
s3://test/dir1/dir2/Makefile -> temp2/dir1/dir2/Makefile [3 of 3]
1602 of 1602 100% in 0s 358.00 kB/s done
$ ls -lR temp2
temp2:
total 8
drwxrwxr-x 3 user user 4096 11月 6 14:18 dir1
-rw-rw-r-- 1 user user 1602 11月 6 05:13 Makefile
temp2/dir1:
total 8
drwxrwxr-x 2 user user 4096 11月 6 14:18 dir2
-rw-rw-r-- 1 user user 1602 11月 6 05:13 Makefile
temp2/dir1/dir2:
total 4
-rw-rw-r-- 1 user user 1602 11月 6 05:13 Makefile |
@windkit This fix can cause out of memory if there are lots of files in LeoFS. |
@mocchira If that is a concern, we may need a big rework. Starting from As in the S3 Spec, the maximum number of result returned is 1000, I would first add a check on that. This seems to limit the memory usage at a reasonable level. If you do feel it is necessary to take a streaming approach, I could move on to use |
Reference to #432 for constructing XML entries |
I have updated the PR to stream the results to client. |
DONE |
I found that s3cmd sync and put/get with -r option is not working.
What version of LeoFS are you using?
1.2.8
erts-6.3
VMware
uname -a
) and processor architecture(cat /proc/cpuinfo
) and memory(cat /proc/meminfo
) are you using?OS
Linux XXXXXX 2.6.32-279.el6.x86_64 Import LeoFS-related all source codes #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
CPU
4core (Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz)
Memory
16GB
Running s3cmd sync command. I used latest s3cmd version which means I run git pull from s3cmd master branch.
Sync all objects recursively.
This is the example which stored docker registry objects.
List of docker registry
Run sync
Run get with -r option
The text was updated successfully, but these errors were encountered: