Skip to content

Multi-pool: a DELETE that fails in one pool still serves an older copy of the object, and a multi-object delete reports it as deleted #256

Closed

Description

@botdeniska

Found while testing deletes of objects that have copies in more than one pool.

An object without versions can have a copy in several pools: an overwrite goes to a pool chosen by free space, not to the pool that already holds the object. When the delete of such an object fails in one pool, for example because half the drives of the older copy's set are offline (an EC 8+8 copy is still readable, but a delete needs 9 drives), the newest copy in the other pool is deleted anyway. Once the drives are back, the older write of the object is served again. A single DELETE at least returns 503. A multi-object delete (mc rm, aws s3 rm, DeleteObjects from any SDK) returns success for the object.

The same merge in DeleteObjects also reports a version as deleted when a pool that holds a copy of it fails to delete it, and the version stays readable.

In a versioned bucket, a DELETE without a version ID fails with 503 when the first pool that holds the key cannot take the delete marker, although another pool that holds the key could.

Expected Behavior

When a delete fails in any pool that holds a copy, the request fails, and the object reads as it did before the request: the latest write, not an older one. A retry after the drives are back deletes every copy. deleteObjectReconciled already works this way for conditional deletes and for deletes by version ID ("Retire non-authoritative copies first", cmd/erasure-server-pool-consistency.go:519).

A delete marker hides the key in every pool, so a DELETE without a version ID in a versioned bucket succeeds as long as one pool that holds the key can take the marker.

Current Behavior

  • DELETE without a version ID, object without versions. deleteObjectFromAllPools (cmd/erasure-server-pool.go:1389) deletes in all pools at once and then returns the first error. By then the newest copy is gone. The client gets 503, and after the drives come back GET returns the older write.
  • Multi-object delete, object without versions. DeleteObjects (cmd/erasure-server-pool.go:1422) runs the batch in every pool in parallel. When it merges the results, the first pool that found and removed the object wins (:1461-1466), and the error of the other pool is dropped. mc rm prints Removed and exits 0. After the drives come back, GET returns the older write.
  • Multi-object delete by version ID, copy of the version in two pools. Such copies are left by a decommission or rebalance until it removes the source. The same merge reports the version as deleted while the pool that failed still holds it, and GET ?versionId= keeps returning it.
  • DELETE without a version ID, versioned bucket, versions in two pools. DeleteObject writes the marker into the first pool, by index, that holds the key (cmd/erasure-server-pool.go:1370). If that pool's set has too few drives online, the request fails with 503, even when it is the pool with the older versions and the other pool is healthy.

Possible Solution

  1. deleteObjectFromAllPools: delete the copies one by one, from the oldest to the newest (the poolIndices slice is already sorted by ModTime), and stop at the first error, as deleteObjectReconciled does. A failed delete then leaves the newest copy in place.
  2. DeleteObjects: when the request removes data (a version ID, or an object without versions), report the error of any pool, even if another pool removed its copy. A delete marker written in one pool still counts as success, as now.
  3. DeleteObjects cannot order the deletes, because the pools run the batch in parallel. Before the batch, leave out an object or version when a set without delete quorum holds a copy of it, and fail it with InsufficientWriteQuorum. Delete quorum means N/2+1 drives online, the quorum erasureObjects.DeleteObjects uses. Only such sets are read, so a healthy cluster does no extra I/O.
  4. Delete marker: when more than one pool holds the key, write the marker into the first pool that has a readable version and enough drives online for the write. When no pool qualifies, keep the current loop.

I have a patch with tests and will open a PR.

Steps to Reproduce (for bugs)

One native server with two pools of 16 drives and MINIO_STORAGE_CLASS_STANDARD=EC:8, with an unversioned bucket bkt and a versioned bucket vbkt. The script, repro.sh <silo-binary> <work-dir> [mc], is below. It does the following:

  1. Start the server with p1 only, write older to bkt/key-single, bkt/key-multi and vbkt/key-marker. Restart with p1 + p2.
  2. Overwrite each key until the overwrite lands in p2. Then p1 holds the older copy (versions) and p2 the newest.
  3. Take 8 drives of p1 offline at runtime: mv p1/dN p1/dN.off for N = 1..8.
  4. Delete the keys: key-single with one DELETE (curl --aws-sigv4), key-multi with mc rm, key-marker with one DELETE without a version ID.
  5. Move the drives back, GET the keys, then delete the unversioned keys again.

main (b91e1c6f2):

drives:    8 "state":"offline"   24 "state":"ok"    1 "state":"online" 
key-single: DELETE -> HTTP 503
key-multi: mc rm -> exit 0: Removed `l/bkt/key-multi`.
vbkt/key-marker: DELETE -> HTTP 503
drives back:   32 "state":"ok"    1 "state":"online" 
key-single: GET -> older
key-multi: GET -> older
vbkt/key-marker: GET -> newest-1, versions: 3

With the patch:

drives:    8 "state":"offline"   24 "state":"ok"    1 "state":"online" 
key-single: DELETE -> HTTP 503
key-multi: mc rm -> exit 1: mc: <ERROR> Failed to remove `l/bkt/key-multi`. Resource requested is unwritable, please reduce your request rate
vbkt/key-marker: DELETE -> HTTP 204
drives back:   32 "state":"ok"    1 "state":"online" 
key-single: GET -> newest-1
key-multi: GET -> newest-1
vbkt/key-marker: GET -> HTTP 404, versions: 4
retry: DELETE key-single -> HTTP 204, mc rm key-multi -> exit 0
key-single: GET -> HTTP 404
key-multi: GET -> HTTP 404
repro.sh
#!/usr/bin/env bash
# Repro for the SILO issue: a DELETE of an object without versions that fails in one pool still
# removes the newest copy in the other pool, so the older write is served again; a multi-object
# delete (mc rm) of the same object reports success; in a versioned bucket, a DELETE without a
# version ID fails when the first pool with the key cannot take the delete marker.
#
# One native server, MINIO_CI_CD=1, no Docker. p1 and p2 have 16 drives each, MINIO_STORAGE_CLASS_STANDARD=EC:8
# (8+8: an object reads with 8 drives, a delete needs 9). Two keys in an unversioned bucket bkt, one in a
# versioned bucket vbkt:
#   1) the server starts with p1 only and writes "older" to every key; then it restarts with p1+p2;
#   2) each key is overwritten until the overwrite lands in p2 (SILO picks a random pool for an
#      overwrite), so p1 holds the older copy and p2 the newest;
#   3) 8 drives of p1 go offline (rename at runtime);
#   4) key-single: one DELETE (curl, as an SDK sends it); key-multi: mc rm (DeleteObjects);
#      key-marker (versioned bucket vbkt, a version in each pool): one DELETE without versionId;
#   5) the drives come back; GET the keys; delete the unversioned keys again.
#
# Usage: repro.sh <silo-binary> <work-dir> [mc]
# PORT (default 9311) is the S3 port, PORT+1 the console. The work dir is removed at the end.
set -u
BIN="${1:?silo binary}"; WORK="${2:?work dir}"; MC="${3:-mc}"
PORT="${PORT:-9311}"; URL="http://127.0.0.1:$PORT"
USER=minioadmin; PASS=minioadmin; B=bkt
export MC_CONFIG_DIR="$WORK/mc"
PID=""
cleanup() { [ -n "$PID" ] && kill "$PID" 2>/dev/null && wait "$PID" 2>/dev/null; rm -rf "$WORK"; }
trap cleanup EXIT
mkdir -p "$WORK/files" "$MC_CONFIG_DIR"
for p in p1 p2; do for d in $(seq 1 16); do mkdir -p "$WORK/$p/d$d"; done; done

s3() { curl -s --aws-sigv4 "aws:amz:us-east-1:s3" --user "$USER:$PASS" "$@"; }
start() {
  MINIO_CI_CD=1 MINIO_ROOT_USER=$USER MINIO_ROOT_PASSWORD=$PASS MINIO_STORAGE_CLASS_STANDARD=EC:8 \
    "$BIN" server --address "127.0.0.1:$PORT" --console-address "127.0.0.1:$((PORT + 1))" "$@" >>"$WORK/server.log" 2>&1 &
  PID=$!
  for _ in $(seq 1 60); do curl -sf -o /dev/null "$URL/minio/health/cluster" && return; sleep 1; done
  echo "server did not start"; exit 1
}
stop() { kill "$PID"; wait "$PID" 2>/dev/null; PID=""; }
put() { # key content
  head -c 65536 /dev/zero | tr '\0' x >"$WORK/files/body"; printf '%s' "$2" >>"$WORK/files/body"
  s3 -o /dev/null -w '%{http_code}' -T "$WORK/files/body" "$URL/$B/$1" >/dev/null
}
get() { # key -> trailing content or the HTTP code
  local code
  code=$(s3 -o "$WORK/files/got" -w '%{http_code}' "$URL/$B/$1")
  if [ "$code" = 200 ]; then tail -c 16 "$WORK/files/got" | tr -d x; else echo "HTTP $code"; fi
}
in_pool() { [ -e "$WORK/$1/d9/$B/$2/xl.meta" ]; }
online() { "$MC" admin info l --json | grep -o '"state":"[a-z]*"' | sort | uniq -c | tr '\n' ' '; }

P1="$WORK/p1/d{1...16}"; P2="$WORK/p2/d{1...16}"
start "$P1"
"$MC" alias set l "$URL" $USER $PASS >/dev/null
"$MC" mb -q l/$B
"$MC" mb -q l/vbkt && "$MC" version enable l/vbkt >/dev/null
for k in key-single key-multi; do put $k older; done
B=vbkt put key-marker older
stop
start "$P1" "$P2"

for k in key-single key-multi; do
  for i in $(seq 1 30); do
    put $k "newest-$i"
    if in_pool p2 $k; then echo "$k: newest-$i is in p2 after $i overwrite(s); p1 holds the older copy"; break; fi
  done
  in_pool p1 $k && in_pool p2 $k || { echo "$k: no copies in both pools"; exit 1; }
  echo "$k: GET -> $(get $k)"
done
for i in $(seq 1 30); do
  B=vbkt put key-marker "newest-$i"
  if [ -e "$WORK/p2/d9/vbkt/key-marker/xl.meta" ]; then echo "vbkt/key-marker: version newest-$i is in p2, older versions in p1"; break; fi
done

for d in $(seq 1 8); do mv "$WORK/p1/d$d" "$WORK/p1/d$d.off"; done
sleep 5
echo "drives: $(online)"
echo "key-single: DELETE -> HTTP $(s3 -o /dev/null -w '%{http_code}' -X DELETE "$URL/$B/key-single")"
out=$("$MC" rm l/$B/key-multi 2>&1); rc=$?
echo "key-multi: mc rm -> exit $rc: $(printf '%s' "$out" | tail -1)"
echo "vbkt/key-marker: DELETE -> HTTP $(s3 -o /dev/null -w '%{http_code}' -X DELETE "$URL/vbkt/key-marker")"
for d in $(seq 1 8); do mv "$WORK/p1/d$d.off" "$WORK/p1/d$d"; done
sleep 5
echo "drives back: $(online)"
for k in key-single key-multi; do echo "$k: GET -> $(get $k)"; done
echo "vbkt/key-marker: GET -> $(B=vbkt get key-marker), versions: $("$MC" ls --versions l/vbkt/key-marker | wc -l | tr -d ' ')"

echo "retry: DELETE key-single -> HTTP $(s3 -o /dev/null -w '%{http_code}' -X DELETE "$URL/$B/key-single"), mc rm key-multi -> exit $("$MC" rm -q l/$B/key-multi >/dev/null 2>&1; echo $?)"
for k in key-single key-multi; do echo "$k: GET -> $(get $k)"; done

Context

Copies of an object without versions in two pools are common on SILO. On a two-pool test server, two sequential PUTs left copies in both pools for 31 of 50 keys. Any delete that fails in the pool of an older copy then brings that copy back. With a multi-object delete this happens silently: the client sees success, and an application that deleted data finds an older version of it.

Regression

No. deleteObjectFromAllPools, the DeleteObjects merge and the marker loop come from upstream MinIO.

Your Environment

  • Version used (silo --version): main at b91e1c6f2, built from source
  • Server setup and configuration: one node, two pools of 16 local directories, MINIO_STORAGE_CLASS_STANDARD=EC:8, MINIO_CI_CD=1
  • Operating System and version (uname -a): macOS (Darwin 27.0.0, arm64); mc RELEASE.2025-07-21T05-28-08Z

Activity

  1. moved this from Backlog to In progress in Siloon Oct 23, 2026
  2. moved this from In progress to Done in Siloon Oct 24, 2026
  3. added
    bug
    on Oct 27, 2026
  4. added this to the 20261026 milestone on Oct 27, 2026
  5. added theissue type on Oct 27, 2026
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

    bug

    Type

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions