Fix IsUserObject for ec-splitted objects #1141

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:feat/ec_userobj into master 2024-09-04 19:51:08 +00:00

View file

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