[#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 7 additions and 5 deletions

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