forked from TrueCloudLab/frostfs-node
[#1141] metabase: Fix IsUserObject
method
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
89a80e9a0f
commit
40b04c00ef
1 changed files with 8 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue