From 0dc7013844799dc77b43305afca716b0a6ddb9fc Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 9 Nov 2023 13:33:03 +0300 Subject: [PATCH 1/2] [#796] policer: Fix tombstone objects replication Tombstone objects must be replicated to all container nodes. Signed-off-by: Dmitrii Stepanov --- pkg/services/policer/check.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index c04273468..4f51ab832 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -92,10 +92,10 @@ func (p *Policer) processNodes(ctx context.Context, requirements *placementRequi // Number of copies that are stored on maintenance nodes. var uncheckedCopies int - if typ == objectSDK.TypeLock { - // all nodes of a container must store the `LOCK` objects + if typ == objectSDK.TypeLock || typ == objectSDK.TypeTombstone { + // all nodes of a container must store the `LOCK` and `TOMBSTONE` objects // for correct object removal protection: - // - `LOCK` objects are broadcast on their PUT requests; + // - `LOCK` and `TOMBSTONE` objects are broadcast on their PUT requests; // - `LOCK` object removal is a prohibited action in the GC. shortage = uint32(len(nodes)) } -- 2.45.2 From 3131c3e3d5e155e099c59fc6fde3cfbb88c4c809 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 9 Nov 2023 13:33:59 +0300 Subject: [PATCH 2/2] [#796] cli: Fix object nodes command Tombstone objects must be present on all container nodes. Signed-off-by: Dmitrii Stepanov # Conflicts: # cmd/frostfs-cli/modules/object/nodes.go # # It looks like you may be committing a cherry-pick. # If this is not correct, please run # git update-ref -d CHERRY_PICK_HEAD # and try again. # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Thu Nov 9 13:33:59 2023 +0300 # # On branch fix/zombie_object_supportv037 # You are currently cherry-picking commit 78cfb6ae. # # Changes to be committed: # modified: cmd/frostfs-cli/modules/object/nodes.go # --- cmd/frostfs-cli/modules/object/nodes.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cmd/frostfs-cli/modules/object/nodes.go b/cmd/frostfs-cli/modules/object/nodes.go index 5499e5eec..70a3eb75f 100644 --- a/cmd/frostfs-cli/modules/object/nodes.go +++ b/cmd/frostfs-cli/modules/object/nodes.go @@ -31,10 +31,10 @@ const ( ) type objectNodesInfo struct { - containerID cid.ID - objectID oid.ID - relatedObjectIDs []oid.ID - isLock bool + containerID cid.ID + objectID oid.ID + relatedObjectIDs []oid.ID + isLockOrTombstone bool } type boolError struct { @@ -101,9 +101,9 @@ func getObjectInfo(cmd *cobra.Command, cnrID cid.ID, objID oid.ID, cli *client.C res, err := internalclient.HeadObject(cmd.Context(), prmHead) if err == nil { return &objectNodesInfo{ - containerID: cnrID, - objectID: objID, - isLock: res.Header().Type() == objectSDK.TypeLock, + containerID: cnrID, + objectID: objID, + isLockOrTombstone: res.Header().Type() == objectSDK.TypeLock || res.Header().Type() == objectSDK.TypeTombstone, } } @@ -191,7 +191,7 @@ func getRequiredPlacement(cmd *cobra.Command, objInfo *objectNodesInfo, placemen numOfReplicas := placementPolicy.ReplicaNumberByIndex(repIdx) var nodeIdx uint32 for _, n := range rep { - if !objInfo.isLock && nodeIdx == numOfReplicas { //lock object should be on all container nodes + if !objInfo.isLockOrTombstone && nodeIdx == numOfReplicas { // lock and tombstone objects should be on all container nodes break } nodes[n.Hash()] = n @@ -213,7 +213,8 @@ func getRequiredPlacement(cmd *cobra.Command, objInfo *objectNodesInfo, placemen } func getActualPlacement(cmd *cobra.Command, netmap *netmapSDK.NetMap, requiredPlacement map[uint64]netmapSDK.NodeInfo, - pk *ecdsa.PrivateKey, objInfo *objectNodesInfo) map[uint64]boolError { + pk *ecdsa.PrivateKey, objInfo *objectNodesInfo, +) map[uint64]boolError { result := make(map[uint64]boolError) resultMtx := &sync.Mutex{} -- 2.45.2