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,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) {