Fix blobovnizca data size counter #612
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#612
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/blobovnizca_perf"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Relates #602
Fix blobovnicza counters:
Add
Init
call to initialize size counter.Previously, to determine the blobovnizca size, a logical size was added to the physical size. Now only the logical size is used. The size is calculated as multiplying the number of records by the upper bound of the bucket.
blobovnizca.Close
can be called multiple times, so I added a mutex to avoid changing metrics and counters multiple times.I changed the name of the
size
metric, since this metric does not correspond to the total size of the tree, but to the size of open blobovnizcas.32d198b316
to77aad284d0
77aad284d0
toe1c2bb259e
@ -75,0 +102,4 @@
func (b *Blobovnicza) initializeSize() error {
var size uint64
err := b.boltDB.View(func(tx *bbolt.Tx) error {
return b.iterateAllBuckets(tx, func(lower, upper uint64, b *bbolt.Bucket) (bool, error) {
There should be 3 buckets for
objSizeLimit=128KB
: 0 - 32KB, 32KB-64KB, 64KB - 128KB.@ -49,3 +52,3 @@
err := b.boltDB.Update(func(tx *bbolt.Tx) error {
return b.iterateBuckets(tx, func(lower, upper uint64, buck *bbolt.Bucket) (bool, error) {
return b.iterateAllBuckets(tx, func(lower, upper uint64, buck *bbolt.Bucket) (bool, error) {
Scenario: I set the maximum size of the object to 1MB, saved the object, changed the maximum size to 128KB, then I'm trying to delete it, but the corresponding bucket is not found because of new limit.
After this fix all bucket will be iterated, not only limited by object size.
WIP: Blobovnizca performanceto Fix blobovnizca data size counter710da5cf93
to850f79361b
@ -16,2 +16,4 @@
// If the database file does not exist, it will be created automatically.
// If blobovnizca is already open, does nothing.
func (b *Blobovnicza) Open() error {
b.controlMtx.Lock()
Open
is usually something done once after creation, do we have any place where we reuse theBlobovnicza
struct?No, here we check 'opened' flag for consistency with
Init
andClose
@ -51,0 +60,4 @@
defer b.controlMtx.Unlock()
if !b.opened {
return errors.New("blobovnizca is not open")
s/open/opened/
"open" seems fine to me as well. As in, "the door is open".
@ -92,2 +117,4 @@
// Close releases all internal database resources.
//
// If blobovnizca is already close, does nothing.
s/close/closed/
fixed
850f79361b
to6f69dcbb0d
6f69dcbb0d
toc0f3fb332f