Count items in the writecache faster #561
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#561
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
After #462 (comment) we return to the
iteration
scheme for counting the amount of items in bucket. We aim at to start fast, so here is what we could do:ErrInitializing
until iteration has finished)I think the first option is better. Let's look at the defs:
So, after startup:
IncDB()
andDecDB()
can finely work, ifx.cDB
is not set yet(it's kind of working with blackbox)DB()
And run
initCounters()
asynchronously@fyrchik @ale64bit WDYT?
To me (1) and (2) are not mutually exclusive.
Speaking of (1) I think we better fail requests prematurely and not hang for an undefined amount of time.
Hm. Am I right that if we cannot find the key from (2), then we go to (1)?
Yes, it should be like that. But my suggestion is still compatible with (1)
@fyrchik do we need to be able to count the keys? can't we get away without it? (e.g. by using the disk space instead, which is more commonly provided)
I suppose this requires to redesign the way for cache initialization
If we take a look at this
Open
For now we take
Open
for failed one, if we cannot read/count the amount of objects within db. But if we makeinitCounters
async call, then we are obliged to ignore potential error witihnOpen
because it may occur only later.Therefore, we can take
Open
for successful invocation (-> succesful initialization), howeverinitCounters
may fail later.Anyway, it is not the big deal to take
initCounter
away fromOpen
and make the call standalone.But if we somehow get "promised" error from
initCounters
in the case it failed, then we cannot stop the work and we always returnerror
fromDB()
call and metrics will be always incorrect or we need to ignore metric calculation - what do we do in this case?We can block cache from accepting requests until counters are initialized -- need to have some ballpark numbers here for the duration.
Or we may remove this metric alltogether (though it seems useful).
Having it for bolt and not for badger seems wrong.
Badger is no longer a thing.