forked from TrueCloudLab/frostfs-node
[#796] cli: Fix object nodes command
Tombstone objects must be present on all container nodes. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
0f75e48138
commit
78cfb6aea8
1 changed files with 8 additions and 8 deletions
|
@ -34,7 +34,7 @@ type objectNodesInfo struct {
|
||||||
containerID cid.ID
|
containerID cid.ID
|
||||||
objectID oid.ID
|
objectID oid.ID
|
||||||
relatedObjectIDs []oid.ID
|
relatedObjectIDs []oid.ID
|
||||||
isLock bool
|
isLockOrTombstone bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type boolError struct {
|
type boolError struct {
|
||||||
|
@ -103,7 +103,7 @@ func getObjectInfo(cmd *cobra.Command, cnrID cid.ID, objID oid.ID, cli *client.C
|
||||||
return &objectNodesInfo{
|
return &objectNodesInfo{
|
||||||
containerID: cnrID,
|
containerID: cnrID,
|
||||||
objectID: objID,
|
objectID: objID,
|
||||||
isLock: res.Header().Type() == objectSDK.TypeLock,
|
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)
|
numOfReplicas := placementPolicy.ReplicaNumberByIndex(repIdx)
|
||||||
var nodeIdx uint32
|
var nodeIdx uint32
|
||||||
for _, n := range rep {
|
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
|
break
|
||||||
}
|
}
|
||||||
nodes[n.Hash()] = n
|
nodes[n.Hash()] = n
|
||||||
|
|
Loading…
Reference in a new issue