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 {
_, hasParentID := obj.ParentID()
return obj.Type() == objectSDK.TypeRegular &&
(obj.SplitID() == nil ||
(hasParentID && len(obj.Children()) == 0))
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.