* topology: stop a grow once a delete fences its collection
A grow request creates its volumes one after another and resolves the
collection by name for each, so once the collection was deleted the rest of
the request recreated it. The request now keeps the collection it started
in and holds a per-collection fence shared while it creates each volume. A
delete can raise the fence exclusively, which waits out the volume in
flight, and the request stops at its next volume. A collection dropped only
because its last layout emptied is followed to the one published under its
name.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: fence volume growth before deleting a collection
The delete listed the collection's servers, fanned out DeleteCollection, and
only then dropped the collection from the topology. A grow still running
created its next volumes during or after the fan-out, on servers that had
already been cleaned or were not in the list, and those volumes registered a
new layout for the deleted collection that nothing removed. A bucket deleted
right after its first write leaked most of its initial volumes this way.
The delete now raises the collection's growth fence first, so the volume in
flight registers and is deleted with the rest, and the grow stops. A failed
fan-out lifts the fence, since the collection stays in place.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: refuse assigns from a collection being deleted
The delete waits for the volume a grow is creating before it lists the
collection's servers, and the collection's writable volumes stayed
assignable meanwhile, so a write could land in a volume about to be
deleted. The delete now raises the fence before it waits, and assigns
check it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: list only collections that hold a volume layout
A grow request publishes its collection before its first volume
registers, so one that created nothing left a collection with no
volume in the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: queue no grow for a collection being deleted
PickForWrite returned the layout's shouldGrow before it checked the
fence, so an assign on an empty layout of a collection being deleted
still queued a grow. That grow could run after the delete finished and
recreate the collection. Check the fence right after the pick, before
any early return.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: keep an emptied collection published while growth holds it
DeleteLayout unpublished a collection as soon as its last layout
emptied, even while a grow held it or a delete had fenced it. The
volume in flight then registered by name into a new collection that
the delete never listed servers for, and the delete's final
DeleteCollection dropped it from the topology while it stayed on disk.
Unpublish an empty collection only when no grow or delete holds it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: fence the collection still published under the name
An emptied-layout cleanup that passed its fence check could unpublish the
collection while the delete waited to fence it. The delete then fenced and
listed an orphaned object, while growth published a new collection under
the name that no fence held. Topology.FenceGrowth re-checks publication
once the fence is up and moves to the collection published since.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: run one delete of a collection at a time
Two deletes of one collection both fenced it and fanned out by name. Once
the first removed it, a write could recreate the collection, and the
second delete removed the new one's volumes and topology entry.
FenceGrowth now waits for a delete already running on the collection and
finds nothing once that delete removed it; a delete that failed hands
the collection to the one waiting.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: stop a delete another delete beat to the collection
A delete that fenced the collection but had not yet checked that it was
still published retried when it was not, for the collection an emptied
layout drops. A delete that removed it in between also left it
unpublished, so the retry fenced and returned the collection a write had
recreated under the name since. finish(true) now marks the collection
deleted before it unpublishes it, and the retry stops at that mark.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* master: keep the name fenced through the EC pass of a delete
The normal pass unpublished the collection and let growth back in before
the EC pass ran. The EC pass deletes by name on every server holding the
collection's shards, and DeleteCollection on a server also drops its
normal volumes, so a write recreating the bucket in between could land a
volume that the EC pass then deleted. A second delete of the name, finding
no collection, also ran its own EC pass by name.
deleteCollection now fences the name once, before either pass, and lifts
or ends the fence after both. finish(true) unpublishes the collection then.
A name with EC shards only gets an empty collection to fence, so an assign
under it is refused too, and a delete that finds nothing skips both passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: wait for the second delete's lock instead of sleeping
The overlapping-delete tests slept before acting on the first delete. A
second delete scheduled late started after the collection was replaced, or
after the first delete was already over, so the tests could fail or pass
without the overlap they check. They now wait until the second delete is
blocked on the delete lock, read from the goroutine stacks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* topology: empty the layout through UnRegisterVolumeLayout in the test
The test called DeleteLayout, whose signature differs in builds that key
layouts by more than replication, TTL and disk type. UnRegisterVolumeLayout
reaches the same cleanup from a VolumeInfo and has one signature everywhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>