Fix IsUserObject
for ec-splitted objects #1141
5 changed files with 12 additions and 8 deletions
4
go.mod
4
go.mod
|
@ -4,10 +4,10 @@ go 1.21
|
|||
|
||||
require (
|
||||
code.gitea.io/sdk/gitea v0.17.1
|
||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240427200446-67c6f305b21f
|
||||
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.16.1-0.20240516133103-0803bc6ded00
|
||||
git.frostfs.info/TrueCloudLab/frostfs-contract v0.19.3-0.20240409111539-e7a05a49ff45
|
||||
git.frostfs.info/TrueCloudLab/frostfs-observability v0.0.0-20231101111734-b3ad3335ff65
|
||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240507063414-99e02858af12
|
||||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240517121628-3de256d05e32
|
||||
git.frostfs.info/TrueCloudLab/hrw v1.2.1
|
||||
git.frostfs.info/TrueCloudLab/policy-engine v0.0.0-20240513163744-1f6f4163d40d
|
||||
git.frostfs.info/TrueCloudLab/tzhash v1.8.0
|
||||
|
|
BIN
go.sum
BIN
go.sum
Binary file not shown.
|
@ -527,11 +527,15 @@ func containerObjectCounterInitialized(tx *bbolt.Tx) bool {
|
|||
}
|
||||
|
||||
func IsUserObject(obj *objectSDK.Object) bool {
|
||||
ech := obj.ECHeader()
|
||||
if ech == nil {
|
||||
_, hasParentID := obj.ParentID()
|
||||
return obj.Type() == objectSDK.TypeRegular &&
|
||||
(obj.SplitID() == nil ||
|
||||
(hasParentID && len(obj.Children()) == 0))
|
||||
}
|
||||
return ech.Index() == 0 && (ech.ParentSplitID() == nil || ech.ParentSplitParentID() != nil)
|
||||
}
|
||||
|
||||
// ZeroSizeContainers returns containers with size = 0.
|
||||
func (db *DB) ZeroSizeContainers(ctx context.Context) ([]cid.ID, error) {
|
||||
|
|
|
@ -266,7 +266,7 @@ func putUniqueIndexes(
|
|||
return err
|
||||
}
|
||||
|
||||
if ecHead := obj.GetECHeader(); ecHead != nil {
|
||||
if ecHead := obj.ECHeader(); ecHead != nil {
|
||||
err = putECInfo(tx, cnr, objKey, ecHead)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
@ -114,7 +114,7 @@ func TestECChunkHasInvalidPlacement(t *testing.T) {
|
|||
chunkObject.SetID(chunkAddress.Object())
|
||||
chunkObject.SetPayload([]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
|
||||
chunkObject.SetPayloadSize(uint64(10))
|
||||
chunkObject.SetECHeader(objectSDK.NewECHeader(parentID, 1, 3, []byte{}, 0))
|
||||
chunkObject.SetECHeader(objectSDK.NewECHeader(parentID, nil, nil, 1, 3, []byte{}, 0))
|
||||
|
||||
var policy netmapSDK.PlacementPolicy
|
||||
require.NoError(t, policy.DecodeString("EC 2.1"))
|
||||
|
|
Loading…
Reference in a new issue