Compare commits

...

4 commits

Author SHA1 Message Date
77866f6715 [#1213] engine: Drop unused
All checks were successful
DCO action / DCO (pull_request) Successful in 4m15s
Vulncheck / Vulncheck (pull_request) Successful in 4m37s
Build / Build Components (1.21) (pull_request) Successful in 5m8s
Build / Build Components (1.22) (pull_request) Successful in 5m1s
Tests and linters / gopls check (pull_request) Successful in 5m23s
Tests and linters / Staticcheck (pull_request) Successful in 6m6s
Tests and linters / Lint (pull_request) Successful in 7m30s
Pre-commit hooks / Pre-commit (pull_request) Successful in 9m10s
Tests and linters / Tests (1.21) (pull_request) Successful in 10m32s
Tests and linters / Tests with -race (pull_request) Successful in 10m32s
Tests and linters / Tests (1.22) (pull_request) Successful in 11m10s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-06-28 22:36:29 +03:00
287a2431b7 [#1213] cli: Do not allow to lock EC chunks
Some checks failed
DCO action / DCO (pull_request) Successful in 17m11s
Vulncheck / Vulncheck (pull_request) Successful in 21m23s
Build / Build Components (1.21) (pull_request) Successful in 21m45s
Build / Build Components (1.22) (pull_request) Successful in 22m16s
Tests and linters / Tests (1.21) (pull_request) Failing after 25m46s
Tests and linters / gopls check (pull_request) Successful in 25m37s
Tests and linters / Tests (1.22) (pull_request) Failing after 26m20s
Tests and linters / Lint (pull_request) Successful in 28m14s
Tests and linters / Tests with -race (pull_request) Failing after 28m2s
Tests and linters / Staticcheck (pull_request) Successful in 27m56s
Pre-commit hooks / Pre-commit (pull_request) Successful in 28m33s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-06-28 18:04:18 +03:00
6a91df9138 [#1213] deleteSvc: Do not allow to delete EC chunks
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-06-28 18:04:18 +03:00
ede990af39 [#1213] fmt: Drop unused interfaces
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2024-06-28 18:04:18 +03:00
4 changed files with 10 additions and 36 deletions

View file

@ -354,7 +354,7 @@ func collectObjectRelatives(cmd *cobra.Command, cli *client.Client, cnr cid.ID,
Prepare(cmd, &prmHead)
_, err := internal.HeadObject(cmd.Context(), prmHead)
o, err := internal.HeadObject(cmd.Context(), prmHead)
var errSplit *objectSDK.SplitInfoError
var errEC *objectSDK.ECInfoError
@ -364,6 +364,9 @@ func collectObjectRelatives(cmd *cobra.Command, cli *client.Client, cnr cid.ID,
commonCmd.ExitOnErr(cmd, "failed to get raw object header: %w", err)
case err == nil:
common.PrintVerbose(cmd, "Raw header received - object is singular.")
if ech := o.Header().ECHeader(); ech != nil {
commonCmd.ExitOnErr(cmd, "Lock EC chunk failed: %w", errors.ErrUnsupported)
}
return nil
case errors.As(err, &errSplit):
common.PrintVerbose(cmd, "Split information received - object is virtual.")

View file

@ -14,7 +14,6 @@ import (
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/netmap"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/util/logger"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/acl"
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
frostfsecdsa "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/crypto/ecdsa"
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
@ -41,30 +40,12 @@ type cfg struct {
verifyTokenIssuer bool
}
// DeleteHandler is an interface of delete queue processor.
type DeleteHandler interface {
// DeleteObjects places objects to a removal queue.
//
// Returns apistatus.LockNonRegularObject if at least one object
// is locked.
DeleteObjects(oid.Address, ...oid.Address) error
}
// LockSource is a source of lock relations between the objects.
type LockSource interface {
// IsLocked must clarify object's lock status.
IsLocked(ctx context.Context, address oid.Address) (bool, error)
}
// Locker is an object lock storage interface.
type Locker interface {
// Lock list of objects as locked by locker in the specified container.
//
// Returns apistatus.LockNonRegularObject if at least object in locked
// list is irregular (not type of REGULAR).
Lock(idCnr cid.ID, locker oid.ID, locked []oid.ID) error
}
var errNilObject = errors.New("object is nil")
var errNilID = errors.New("missing identifier")

View file

@ -151,18 +151,3 @@ func Head(ctx context.Context, storage *StorageEngine, addr oid.Address) (*objec
return res.Header(), nil
}
// HeadRaw reads object header from local storage by provided address and raw
// flag.
func HeadRaw(ctx context.Context, storage *StorageEngine, addr oid.Address, raw bool) (*objectSDK.Object, error) {
var headPrm HeadPrm
headPrm.WithAddress(addr)
headPrm.WithRaw(raw)
res, err := storage.Head(ctx, headPrm)
if err != nil {
return nil, err
}
return res.Header(), nil
}

View file

@ -17,6 +17,8 @@ import (
"go.uber.org/zap"
)
var errDeleteECChunk = errors.New("invalid operation: delete EC object chunk")
type execCtx struct {
svc *Service
@ -66,13 +68,16 @@ func (exec *execCtx) newAddress(id oid.ID) oid.Address {
}
func (exec *execCtx) formExtendedInfo(ctx context.Context) error {
_, err := exec.svc.header.head(ctx, exec)
obj, err := exec.svc.header.head(ctx, exec)
var errSplitInfo *objectSDK.SplitInfoError
var errECInfo *objectSDK.ECInfoError
switch {
case err == nil:
if ech := obj.ECHeader(); ech != nil {
return errDeleteECChunk
}
return nil
case errors.As(err, &errSplitInfo):
exec.splitInfo = errSplitInfo.SplitInfo()