[#248] metabase: Remove storage group bucket

Backwards compatible change, so no version increase.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-04-25 09:48:24 +03:00
parent 586f5986bc
commit a9c4ba62c3
14 changed files with 8 additions and 122 deletions

View file

@ -157,11 +157,6 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
err = putBig(db, ts)
require.NoError(t, err)
sg := testutil.GenerateObjectWithCID(cnr)
sg.SetType(objectSDK.TypeStorageGroup)
err = putBig(db, sg)
require.NoError(t, err)
leftChild := testutil.GenerateObjectWithCID(cnr)
leftChild.InitRelations()
err = putBig(db, leftChild)
@ -210,7 +205,6 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
testSelect(t, db, cnr, fs,
object.AddressOf(small),
object.AddressOf(ts),
object.AddressOf(sg),
object.AddressOf(leftChild),
object.AddressOf(rightChild),
object.AddressOf(link),
@ -237,7 +231,6 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeRegular.String(), objectSDK.MatchStringNotEqual)
testSelect(t, db, cnr, fs,
object.AddressOf(ts),
object.AddressOf(sg),
object.AddressOf(lock),
)
@ -259,29 +252,6 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
object.AddressOf(rightChild),
object.AddressOf(link),
object.AddressOf(parent),
object.AddressOf(sg),
object.AddressOf(lock),
)
fs = objectSDK.SearchFilters{}
fs.AddFilter(v2object.FilterHeaderObjectType, "", objectSDK.MatchNotPresent)
testSelect(t, db, cnr, fs)
})
t.Run("storage group objects", func(t *testing.T) {
fs := objectSDK.SearchFilters{}
fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeStorageGroup.String(), objectSDK.MatchStringEqual)
testSelect(t, db, cnr, fs, object.AddressOf(sg))
fs = objectSDK.SearchFilters{}
fs.AddFilter(v2object.FilterHeaderObjectType, v2object.TypeStorageGroup.String(), objectSDK.MatchStringNotEqual)
testSelect(t, db, cnr, fs,
object.AddressOf(small),
object.AddressOf(leftChild),
object.AddressOf(rightChild),
object.AddressOf(link),
object.AddressOf(parent),
object.AddressOf(ts),
object.AddressOf(lock),
)
@ -313,7 +283,6 @@ func TestDB_SelectRootPhyParent(t *testing.T) {
testSelect(t, db, cnr, fs,
object.AddressOf(small),
object.AddressOf(ts),
object.AddressOf(sg),
object.AddressOf(leftChild),
object.AddressOf(rightChild),
object.AddressOf(link),
@ -550,11 +519,6 @@ func TestDB_SelectObjectID(t *testing.T) {
err = putBig(db, ts)
require.NoError(t, err)
sg := testutil.GenerateObjectWithCID(cnr)
sg.SetType(objectSDK.TypeStorageGroup)
err = putBig(db, sg)
require.NoError(t, err)
lock := testutil.GenerateObjectWithCID(cnr)
lock.SetType(objectSDK.TypeLock)
err = putBig(db, lock)
@ -576,7 +540,6 @@ func TestDB_SelectObjectID(t *testing.T) {
testSelect(t, db, cnr, fs,
object.AddressOf(regular),
object.AddressOf(parent),
object.AddressOf(sg),
object.AddressOf(ts),
object.AddressOf(lock),
)
@ -593,7 +556,6 @@ func TestDB_SelectObjectID(t *testing.T) {
fs.AddObjectIDFilter(objectSDK.MatchStringNotEqual, id)
testSelect(t, db, cnr, fs,
object.AddressOf(parent),
object.AddressOf(sg),
object.AddressOf(ts),
object.AddressOf(lock),
)
@ -611,24 +573,6 @@ func TestDB_SelectObjectID(t *testing.T) {
testSelect(t, db, cnr, fs,
object.AddressOf(regular),
object.AddressOf(parent),
object.AddressOf(sg),
object.AddressOf(lock),
)
})
t.Run("storage group objects", func(t *testing.T) {
id, _ := sg.ID()
fs := objectSDK.SearchFilters{}
fs.AddObjectIDFilter(objectSDK.MatchStringEqual, id)
testSelect(t, db, cnr, fs, object.AddressOf(sg))
fs = objectSDK.SearchFilters{}
fs.AddObjectIDFilter(objectSDK.MatchStringNotEqual, id)
testSelect(t, db, cnr, fs,
object.AddressOf(regular),
object.AddressOf(parent),
object.AddressOf(ts),
object.AddressOf(lock),
)
})
@ -644,7 +588,6 @@ func TestDB_SelectObjectID(t *testing.T) {
fs.AddObjectIDFilter(objectSDK.MatchStringNotEqual, id)
testSelect(t, db, cnr, fs,
object.AddressOf(regular),
object.AddressOf(sg),
object.AddressOf(ts),
object.AddressOf(lock),
)
@ -662,7 +605,6 @@ func TestDB_SelectObjectID(t *testing.T) {
testSelect(t, db, cnr, fs,
object.AddressOf(regular),
object.AddressOf(parent),
object.AddressOf(sg),
object.AddressOf(ts),
)
})