Fast multipart uploads #63

Closed
opened 2023-03-21 12:11:35 +00:00 by alexvanin · 2 comments
Owner

S3 Gateway implements CompleteMultipartUpload this way (5c62010331):

  1. start creating new object,
  2. start reading payload of first parts and pipe it into new object,
  3. finish creating new object and link new object ID with multipart object.

This is quite slow and inefficient, because in the end user awaits up to x2 upload time (for the parts and for the new object at complete multipart upload). Also it requires to delete parts, which may cause some issues in case of failures.

As the solution I propose to define special combine object. This object should be marked in the tree service and store list of object IDs. It is similar to link object. Unlike it, combine object stores IDs of any object and not just small objects. This should be safe enough, because combine objects are stored according to placement policy.

🟢 Fast complete multipart upload.
🟢 No changes in native protocol: S3 uses object names to identify objects instead of payload+header hash in native protocol, so it can't be a part of native protocol.
🟢 Removes some delete operations from multipart upload case.
🔴 Slower GET operations, especially for small objects which can be upload as multipart (see S3 Browser implementation, which uses 8MiB parts).
🔴 Requires support in HTTP Gateway to process combine objects.

Consider some extra optimizations like storing small combine objects fully in tree service.

We can create small PoC and check how badly it will affect GET operations (for small and large objects).

/cc @TrueCloudLab/storage-services-committers

S3 Gateway implements `CompleteMultipartUpload` this way (https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/commit/5c62010331ad5771fd6787ec0e1993b69c439b32): 1) start creating new object, 2) start reading payload of first parts and pipe it into new object, 3) finish creating new object and link new object ID with multipart object. This is quite slow and inefficient, because in the end user awaits up to x2 upload time (for the parts and for the new object at complete multipart upload). Also it requires to delete parts, which may cause some issues in case of failures. As the solution I propose to define special _combine_ object. This object should be marked in the tree service and store list of object IDs. It is similar to [link object](https://git.frostfs.info/TrueCloudLab/frostfs-api/src/commit/5fd4059061b8922d671b7e6e4615e1a865edf527/object/types.proto#L230). Unlike it, _combine_ object stores IDs of any object and not just small objects. This should be safe enough, because _combine_ objects are stored according to placement policy. 🟢 Fast complete multipart upload. 🟢 No changes in native protocol: S3 uses object names to identify objects instead of payload+header hash in native protocol, so it can't be a part of native protocol. 🟢 Removes some delete operations from multipart upload case. 🔴 Slower GET operations, especially for small objects which can be upload as multipart (see S3 Browser implementation, which uses 8MiB parts). 🔴 Requires support in HTTP Gateway to process _combine_ objects. Consider some extra optimizations like storing small _combine_ objects fully in tree service. We can create small PoC and check how badly it will affect GET operations (for small and large objects). /cc @TrueCloudLab/storage-services-committers
alexvanin self-assigned this 2023-03-21 12:11:35 +00:00
Owner

When we have life-cycle features, it should become possible to do background recombination afterwards.

When we have life-cycle features, it should become possible to do background recombination afterwards.
dkirillov was assigned by alexvanin 2023-04-12 15:19:59 +00:00
alexvanin removed their assignment 2023-04-12 15:20:03 +00:00
snegurochka added the
discussion
enhancement
labels 2023-05-03 17:15:03 +00:00
alexvanin referenced this issue from a commit 2023-07-20 14:50:56 +00:00
Member

done in #157

done in https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/pulls/157
alexvanin added this to the v0.28.0 milestone 2023-09-08 12:02:14 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#63
No description provided.