Skip to content

CreateBucket after full-cluster restart: 503 after the bucket is created, retry gets 409, bucket left without metadata (Object Lock/versioning lost) #355

Open

Description

@michael-p-exn

Report bugs in the PGSTY SILO server (pgsty/silo) here.

Expected Behavior

PUT /<bucket> either creates the bucket with its metadata (including requested Object Lock / versioning) and returns
200, or fails without leaving the bucket behind, so that a client retry can succeed with the same options.

Current Behavior

For about 2–16 seconds after restarting all nodes of a distributed deployment, while /minio/health/cluster already
returns 200 on every node:

  1. PUT /<new-bucket> creates the bucket volume on all drives but responds 503 SlowDownWrite
    ("Resource requested is unwritable, please reduce your request rate").
  2. .minio.sys/buckets/<bucket>/.metadata.bin is written on 0 of 8 drives, and the created volumes are not removed.
  3. SDKs retry 503, so the retry returns 409 BucketAlreadyOwnedByYou, which most tools treat as success.

A bucket requested with x-amz-bucket-object-lock-enabled: true in this window ends up without Object Lock and without
versioning
, and objects in it can be deleted:

CreateBucket(ObjectLockEnabledForBucket=True): 409 BucketAlreadyOwnedByYou   (boto3 default retries, RetryAttempts=1)
HeadBucket:                 200
GetObjectLockConfiguration: ObjectLockConfigurationNotFoundError
GetBucketVersioning:        <not enabled>
DeleteObject:               allowed

Timeline after one restart (fresh random bucket names, one request every 0.5 s, SDK retries disabled except where noted):

0–2 s     503 XMinioServerNotInitialized   (expected, retryable)
~1.6 s    /minio/health/cluster = 200 on all 4 nodes
2–16 s    503 SlowDownWrite, bucket created anyway; with SDK retry -> 409 BucketAlreadyOwnedByYou; ~600 ms per request
>16 s     200, ~11 ms

Reproduced in every restart cycle we ran (80+ wrong 409s across 3 cycles). A freshly started cluster (no restart):
20/20 CreateBucket -> 200.

mcli admin trace -a for one client call shows two s3.PutBucket requests: the first one does MakeVol on all 8 drives
successfully and returns statusCode: 503; the retry gets volume already exists from every drive and returns 409.

Server log during the window:

Error: Write quorum could not be established on pool: 0, set: 0, expected write quorum: 5, drives-online: 4
INFO: Unable to use the drive http://silo1:9000/data1: drive not found, will be retried

Possible Solution

In cmd/erasure-server-pool.go, (*erasureServerPools).MakeBucket rolls back only when z.s3Peer.MakeBucket fails.
Errors from the steps after it, lockBucketMetadata and meta.Save, are returned with the volumes left in place:

if err := z.s3Peer.MakeBucket(ctx, bucket, opts); err != nil {
    if _, ok := err.(BucketExists); !ok {
        z.DeleteBucket(...)            // rollback exists only here
    }
    return err
}
ctx, unlock, err := lockBucketMetadata(ctx, z, bucket)
...
if err = meta.Save(bgContext(ctx), z); err != nil {
    return err                         // volumes stay, metadata missing
}

Bucket volumes are created through the peer S3 grid RPC, which works shortly after restart. The metadata is written as an
erasure-coded object in .minio.sys through storage clients that still treat remote drives as offline, so it fails with
InsufficientWriteQuorum → SlowDownWrite.

Possible fixes (any of them would prevent the silent loss of options):

  • roll back the created bucket (DeleteBucket with NoLock/NoRecreate) on any error after s3Peer.MakeBucket;
  • or make the retry complete the creation: if the volume exists but .metadata.bin is missing, write metadata with the
    requested options instead of returning BucketExists;
  • optionally, don't report /minio/health/cluster as healthy until the node has write quorum for .minio.sys.

Possibly related: remotePeerS3Client.MakeBucket returns nil when client.gridConn() is nil
(cmd/peer-s3-client.go), so an unconnected peer counts as success in the quorum.

Upstream minio/minio master has the same "no rollback after meta.Save" structure but not the lockBucketMetadata
step. We haven't tested whether upstream reproduces the same window.

Steps to Reproduce (for bugs)

  1. Start a 4-node × 2-drive deployment (local processes are enough):

    D=$PWD/data; eps=()
    for n in 1 2 3 4; do for d in 1 2; do eps+=("http://127.0.0.1:910$n$D/n$n/d$d"); done; done
    start() { for n in 1 2 3 4; do mkdir -p $D/n$n/d1 $D/n$n/d2
      MINIO_CI_CD=1 MINIO_ROOT_USER=acceptance MINIO_ROOT_PASSWORD=acceptance-secret-123 \
      silo server --address 127.0.0.1:910$n --console-address 127.0.0.1:920$n "${eps[@]}" > n$n.log 2>&1 &
      echo $! > n$n.pid; done; }
    start
  2. Wait until /minio/health/cluster returns 200 on all nodes, then restart every node:

    kill $(cat n*.pid); while pgrep -f 'silo server' >/dev/null; do sleep 0.1; done; start
    until curl -fs http://127.0.0.1:9101/minio/health/cluster; do sleep 0.2; done; sleep 1
  3. Immediately create a bucket with Object Lock (any SDK with default retries; boto3 shown):

    import boto3
    from botocore.config import Config
    s3 = boto3.client("s3", endpoint_url="http://127.0.0.1:9101", region_name="us-east-1",
                      aws_access_key_id="acceptance", aws_secret_access_key="acceptance-secret-123",
                      config=Config(s3={"addressing_style": "path"}))
    try:
        s3.create_bucket(Bucket="worm-test-1", ObjectLockEnabledForBucket=True)
    except Exception as e:
        print(e)            # BucketAlreadyOwnedByYou
  4. After ~20 s: get_object_lock_configuration(Bucket="worm-test-1") → ObjectLockConfigurationNotFoundError;
    ls data/n*/d*/.minio.sys/buckets/worm-test-1/.metadata.bin → no such file on any drive.
    With retries disabled (retries={"total_max_attempts": 1, "mode": "standard"}) step 3 returns 503 SlowDownWrite.

Context

We are evaluating Silo as the S3 backend for PostgreSQL backups (WAL-G / pgBackRest) and found this in our release
acceptance tests (restart-recovery scenario). Bucket creation right after maintenance or a rolling restart is realistic
for automated provisioning. A backup bucket that was requested with Object Lock but silently created without it
breaks the WORM guarantee without anyone noticing.

Regression

Unknown. Not tested on earlier Silo releases or on upstream MinIO.

Your Environment

  • Version used (silo --version): RELEASE.2026-11-12T00-00-00Z (commit-id=44e848fedf8cec3d8c0da4b1aa8422390a2b7a8b), go1.27.4
  • Server setup and configuration: distributed, 1 pool, 4 nodes × 2 drives, default storage class; reproduced both as
    4 Docker containers (linux/amd64, release tarball binary on debian:12-slim) and as 4 local processes on one host
  • Operating System and version (uname -a): Linux (GitLab CI, Docker-in-Docker); macOS 26 / Darwin 25.6.0 arm64 (local)
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

    • Status
      Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions