Fix IsUserObject for ec-splitted objects #1141

Merged
fyrchik merged 3 commits from aarifullin/frostfs-node:feat/ec_userobj into master 2024-09-04 19:51:08 +00:00
Showing only changes of commit 40b04c00ef - Show all commits

View file

@ -527,10 +527,14 @@ func containerObjectCounterInitialized(tx *bbolt.Tx) bool {
} }
func IsUserObject(obj *objectSDK.Object) bool { func IsUserObject(obj *objectSDK.Object) bool {
ech := obj.ECHeader()
if ech == nil {
_, hasParentID := obj.ParentID() _, hasParentID := obj.ParentID()
return obj.Type() == objectSDK.TypeRegular && return obj.Type() == objectSDK.TypeRegular &&
(obj.SplitID() == nil || (obj.SplitID() == nil ||
(hasParentID && len(obj.Children()) == 0)) (hasParentID && len(obj.Children()) == 0))
}
return ech.Index() == 0 && (ech.ParentSplitID() == nil || ech.ParentSplitParentID() != nil)
} }
// ZeroSizeContainers returns containers with size = 0. // ZeroSizeContainers returns containers with size = 0.