diff options
| author | 2026-06-07 18:17:40 +0000 | |
|---|---|---|
| committer | 2026-06-07 18:17:40 +0000 | |
| commit | b25adcf0dee726cadc7c41695b3fc2b69a025882 (patch) | |
| tree | 0a76d99f89528a4ec00a03baf1c9d31a5a8f5494 /object/store | |
| parent | REFACTOR: Remove signed (diff) | |
| signature | No signature | |
object/store: Add coordinated quarantiner
Diffstat (limited to 'object/store')
| -rw-r--r-- | object/store/quarantiner.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/object/store/quarantiner.go b/object/store/quarantiner.go index 45c3a1c8..19fbdc0c 100644 --- a/object/store/quarantiner.go +++ b/object/store/quarantiner.go @@ -8,6 +8,12 @@ type QuarantineBase interface { // Promote publishes quarantined writes into their final destination. // + // Promote is not atomic. + // Because objects are content-addressed and immutable, + // a partial promotion is safe: + // it only makes some objects visible early, + // which is harmless until a ref references them. + // // Promote invalidates the receiver. Promote() error @@ -48,3 +54,23 @@ type PackQuarantineOptions struct{} type PackQuarantiner interface { BeginPackQuarantine(opts PackQuarantineOptions) (PackQuarantine, error) } + +// CoordinatedQuarantineOptions controls the options +// for one coordinated quarantine creation. +type CoordinatedQuarantineOptions struct { + Object ObjectQuarantineOptions + Pack PackQuarantineOptions +} + +// CoordinatedQuarantiner creates coordinated quarantines +// that accept both object-wise and pack-wise writes +// behind a single Promote/Discard. +// +// The returned quarantine is usable +// anywhere either split quarantine is expected. +type CoordinatedQuarantiner interface { + BeginCoordinatedQuarantine(opts CoordinatedQuarantineOptions) (interface { + ObjectQuarantine + PackQuarantine + }, error) +} |
