Skip to content

ListMultipartUploads: prefix matches only an exact key; max-uploads, key-marker and delimiter are ignored #79

Open

Description

@sargarass

ListMultipartUploads matches prefix as an exact key and ignores max-uploads, key-marker and delimiter

S3 defines prefix on ListMultipartUploads as a key prefix: every in-progress
upload whose key starts with it is listed, max-uploads bounds the page,
IsTruncated/NextKeyMarker/NextUploadIdMarker continue it, and delimiter
rolls keys up into CommonPrefixes. Silo (as MinIO before it) treats prefix
as the full key of one object: prefix=t/ lists nothing while prefix=t/a_b/p1
lists that one upload; with no prefix at all every upload in the bucket is
returned regardless of max-uploads and key-marker, always with
IsTruncated=false.

cmd/erasure-multipart.go:254-266 documents this as deliberate — "We do not
support prefix based listing"
— and derives the listing directory from the
object argument alone, so no request parameter reaches the filter.

A client that fences a set of uploads by prefix (abort every upload under
tables/x/) sees an empty list and concludes there is nothing to abort; a client
that pages with max-uploads cannot tell a small bucket from an unbounded
answer. Both work as specified on AWS, RustFS, SeaweedFS and Garage.

Reproduce

pgsty/silo:latest = RELEASE.2026-08-06T00-00-00Z
(3be10fcc1a44f6620ded0bd303461f9d688cca23), single node, one drive. Same on
minio/minio:RELEASE.2025-09-07 and RELEASE.2025-02-18. repro.py is
stdlib-only and signs itself.


[repro.py](https://github.com/user-attachments/files/31577196/repro.py)

Four uploads are opened, then listed:

bucket                                 -> 200 OK
CreateMultipartUpload t/a_b/p1         -> 200 OK
CreateMultipartUpload t/a_b/p2         -> 200 OK
CreateMultipartUpload t/c_d/p1         -> 200 OK
CreateMultipartUpload u/x              -> 200 OK

no parameters                          -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2', 't/c_d/p1', 'u/x']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
max-uploads=1                          -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2', 't/c_d/p1', 'u/x']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
key-marker=t/a_b/p2                    -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2', 't/c_d/p1', 'u/x']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/                              -> 200 OK  keys=[]  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/a_b/                          -> 200 OK  keys=[]  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/ delimiter=/                  -> 200 OK  keys=[]  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/a_b/p1 (exact key)            -> 200 OK  keys=['t/a_b/p1']  truncated=['false']  next-key-marker=['']  common-prefixes=[]

Expected

The same run, as AWS, RustFS, SeaweedFS and Garage answer it:

no parameters                          -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2', 't/c_d/p1', 'u/x']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
max-uploads=1                          -> 200 OK  keys=['t/a_b/p1']  truncated=['true']  next-key-marker=['t/a_b/p1']  common-prefixes=[]
key-marker=t/a_b/p2                    -> 200 OK  keys=['t/c_d/p1', 'u/x']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/                              -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2', 't/c_d/p1']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/a_b/                          -> 200 OK  keys=['t/a_b/p1', 't/a_b/p2']  truncated=['false']  next-key-marker=['']  common-prefixes=[]
prefix=t/ delimiter=/                  -> 200 OK  keys=[]  truncated=['false']  next-key-marker=['']  common-prefixes=['t/a_b/', 't/c_d/']
prefix=t/a_b/p1 (exact key)            -> 200 OK  keys=['t/a_b/p1']  truncated=['false']  next-key-marker=['']  common-prefixes=[]

Activity

  1. Vonng commented on Aug 30, 2026

    @Vonng
    Member

    Thank you for the detailed report and the self-contained reproducer. We have completed a source review, an independent live reproduction, and an adversarial design review. The issue is valid.

    Our review found that ListMultipartUploads currently has two different implementations:

    • With a non-empty prefix, SILO hashes the value as a complete object key and lists one sha256(bucket/object) directory. This is an exact-object lookup, not S3 prefix matching.
    • With an empty prefix, the pool layer returns entries from a node-local in-memory mpCache. This path ignores pagination, markers, and delimiter semantics, is not rebuilt from disk, and is not authoritative across nodes.

    This distinction slightly narrows one claim in the report: max-uploads, upload-id-marker, and IsTruncated do work partially on the exact-object path. They are ignored on the empty-prefix cache path exercised by the reproducer. The more serious finding is that a restart or node switch can return an empty bucket-wide listing while the multipart uploads still exist on disk and remain discoverable by exact key. Existing tests do not catch this because their final assertions check echoed request fields rather than the returned uploads, prefixes, markers, and truncation state.

    A complete AWS-compatible repair is not a small filtering change. The current on-disk layout is:

    .minio.sys/multipart/<sha256(bucket/object)>/<upload-id>/xl.meta
    

    The original bucket and object key cannot be recovered from the hash and are not persisted in the current upload metadata. Existing keyless uploads therefore cannot be reliably backfilled.

    The design direction we consider viable is:

    1. Persist the canonical bucket and object key in the new upload's existing quorum-written xl.meta, and remove those upload-only fields when the upload is completed.
    2. Discover candidates across accessible pools, sets, and drives; union the directory results; then validate each candidate with erasure read quorum before listing it.
    3. Apply prefix, delimiter, ordering, markers, pagination, URL encoding, truncation, and next-marker semantics once, globally, after the multi-pool merge. Any cache must remain a rebuildable optimization rather than the source of truth.
    4. Preserve the current internal exact-object lookup behind a separate helper so that NewMultipartUpload pool placement does not accidentally acquire lexical-prefix semantics.
    5. Gate strict behavior through a rolling-upgrade capability check and a zero-keyless-upload condition. Benchmark the scan path at realistic and pathological active-upload cardinalities before considering a durable secondary index.

    This change also has observable compatibility impact. Correct prefix matching returns more keys than the current exact-key behavior; correct ordering and pagination change result order and page size; clients that accidentally rely on the current 10,000-entry/unpaginated response may need to follow continuation markers. The implementation must therefore be treated as a compatibility project with an explicit rollout boundary, not as an incidental patch.

    We classify this as a high/P1 compatibility and operational-correctness issue, not a P0 data-loss or security issue. No committed object loss or security-boundary bypass was demonstrated, and default stale-upload cleanup limits accumulation. The severity comes from successful but misleading responses, restart/node inconsistency, and cleanup tooling being able to conclude falsely that no uploads remain.

    Release decision: we will keep this issue open, but we do not consider the current release suitable for implementing or shipping this change. We will schedule it for a later release after the S3 conformance fixtures, performance envelope, mixed-version migration behavior, failure tests, and compatibility documentation are complete. We do not want to replace the current limitation with a rushed distributed-listing implementation that is more convincing but still incorrect.

  2. Vonng commented on Sep 2, 2026

    @Vonng
    Member

    20260903 release-boundary update: this conformance gap remains open and is explicitly listed as a known issue.

    The release does not change the hashed on-disk multipart discovery model or pretend that filtering the node-local cache is an authoritative distributed listing. Correct prefix/delimiter/marker/pagination behavior still requires persisted canonical keys, quorum-validated discovery, a global merge, mixed-version handling, and performance limits.

    It is not a committed-object data-loss or security blocker for the general release, but workloads that rely on bucket-wide multipart enumeration or cleanup should not treat the current response as authoritative. Design record: https://silo.pgsty.com/blog/design/list-multipart-uploads/ .

  3. added
    bug
    on Sep 2, 2026
  4. Vonng commented on Sep 6, 2026

    @Vonng
    Member

    Reconfirmed on current main e7d0e62f16ed8a2373a4e9f5c4639d62886c09f2, 2026-09-06, with four disposable in-progress uploads:

    • Empty prefix: all four returned.
    • MaxUploads=1: still all four, IsTruncated=false.
    • KeyMarker=t/a_b/p2: still all four.
    • Prefix=t/: none; exact Prefix=t/a_b/p1: that upload is returned.
    • After a server restart: empty-prefix listing returns none, while exact-key lookup still finds the upload. The same uploads were then aborted by their known keys and IDs.

    This confirms the earlier cache/discovery analysis still applies to current code. It remains a real multipart enumeration/cleanup limitation, not a reason to reinterpret the empty result as an absence of pending uploads. The existing design and known-issue boundary remain appropriate; fixing only cache filtering would leave the restart and cross-node correctness problem unsolved. Schedule the durable discovery and S3 listing work separately from the current replication fixes.

  5. moved this from Backlog to In progress in Siloon Sep 15, 2026
  6. self-assigned this
    on Sep 15, 2026
  7. added theissue type on Sep 15, 2026
  8. added a commit that references this issue on Sep 16, 2026
  9. Vonng commented on Sep 16, 2026

    @Vonng
    Member

    The 20260916 release contains the durable strict multipart discovery/preflight work from #198/#213, but it deliberately keeps legacy as the default. The default path therefore retains the exact-key/node-local-cache behavior reported here; strict mode requires a coordinated writer upgrade, legacy-upload drain, preflight and capacity validation.

    The late physical creation-after-cancellation fence and production-scale capacity/acceptance boundaries also remain open. This is a partial implementation, not full closure of the S3 behavior requested in this issue. Keeping #79 open and linking the release/design contract here: https://silo.pgsty.com/blog/design/list-multipart-uploads/.

  10. added a commit that references this issue on Oct 17, 2026
  11. added this to the Next cycle milestone on Oct 19, 2026
  12. Vonng commented on Oct 19, 2026

    @Vonng
    Member

    20261018 update: this issue remains open. The public persistent-listing path introduced by #243 was withdrawn in 4733e1423. The published release retains legacy listing and best-effort abort behavior; the old strict setting is ignored with a warning.

    Next-cycle work must establish durable cross-node discovery, correct prefix/delimiter/pagination behavior, bounded cost at realistic upload counts, and the cancellation/late-creation boundary. Empty listings and HTTP 204 responses do not prove that all physical uploads are gone. #246 only fixes empty-parent cleanup.

    The design record reflects this decision.

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

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

  • Status
    In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions