refactor-router #189

Merged
lx merged 1 commits from trinity-1686a/garage:refactor-router into main 2022-01-17 15:03:23 +00:00

This PR is based on #183, and may not be merged until that PR is. (WIP is set for this reason)

a few things that are not supported (and it's easier to see now) :

This PR is based on #183, and may not be merged until that PR is. (WIP is set for this reason) a few things that are not supported (and it's easier to see now) : - versionning where S3 support it (we already knew) - [HeadObject::part_number](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#AmazonS3-HeadObject-request-querystring-PartNumber) & [GetObject::part_number](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html#AmazonS3-GetObject-request-querystring-PartNumber) : to get info about a part, when the object was uploaded in multipart I believe - [ListObjectsV2::fetch_owner](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#AmazonS3-ListObjectsV2-request-querystring-FetchOwner): to get the owner of an object. I don't think we support the notion of ownership on objects
trinity-1686a added 6 commits 2022-01-11 18:17:23 +00:00
trinity-1686a added a new dependency 2022-01-14 23:55:55 +00:00
trinity-1686a added 10 commits 2022-01-17 12:55:17 +00:00
continuous-integration/drone/push Build is passing Details
b4592a00fe
Implement ListMultipartUploads (#171)
Implement ListMultipartUploads, also refactor ListObjects and ListObjectsV2.

It took me some times as I wanted to propose the following things:
  - Using an iterator instead of the loop+goto pattern. I find it easier to read and it should enable some optimizations. For example, when consuming keys of a common prefix, we do many [redundant checks](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/api/s3_list.rs#L125-L156) while the only thing to do is to [check if the following key is still part of the common prefix](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/feature/s3-multipart-compat/src/api/s3_list.rs#L476).
  - Try to name things (see ExtractionResult and RangeBegin enums) and to separate concerns (see ListQuery and Accumulator)
  - An IO closure to make unit tests possibles.
  - Unit tests, to track regressions and document how to interact with the code
  - Integration tests with `s3api`. In the future, I would like to move them in Rust with the aws rust SDK.

Merging of the logic of ListMultipartUploads and ListObjects was not a goal but a consequence of the previous modifications.

Some points that we might want to discuss:
  - ListObjectsV1, when using pagination and delimiters, has a weird behavior (it lists multiple times the same prefix) with `aws s3api` due to the fact that it can not use our optimization to skip the whole prefix. It is independant from my refactor and can be tested with the commented `s3api` tests in `test-smoke.sh`. It probably has the same weird behavior on the official AWS S3 implementation.
  - Considering ListMultipartUploads, I had to "abuse" upload id marker to support prefix skipping. I send an `upload-id-marker` with the hardcoded value `include` to emulate your "including" token.
  - Some ways to test ListMultipartUploads with existing software (my tests are limited to s3api for now).

Co-authored-by: Quentin Dufour <quentin@deuxfleurs.fr>
Reviewed-on: #171
Co-authored-by: Quentin <quentin@dufour.io>
Co-committed-by: Quentin <quentin@dufour.io>
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
f7349f4005
Add quotes in returned etags
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build encountered an error Details
60c0033c8b
Update documentation
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details
bed3106c6a
Implement {Put,Get,Delete}BucketCors and CORS in web server
trinity-1686a force-pushed refactor-router from 77200a8664 to 178e35f868 2022-01-17 14:53:32 +00:00 Compare
trinity-1686a removed a dependency 2022-01-17 14:53:43 +00:00
trinity-1686a changed title from WIP: refactor-router to refactor-router 2022-01-17 14:53:50 +00:00
lx merged commit 178e35f868 into main 2022-01-17 15:03:23 +00:00
Sign in to join this conversation.
No description provided.