[#9999] amd: Adopt zombie scan
to EC objects
Some checks failed
DCO action / DCO (pull_request) Successful in 30s
Vulncheck / Vulncheck (pull_request) Successful in 1m19s
Build / Build Components (pull_request) Successful in 1m48s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m49s
Tests and linters / Tests (pull_request) Successful in 1m59s
Tests and linters / Staticcheck (pull_request) Successful in 2m13s
Tests and linters / gopls check (pull_request) Failing after 2m20s
Tests and linters / Lint (pull_request) Successful in 2m50s
Tests and linters / Tests with -race (pull_request) Successful in 2m49s
Some checks failed
DCO action / DCO (pull_request) Successful in 30s
Vulncheck / Vulncheck (pull_request) Successful in 1m19s
Build / Build Components (pull_request) Successful in 1m48s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m49s
Tests and linters / Tests (pull_request) Successful in 1m59s
Tests and linters / Staticcheck (pull_request) Successful in 2m13s
Tests and linters / gopls check (pull_request) Failing after 2m20s
Tests and linters / Lint (pull_request) Successful in 2m50s
Tests and linters / Tests with -race (pull_request) Successful in 2m49s
Change-Id: Ida3f339bb6e8343519933b60cdc4b544f7a02f1c Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
d54eb9d7ab
commit
e7aa9d7dd6
1 changed files with 13 additions and 7 deletions
|
@ -15,6 +15,7 @@ import (
|
|||
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
|
||||
clientCore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/client"
|
||||
netmapCore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/engine"
|
||||
cntClient "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/container"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/morph/client/netmap"
|
||||
|
@ -102,9 +103,9 @@ const (
|
|||
statusQuarantine status = "quarantine"
|
||||
)
|
||||
|
||||
func checkAddr(ctx context.Context, cnrCli *cntClient.Client, nmCli *netmap.Client, cc *cache.ClientCache, addr oid.Address) (status, error) {
|
||||
func checkAddr(ctx context.Context, cnrCli *cntClient.Client, nmCli *netmap.Client, cc *cache.ClientCache, obj object.Info) (status, error) {
|
||||
rawCID := make([]byte, sha256.Size)
|
||||
cid := addr.Container()
|
||||
cid := obj.Address.Container()
|
||||
cid.Encode(rawCID)
|
||||
|
||||
cnr, err := cnrCli.Get(rawCID)
|
||||
|
@ -127,12 +128,17 @@ func checkAddr(ctx context.Context, cnrCli *cntClient.Client, nmCli *netmap.Clie
|
|||
nodes = append([][]netmap.NodeInfo{}, nm.Nodes())
|
||||
}
|
||||
|
||||
objID := addr.Object()
|
||||
cnrID := addr.Container()
|
||||
objID := obj.Address.Object()
|
||||
cnrID := obj.Address.Container()
|
||||
local := true
|
||||
if obj.ECInfo != nil {
|
||||
objID = obj.ECInfo.ParentID
|
||||
local = false
|
||||
}
|
||||
prm := clientSDK.PrmObjectHead{
|
||||
ObjectID: &objID,
|
||||
ContainerID: &cnrID,
|
||||
Local: true,
|
||||
Local: local,
|
||||
}
|
||||
|
||||
var ni clientCore.NodeInfo
|
||||
|
@ -156,7 +162,7 @@ func checkAddr(ctx context.Context, cnrCli *cntClient.Client, nmCli *netmap.Clie
|
|||
}
|
||||
}
|
||||
|
||||
if cnr.Value.PlacementPolicy().NumberOfReplicas() == 1 && cnr.Value.PlacementPolicy().ReplicaNumberByIndex(0) == 1 {
|
||||
if cnr.Value.PlacementPolicy().NumberOfReplicas() == 1 && cnr.Value.PlacementPolicy().ReplicaDescriptor(0).NumberOfObjects() == 1 {
|
||||
return statusFound, nil
|
||||
}
|
||||
return statusQuarantine, nil
|
||||
|
@ -202,7 +208,7 @@ func scanStorageEngine(cmd *cobra.Command, batchSize uint32, storageEngine *engi
|
|||
for i := range addrList {
|
||||
addr := addrList[i]
|
||||
eg.Go(func() error {
|
||||
result, err := checkAddr(egCtx, cnrCli, nmCli, cc, addr.Address)
|
||||
result, err := checkAddr(egCtx, cnrCli, nmCli, cc, addr)
|
||||
if err != nil {
|
||||
return fmt.Errorf("check object %s status: %w", addr.Address, err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue