From 1517b5c6388965fa22fe89305bb43a19b0c35072 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 2 Mar 2022 17:27:40 +0300 Subject: [PATCH] [#346] neofs: Fix belated `updateCRDT2PSetHeaders` call Signed-off-by: Leonard Lyubich --- api/layer/system_object.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/layer/system_object.go b/api/layer/system_object.go index 9bedc52..76f1743 100644 --- a/api/layer/system_object.go +++ b/api/layer/system_object.go @@ -67,6 +67,9 @@ func (n *layer) putSystemObjectIntoNeoFS(ctx context.Context, p *PutSystemObject return nil, err } + idsToDeleteArr := updateCRDT2PSetHeaders(p.Metadata, versions, false) // false means "last write wins" + // note that updateCRDT2PSetHeaders modifies p.Metadata and must be called further processing + prm := PrmObjectCreate{ Container: *p.BktInfo.CID, Creator: *p.BktInfo.Owner, @@ -99,8 +102,6 @@ func (n *layer) putSystemObjectIntoNeoFS(ctx context.Context, p *PutSystemObject return nil, err } - idsToDeleteArr := updateCRDT2PSetHeaders(p.Metadata, versions, false) // false means "last write wins" - for _, id := range idsToDeleteArr { if err = n.objectDelete(ctx, p.BktInfo.CID, id); err != nil { n.log.Warn("couldn't delete system object",