-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Use ListObjectsV2 in S3 Blobstore client #12238
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
Conversation
| init( BLOBSTORE_READ_REQUESTS_PER_SECOND, 100 ); | ||
| init( BLOBSTORE_DELETE_REQUESTS_PER_SECOND, 200 ); | ||
|
|
||
| // Request 1000 keys at a time, the maximum allowed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added knob here so that integration tests can test pagination without creating 1k+ files
| OPT_PROXY, | ||
| OPT_HELP | ||
| OPT_HELP, | ||
| OPT_LS_RECURSIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add recursive option here so we can use it in integration testgs
| local dir="${1}" | ||
| local aws_dir | ||
| aws_dir=$(mktemp -d -p "${dir}" -t s3.$$.XXXX) | ||
| aws_dir=$(mktemp -d "${dir}/s3.$$.XXXX") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x-platform compatible
| exit 1 | ||
| fi | ||
|
|
||
| blob_credentials_file="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws_setup currently uses (presumably) apple-internal aws configuration. Add flags so we can use a different set of params here.
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Fix a heap-use-after-free corruption bug revealed running against s3
=================================================================
==1988376==ERROR: AddressSanitizer: heap-use-after-free on address 0x508000012020 at pc 0x0000014b7bc2 bp 0x7ffca9e22410 sp 0x7ffca9e21bd0
WRITE of size 80 at 0x508000012020 thread T0
#0 0x0000014b7bc1 in __asan_memcpy /tmp/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:63:3
apple#1 0x0000043f5c83 in XXH64_reset /root/src/foundationdb/flow/include/flow/xxhash.h:1977:2
apple#2 0x00000337a336 in (anonymous namespace)::CopyUpFileActorState<(anonymous namespace)::CopyUpFileActor>::a_body1loopBody1(int) /root/src/foundationdb/fdbclient/S3Client.actor.cpp:429:2
* fdbclient/tests/s3client_test.sh
When run w/ bash -x, script was picking up the '++' output.
When going against s3, need to do secure_connection=1.
Fix the check for empty when looking for empty response.
Fixed an odd one where we had an errant ' on end of the url.
|
Pushed a change that does 'clang-format' on the changed .cpp files. Ran tests against s3 and ran into a few items: 1. a use-after-free in s3client (revealed by this PR but not caused by it); 2. need secure_connection=1 when against s3 ... was '0'; and 3. check for empty response is a little tricky. |
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
|
Joshua reports a failing test: Looks like a bug, but not because of this PR. |
Result of foundationdb-pr-clang-ide on Linux RHEL 9
|
Result of foundationdb-pr-macos-m1 on macOS Ventura 13.x
|
Result of foundationdb-pr-clang-arm on Linux CentOS 7
|
Result of foundationdb-pr-cluster-tests on Linux RHEL 9
|
Result of foundationdb-pr-macos on macOS Ventura 13.x
|
Result of foundationdb-pr-clang on Linux RHEL 9
|
Result of foundationdb-pr on Linux RHEL 9
|
| // Request 1000 keys at a time, the maximum allowed | ||
| state std::string resource = bstore->constructResourcePath(bucket, ""); | ||
| state std::string resource = bstore->constructResourcePath(bucket, ""); | ||
| resource.append("?list-type=2&max-keys=").append(std::to_string(CLIENT_KNOBS->BLOBSTORE_LIST_MAX_KEYS_PER_PAGE)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
|
Thanks for the contribution @noctella |
Problem
Fixes: #11725
The current s3 blobstore client uses the deprecated V1 list API: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html
This means that backup restoration will fail if the S3-compatible endpoint only implements the V2 endpoint.
Solution
Migrate to the (simpler) V2 API. Add integration tests in
s3client_test.sh. Add support for non-Apple S3 environments when running this integration test :)