mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
docs(gc): document permanent copy claims and W2 capture integration
This commit is contained in:
1 parent
4e54d2cfe8
commit
82a73daff1
1 file changed
+9
-3
@@ -1,8 +1,8 @@
|
||||
# Chunk garbage collection (W5, library slice)
|
||||
|
||||
`NewCollector(catalog, blobDeleter, config).Run(ctx)` traces every volume returned by the catalog, every HEAD, every snapshot (including deleting snapshots), and every live upload/copy intent. Use a deadline-bound context. Supply `IssuedEpoch` from the authoritative blockmaster reader, not lease expiry or a host-local projection. There is no automatic scheduler or destructive CLI in this slice.
|
||||
`NewCollector(catalog, blobDeleter, config).Run(ctx)` traces every volume returned by the catalog, every HEAD, every snapshot (including unnamed attempt entries), and every live upload/copy intent. Use a deadline-bound context. Supply `IssuedEpoch` from the authoritative blockmaster reader, not lease expiry or a host-local projection. There is no automatic scheduler or destructive CLI in this slice.
|
||||
|
||||
A capture intent can expire only when its age strictly exceeds IntentTTL, the blockmaster has issued a higher epoch, and the actual remote HEAD has advanced to a higher epoch no greater than the issued one. Unknown authority retains it. Snapshot/fork copy intents are retained until the operation settles: their exclusive creates are not fenced by the remote HEAD epoch. This is intentionally conservative pending a shared publication fence for those operations.
|
||||
A capture intent can expire only when its age strictly exceeds IntentTTL, the blockmaster has issued a higher epoch, and the actual remote HEAD has advanced to a higher epoch no greater than the issued one. Unknown authority retains it. Snapshot/fork copy intents never expire by epoch. `SweepCopies(ctx)` may settle an attempt past its recorded deadline only by claiming its final immutable publication target through Catalog.AbortSnapshot/AbortFork. Snapshot targets are `snaps/<name>/<attempt>`; fork targets are HEAD, never VOLUME. A confirmed permanent aborted target or a validated published target settles the intent. Unknown claim/read retains it. The deadline admits a claim but never by itself releases protection. Old copy intents without deadline metadata remain protected.
|
||||
|
||||
An immutable binding becomes a candidate only when its creation time is strictly older than Grace and no root names it. Reclamation requires another successful mark at least Grace after its first observation with the same binding bytes. A rooted candidate is forgotten; failed marks and collector restart discard coverage. Grace must exceed the catalog operation deadline plus the measured mark duration. Backward clock movement refuses the pass.
|
||||
|
||||
@@ -12,7 +12,7 @@ Unbound needles (upload succeeded but key binding never persisted) are RETAINED.
|
||||
|
||||
## Scope and follow-ups
|
||||
|
||||
This first Draft implements the GC core and the real Capture/intent/HEAD caller regression. Retention (newest N plus logarithmic age buckets), removal of deleting snapshots, workspace tombstoning, CLI scheduling and a concrete blockmaster client binding remain follow-up W5 slices. Deleting snapshots continue to root their data until the catalog actually removes them. This is safe retention, not complete workspace lifecycle acceptance.
|
||||
This first Draft implements the GC core and the real Capture/intent/HEAD caller regression. Retention (newest N plus logarithmic age buckets), workspace tombstoning, CLI scheduling and a concrete blockmaster client binding remain follow-up W5 slices. Unnamed deleting snapshot attempts root their keys until their deleting timestamp is older than grace; normal two-mark/upload-age admission still applies afterward. The immutable attempt record is never removed, even after reclaim. Active unnamed attempts remain roots. This is not complete workspace lifecycle acceptance.
|
||||
|
||||
## Lock order
|
||||
|
||||
@@ -21,3 +21,9 @@ The new Collector mutex serializes its own passes and candidate state; it never
|
||||
## Evidence boundary
|
||||
|
||||
The assertion RED is an initial GC candidate that already implemented HEAD/snapshot tracing and two marks but omitted intent roots; the base has no GC API to test. It is NOT claimed as a GC bug reproduced on unmodified main. The same test holds the shipping Capture before CAS after real immutable uploads, runs two GC marks, resumes CAS, and reads exact bytes through ChunkRemote. Filer/needle services are deterministic adapters; no SeaweedFS process, hardware, lab or cloud acceptance is claimed.
|
||||
|
||||
## Copy-sweep integration
|
||||
|
||||
The follow-up branch merges W2 #119 b51713e with #117 5f010ca (the #121 parent). The sole capture conflict keeps #117's pre-upload intent list and cleanup semantics, and retains #119's typed `ErrChunkRemoteUnavailable` wrapper on upload failure. No capture intent is swept through the copy protocol. Name reuse creates a new snapshot attempt; permanent old attempt tombstones continue refusing late old inserts. Volume IDs cannot be reused.
|
||||
|
||||
The first copy-sweep RED uses the prior retain-forever behavior (a no-op SweepCopies seam), not a claimed bug on an unmodified main. The same real Catalog caller turns GREEN with permanent-target claims. Tests cover a pending snapshot across name reuse, a fork with VOLUME already present and HEAD held, published unnamed/deleting attempts, unknown claim recovery, and the retained stalled-Capture case. Deterministic remote services only; no lab/cloud actions.
|
||||
Reference in new issue
Block a user