RG3: the registry purges a deleted chunk's leftovers
Every delete of a chunk in the incoming object store is followed by the runtime's purge of what it left (busstate.Objects.Purge), so the store's kept descriptions equal its live objects; a failed purge is said. Builds: design 47 H2 §813 (8); H-A-227, H-A-366
This commit is contained in:
@@ -46,8 +46,13 @@ func stepErr(bound time.Duration, what string, f func() error) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// boundedObjects is the incoming object store with each operation bounded and logged.
|
||||
type boundedObjects struct{ parts.Objects }
|
||||
// boundedObjects is the incoming object store with each operation bounded and logged. Purge is the store's purge of a
|
||||
// deleted object's chunks (busstate.Objects.Purge): every delete of a chunk is followed by it, so what a delete left
|
||||
// behind is dropped and the store's kept descriptions equal its live objects (design 47 H2 §813 (8); H-A-227, H-A-366).
|
||||
type boundedObjects struct {
|
||||
parts.Objects
|
||||
Purge func(name string) error
|
||||
}
|
||||
|
||||
func (b boundedObjects) Used() (uint64, error) {
|
||||
return step(stepBound, "the incoming object store's fill (objects)", b.Objects.Used)
|
||||
@@ -59,7 +64,15 @@ func (b boundedObjects) Get(name string) ([]byte, error) {
|
||||
return step(stepBound, "the get of a chunk from the incoming object store (objects)", func() ([]byte, error) { return b.Objects.Get(name) })
|
||||
}
|
||||
func (b boundedObjects) Delete(name string) error {
|
||||
return stepErr(stepBound, "the delete of a chunk in the incoming object store (objects)", func() error { return b.Objects.Delete(name) })
|
||||
err := stepErr(stepBound, "the delete of a chunk in the incoming object store (objects)", func() error { return b.Objects.Delete(name) })
|
||||
if b.Purge == nil {
|
||||
return err
|
||||
}
|
||||
perr := stepErr(stepBound, "the purge of a deleted chunk's leftovers in the incoming object store (objects)", func() error { return b.Purge(name) })
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return perr
|
||||
}
|
||||
|
||||
// boundedTransfers is the transfers state with its reads and writes bounded and logged.
|
||||
|
||||
Reference in New Issue
Block a user