Skip to content

feat(storage): write pipeline robustness and edge-case handling for object_store backend #3166

Description

@Sruhvx-jpg

Problem / Context

In #3165 (reviving #2257 for #2259), the foundational ObjectStoreStorage::S3 backend is established. To ensure production robustness and performance in the write pipeline, several edge cases and optimizations should be addressed as follow-up work:

Proposed Improvements

  1. Zero-Copy Writes in ObjectStoreWriter:

    • FileWrite::write receives owned bytes::Bytes.
    • object_store::WriteMultipart provides a put(Bytes) method that buffers without slice copying, avoiding redundant extend_from_slice allocations.
  2. S3 URL Boundary Validation:

    • Empty bucket strings (e.g. s3:///path/to/file or s3://) currently pass initial URL host parsing as "". These should explicitly return ErrorKind::DataInvalid.
    • Ensure paths without trailing slashes (s3://bucket) extract bucket and empty relative path cleanly.
  3. Stream Handling & State Machine Guards:

    • Validate delete_stream on empty streams (futures::stream::empty()) and ensure immediate error propagation on invalid URLs.
    • Add unit test coverage for ObjectStoreWriter state guards (e.g., verifying close() and write() error handling after writer has been closed).
  4. Backpressure & Memory Throttling:

    • For high-throughput streaming, evaluate WriteMultipart::wait_for_capacity to throttle producers and prevent unbounded 5MB chunk allocations in memory ahead of S3 network uploads.

Related

AI Disclosure

Drafted with AI assistance; reviewed and verified by contributor.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions