Index attributes for non-S3 containers #1412

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/metabase_index_some_attr into master 2024-10-26 11:30:27 +00:00
2 changed files with 2 additions and 35 deletions

View file

@ -226,12 +226,6 @@ const (
EngineFinishedSuccessfullyShardsEvacuation = "shards evacuation finished successfully"
EngineFinishedWithErrorShardsEvacuation = "shards evacuation finished with error"
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"
MetabaseOpenedBoltDBInstanceForMetabase = "opened boltDB instance for Metabase"
MetabaseCheckingMetabaseVersion = "checking metabase version"

View file

@ -9,7 +9,6 @@ import (
"time"
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-observability/tracing"
cid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id"
@ -18,7 +17,6 @@ import (
"go.etcd.io/bbolt"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
)
type (
@ -288,8 +286,6 @@ func (db *DB) selectFromFKBT(
) { //
matchFunc, ok := db.matchers[f.Operation()]
if !ok {
db.log.Debug(logs.MetabaseMissingMatcher, zap.Stringer("operation", f.Operation()))
return
}
@ -298,7 +294,7 @@ func (db *DB) selectFromFKBT(
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)
if fkbtLeaf == nil {
return nil
@ -310,9 +306,6 @@ func (db *DB) selectFromFKBT(
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
@ -377,24 +370,17 @@ func (db *DB) selectFromList(
case objectSDK.MatchStringEqual:
lst, err = decodeList(bkt.Get(bucketKeyHelper(f.Header(), f.Value())))
if err != nil {
db.log.Debug(logs.MetabaseCantDecodeListBucketLeaf, zap.String("error", err.Error()))
return
}
default:
fMatch, ok := db.matchers[op]
if !ok {
db.log.Debug(logs.MetabaseUnknownOperation, zap.Uint32("operation", uint32(op)))
return
}
if err = fMatch.matchBucket(bkt, f.Header(), f.Value(), func(_, val []byte) error {
l, err := decodeList(val)
if err != nil {
db.log.Debug(logs.MetabaseCantDecodeListBucketLeaf,
zap.String("error", err.Error()),
)
return err
}
@ -402,10 +388,6 @@ func (db *DB) selectFromList(
return nil
}); err != nil {
db.log.Debug(logs.MetabaseCantIterateOverTheBucket,
zap.String("error", err.Error()),
)
return
}
}
@ -447,10 +429,6 @@ func (db *DB) selectObjectID(
default:
fMatch, ok := db.matchers[op]
if !ok {
db.log.Debug(logs.MetabaseUnknownOperation,
zap.Uint32("operation", uint32(f.Operation())),
)
return
}
@ -461,18 +439,13 @@ func (db *DB) selectObjectID(
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
if err := id.Decode(k); err == nil {
appendOID(id)
}
return nil
})
if err != nil {
db.log.Debug(logs.MetabaseCouldNotIterateOverTheBuckets,
zap.String("error", err.Error()),
)
}
}
}
}