[#243] service/object: Fix object chain assembly for tombstone body

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-11 14:29:31 +03:00
parent 9265e31e65
commit a01262d8bd
5 changed files with 5 additions and 5 deletions

2
go.mod
View file

@ -17,7 +17,7 @@ require (
github.com/multiformats/go-multihash v0.0.13 // indirect
github.com/nspcc-dev/hrw v1.0.9
github.com/nspcc-dev/neo-go v0.91.1-pre.0.20201030072836-71216865717b
github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201211081945-1bc91466aa7b
github.com/nspcc-dev/neofs-api-go v1.20.3-0.20201211114827-2aa51d3add29
github.com/nspcc-dev/neofs-crypto v0.3.0
github.com/nspcc-dev/tzhash v1.4.0
github.com/panjf2000/ants/v2 v2.3.0

BIN
go.sum

Binary file not shown.

View file

@ -137,6 +137,7 @@ func (exec *execCtx) collectChain() bool {
exec.log.Debug("assembling chain...")
for prev := exec.splitInfo.LastPart(); prev != nil; {
chain = append(chain, prev)
prev, err = exec.svc.header.previous(exec, prev)
switch {
@ -154,12 +155,9 @@ func (exec *execCtx) collectChain() bool {
exec.status = statusOK
exec.err = nil
}
chain = append(chain, prev)
}
exec.addMembers(chain)
exec.tombstone.SetSplitID(exec.splitInfo.SplitID())
return true
}

View file

@ -37,6 +37,8 @@ func (exec *execCtx) formTombstone() (ok bool) {
exec.log.Debug("split info successfully formed, collecting members...")
exec.tombstone.SetSplitID(exec.splitInfo.SplitID())
ok = exec.collectMembers()
if !ok {
return

View file

@ -99,7 +99,7 @@ func (w *searchSvcWrapper) splitMembers(exec *execCtx) ([]*objectSDK.ID, error)
return wr.ids, nil
}
func (s simpleIDWriter) WriteIDs(ids []*objectSDK.ID) error {
func (s *simpleIDWriter) WriteIDs(ids []*objectSDK.ID) error {
s.ids = append(s.ids, ids...)
return nil