feat(service): Add MultipartUploadBackend trait and related types#445
feat(service): Add MultipartUploadBackend trait and related types#445
Conversation
| /// Identifier returned when the part was uploaded. | ||
| pub etag: ETag, | ||
| /// Server-recorded time at which the part was uploaded. | ||
| pub last_modified: SystemTime, |
There was a problem hiding this comment.
if this is communicated back to users should it be DateTime<Utc> or something?
There was a problem hiding this comment.
Good catch!
We can just add #[serde(with = "humantime_serde")] once we #[derive(Serialize)] on this, that returns an RFC 3339 string and is consistent with how we surface timestamps when serializing Metadata to headers.
I will add Serialize to this when I implement the endpoints.
Defines the storage-backend abstraction for the new multipart upload protocol designed in https://www.notion.so/sentry/Design-Multipart-uploads-3438b10e4b5d8009aeedcd8db91122ea Adds an `objectstore-service::multipart` module with the per-protocol shared types (`UploadId`, `PartNumber`, `ETag`, `PartInfo`, `CompletedPart`, `ListedParts`) and the per-method response aliases. The `MultipartUploadBackend` trait itself sits next to `Backend` and `HighVolumeBackend` in `backend::common`, and consumes those types. The trait is intentionally stateless — every method takes `(&ObjectId, &UploadId)` rather than carrying session state — so backends can be implemented as thin wrappers over the underlying storage's native multipart API. A follow-up PR will land the `S3CompatibleBackend` implementation.
4214bef to
97d02e9
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 97d02e9. Configure here.
|
|
||
| /// Trait for backends that support our S3-style multipart upload protocol. | ||
| #[async_trait::async_trait] | ||
| pub trait MultipartUploadBackend: Backend + fmt::Debug + Send + Sync + 'static { |
There was a problem hiding this comment.
Redundant supertrait bounds on MultipartUploadBackend trait
Low Severity
MultipartUploadBackend explicitly lists fmt::Debug + Send + Sync + 'static as supertraits, but these are already required by Backend (line 33). This makes the bounds redundant and inconsistent with HighVolumeBackend: Backend (line 120), which correctly omits the repeated bounds.
Reviewed by Cursor Bugbot for commit 97d02e9. Configure here.


Adds a trait defining
MultipartUploadBackendand its associated types according to the design doc.The next PR will implement
MultipartUploadBackendon thes3_compatiblebackend.After that and implementations for
GCSandTieredStorageland, we will changeTieredStorageto require aMultipartUploadBackendin itslong_termslot, as opposed to just aBackend.