[#1412] metabase: Drop logging inside transaction
All checks were successful
DCO action / DCO (pull_request) Successful in 1m13s
Tests and linters / Run gofumpt (pull_request) Successful in 1m29s
Vulncheck / Vulncheck (pull_request) Successful in 2m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m10s
Build / Build Components (pull_request) Successful in 2m22s
Tests and linters / gopls check (pull_request) Successful in 2m36s
Tests and linters / Staticcheck (pull_request) Successful in 3m14s
Tests and linters / Lint (pull_request) Successful in 3m31s
Tests and linters / Tests (pull_request) Successful in 4m16s
Tests and linters / Tests with -race (pull_request) Successful in 5m55s
All checks were successful
DCO action / DCO (pull_request) Successful in 1m13s
Tests and linters / Run gofumpt (pull_request) Successful in 1m29s
Vulncheck / Vulncheck (pull_request) Successful in 2m0s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m10s
Build / Build Components (pull_request) Successful in 2m22s
Tests and linters / gopls check (pull_request) Successful in 2m36s
Tests and linters / Staticcheck (pull_request) Successful in 3m14s
Tests and linters / Lint (pull_request) Successful in 3m31s
Tests and linters / Tests (pull_request) Successful in 4m16s
Tests and linters / Tests with -race (pull_request) Successful in 5m55s
This could lead to hang the db. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
fe9f664b57
commit
c065d55ca3
2 changed files with 2 additions and 35 deletions
|
@ -226,12 +226,6 @@ const (
|
||||||
EngineFinishedSuccessfullyShardsEvacuation = "shards evacuation finished successfully"
|
EngineFinishedSuccessfullyShardsEvacuation = "shards evacuation finished successfully"
|
||||||
EngineFinishedWithErrorShardsEvacuation = "shards evacuation finished with error"
|
EngineFinishedWithErrorShardsEvacuation = "shards evacuation finished with error"
|
||||||
EngineObjectIsMovedToAnotherShard = "object is moved to another shard"
|
EngineObjectIsMovedToAnotherShard = "object is moved to another shard"
|
||||||
MetabaseMissingMatcher = "missing matcher"
|
|
||||||
MetabaseErrorInFKBTSelection = "error in FKBT selection"
|
|
||||||
MetabaseCantDecodeListBucketLeaf = "can't decode list bucket leaf"
|
|
||||||
MetabaseUnknownOperation = "unknown operation"
|
|
||||||
MetabaseCantIterateOverTheBucket = "can't iterate over the bucket"
|
|
||||||
MetabaseCouldNotIterateOverTheBuckets = "could not iterate over the buckets"
|
|
||||||
MetabaseCreatedDirectoryForMetabase = "created directory for Metabase"
|
MetabaseCreatedDirectoryForMetabase = "created directory for Metabase"
|
||||||
MetabaseOpenedBoltDBInstanceForMetabase = "opened boltDB instance for Metabase"
|
MetabaseOpenedBoltDBInstanceForMetabase = "opened boltDB instance for Metabase"
|
||||||
MetabaseCheckingMetabaseVersion = "checking metabase version"
|
MetabaseCheckingMetabaseVersion = "checking metabase version"
|
||||||
|
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
v2object "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/internal/logs"
|
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/metaerr"
|
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/metaerr"
|
||||||
"git.frostfs.info/TrueCloudLab/frostfs-observability/tracing"
|
"git.frostfs.info/TrueCloudLab/frostfs-observability/tracing"
|
||||||
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
|
||||||
|
@ -18,7 +17,6 @@ import (
|
||||||
"go.etcd.io/bbolt"
|
"go.etcd.io/bbolt"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
"go.uber.org/zap"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
@ -288,8 +286,6 @@ func (db *DB) selectFromFKBT(
|
||||||
) { //
|
) { //
|
||||||
matchFunc, ok := db.matchers[f.Operation()]
|
matchFunc, ok := db.matchers[f.Operation()]
|
||||||
if !ok {
|
if !ok {
|
||||||
db.log.Debug(logs.MetabaseMissingMatcher, zap.Stringer("operation", f.Operation()))
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,7 +294,7 @@ func (db *DB) selectFromFKBT(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err := matchFunc.matchBucket(fkbtRoot, f.Header(), f.Value(), func(k, _ []byte) error {
|
_ = matchFunc.matchBucket(fkbtRoot, f.Header(), f.Value(), func(k, _ []byte) error {
|
||||||
fkbtLeaf := fkbtRoot.Bucket(k)
|
fkbtLeaf := fkbtRoot.Bucket(k)
|
||||||
if fkbtLeaf == nil {
|
if fkbtLeaf == nil {
|
||||||
return nil
|
return nil
|
||||||
|
@ -310,9 +306,6 @@ func (db *DB) selectFromFKBT(
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
db.log.Debug(logs.MetabaseErrorInFKBTSelection, zap.String("error", err.Error()))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// selectOutsideFKBT looks into all incl buckets to find list of addresses outside <fkbt> to add in
|
// selectOutsideFKBT looks into all incl buckets to find list of addresses outside <fkbt> to add in
|
||||||
|
@ -377,24 +370,17 @@ func (db *DB) selectFromList(
|
||||||
case objectSDK.MatchStringEqual:
|
case objectSDK.MatchStringEqual:
|
||||||
lst, err = decodeList(bkt.Get(bucketKeyHelper(f.Header(), f.Value())))
|
lst, err = decodeList(bkt.Get(bucketKeyHelper(f.Header(), f.Value())))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
db.log.Debug(logs.MetabaseCantDecodeListBucketLeaf, zap.String("error", err.Error()))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
fMatch, ok := db.matchers[op]
|
fMatch, ok := db.matchers[op]
|
||||||
if !ok {
|
if !ok {
|
||||||
db.log.Debug(logs.MetabaseUnknownOperation, zap.Uint32("operation", uint32(op)))
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = fMatch.matchBucket(bkt, f.Header(), f.Value(), func(_, val []byte) error {
|
if err = fMatch.matchBucket(bkt, f.Header(), f.Value(), func(_, val []byte) error {
|
||||||
l, err := decodeList(val)
|
l, err := decodeList(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
db.log.Debug(logs.MetabaseCantDecodeListBucketLeaf,
|
|
||||||
zap.String("error", err.Error()),
|
|
||||||
)
|
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,10 +388,6 @@ func (db *DB) selectFromList(
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
db.log.Debug(logs.MetabaseCantIterateOverTheBucket,
|
|
||||||
zap.String("error", err.Error()),
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -447,10 +429,6 @@ func (db *DB) selectObjectID(
|
||||||
default:
|
default:
|
||||||
fMatch, ok := db.matchers[op]
|
fMatch, ok := db.matchers[op]
|
||||||
if !ok {
|
if !ok {
|
||||||
db.log.Debug(logs.MetabaseUnknownOperation,
|
|
||||||
zap.Uint32("operation", uint32(f.Operation())),
|
|
||||||
)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -461,18 +439,13 @@ func (db *DB) selectObjectID(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
err := fMatch.matchBucket(bkt, f.Header(), f.Value(), func(k, _ []byte) error {
|
_ = fMatch.matchBucket(bkt, f.Header(), f.Value(), func(k, _ []byte) error {
|
||||||
var id oid.ID
|
var id oid.ID
|
||||||
if err := id.Decode(k); err == nil {
|
if err := id.Decode(k); err == nil {
|
||||||
appendOID(id)
|
appendOID(id)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
db.log.Debug(logs.MetabaseCouldNotIterateOverTheBuckets,
|
|
||||||
zap.String("error", err.Error()),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue