[#9999] metabase: Do not store root info for small objects
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
2bfaa65455
commit
a62d76fd6f
2 changed files with 5 additions and 13 deletions
|
@ -251,19 +251,11 @@ func putUniqueIndexes(
|
||||||
}
|
}
|
||||||
|
|
||||||
// index root object
|
// index root object
|
||||||
if obj.Type() == objectSDK.TypeRegular && !obj.HasParent() {
|
if obj.Type() == objectSDK.TypeRegular && !obj.HasParent() && isParent {
|
||||||
var (
|
splitInfo, err := si.Marshal()
|
||||||
err error
|
if err != nil {
|
||||||
splitInfo []byte
|
return fmt.Errorf("can't marshal split info: %w", err)
|
||||||
)
|
|
||||||
|
|
||||||
if isParent {
|
|
||||||
splitInfo, err = si.Marshal()
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("can't marshal split info: %w", err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = putUniqueIndexItem(tx, namedBucketItem{
|
err = putUniqueIndexItem(tx, namedBucketItem{
|
||||||
name: rootBucketName(cnr, bucketName),
|
name: rootBucketName(cnr, bucketName),
|
||||||
key: objKey,
|
key: objKey,
|
||||||
|
|
|
@ -194,7 +194,7 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
|
||||||
fs := objectSDK.SearchFilters{}
|
fs := objectSDK.SearchFilters{}
|
||||||
fs.AddRootFilter()
|
fs.AddRootFilter()
|
||||||
testSelect(t, db, cnr, fs,
|
testSelect(t, db, cnr, fs,
|
||||||
object.AddressOf(small),
|
// object.AddressOf(small),
|
||||||
object.AddressOf(parent),
|
object.AddressOf(parent),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue