[#1523] metabase: Remove (*DB).IterateCoveredByTombstones
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 3m15s
DCO action / DCO (pull_request) Successful in 3m26s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m38s
Tests and linters / gopls check (pull_request) Successful in 4m53s
Tests and linters / Lint (pull_request) Successful in 5m16s
Build / Build Components (pull_request) Successful in 5m51s
Vulncheck / Vulncheck (pull_request) Successful in 5m47s
Tests and linters / Staticcheck (pull_request) Successful in 8m3s
Tests and linters / Tests (pull_request) Successful in 9m16s
Tests and linters / Tests with -race (pull_request) Successful in 9m19s
Tests and linters / Run gofumpt (push) Successful in 2m8s
Vulncheck / Vulncheck (push) Successful in 2m41s
Build / Build Components (push) Successful in 3m18s
Tests and linters / Staticcheck (push) Successful in 3m15s
Pre-commit hooks / Pre-commit (push) Successful in 3m49s
Tests and linters / gopls check (push) Successful in 4m14s
Tests and linters / Lint (push) Successful in 4m21s
Tests and linters / Tests (push) Successful in 4m24s
Tests and linters / Tests with -race (push) Successful in 4m36s
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 3m15s
DCO action / DCO (pull_request) Successful in 3m26s
Pre-commit hooks / Pre-commit (pull_request) Successful in 4m38s
Tests and linters / gopls check (pull_request) Successful in 4m53s
Tests and linters / Lint (pull_request) Successful in 5m16s
Build / Build Components (pull_request) Successful in 5m51s
Vulncheck / Vulncheck (pull_request) Successful in 5m47s
Tests and linters / Staticcheck (pull_request) Successful in 8m3s
Tests and linters / Tests (pull_request) Successful in 9m16s
Tests and linters / Tests with -race (pull_request) Successful in 9m19s
Tests and linters / Run gofumpt (push) Successful in 2m8s
Vulncheck / Vulncheck (push) Successful in 2m41s
Build / Build Components (push) Successful in 3m18s
Tests and linters / Staticcheck (push) Successful in 3m15s
Pre-commit hooks / Pre-commit (push) Successful in 3m49s
Tests and linters / gopls check (push) Successful in 4m14s
Tests and linters / Lint (push) Successful in 4m21s
Tests and linters / Tests (push) Successful in 4m24s
Tests and linters / Tests with -race (push) Successful in 4m36s
Remove this method because it isn't used anywhere since 7799f8e4c
.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
parent
00c608c05e
commit
e0ac3a583f
2 changed files with 0 additions and 128 deletions
|
@ -9,7 +9,6 @@ import (
|
|||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil"
|
||||
meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase"
|
||||
objectV2 "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object"
|
||||
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
|
||||
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
oidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id/test"
|
||||
|
@ -67,65 +66,3 @@ func putWithExpiration(t *testing.T, db *meta.DB, typ objectSDK.Type, expiresAt
|
|||
|
||||
return object2.AddressOf(obj)
|
||||
}
|
||||
|
||||
func TestDB_IterateCoveredByTombstones(t *testing.T) {
|
||||
db := newDB(t)
|
||||
defer func() { require.NoError(t, db.Close(context.Background())) }()
|
||||
|
||||
cnr := cidtest.ID()
|
||||
ts := oidtest.Address()
|
||||
protected1 := oidtest.Address()
|
||||
protected2 := oidtest.Address()
|
||||
protectedLocked := oidtest.Address()
|
||||
garbage := oidtest.Address()
|
||||
ts.SetContainer(cnr)
|
||||
protected1.SetContainer(cnr)
|
||||
protected2.SetContainer(cnr)
|
||||
protectedLocked.SetContainer(cnr)
|
||||
|
||||
var prm meta.InhumePrm
|
||||
var err error
|
||||
|
||||
prm.SetAddresses(protected1, protected2, protectedLocked)
|
||||
prm.SetTombstoneAddress(ts)
|
||||
|
||||
_, err = db.Inhume(context.Background(), prm)
|
||||
require.NoError(t, err)
|
||||
|
||||
prm.SetAddresses(garbage)
|
||||
prm.SetGCMark()
|
||||
|
||||
_, err = db.Inhume(context.Background(), prm)
|
||||
require.NoError(t, err)
|
||||
|
||||
var handled []oid.Address
|
||||
|
||||
tss := map[string]oid.Address{
|
||||
ts.EncodeToString(): ts,
|
||||
}
|
||||
|
||||
err = db.IterateCoveredByTombstones(context.Background(), tss, func(addr oid.Address) error {
|
||||
handled = append(handled, addr)
|
||||
return nil
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, handled, 3)
|
||||
require.Contains(t, handled, protected1)
|
||||
require.Contains(t, handled, protected2)
|
||||
require.Contains(t, handled, protectedLocked)
|
||||
|
||||
err = db.Lock(context.Background(), protectedLocked.Container(), oidtest.ID(), []oid.ID{protectedLocked.Object()})
|
||||
require.NoError(t, err)
|
||||
|
||||
handled = handled[:0]
|
||||
|
||||
err = db.IterateCoveredByTombstones(context.Background(), tss, func(addr oid.Address) error {
|
||||
handled = append(handled, addr)
|
||||
return nil
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Len(t, handled, 2)
|
||||
require.NotContains(t, handled, protectedLocked)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue