engine: Check object existence concurrently #912
No reviewers
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#912
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/engine_existance_concurrently"
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 #874
Now existence check for storage engine performs concurrently.
Benchmarks:
@ -47,1 +37,4 @@
}
if client.IsErrObjectAlreadyRemoved(err) {
return err
Why not to perform
cancel
here too? Looks like the result will be obtained faster in this case.Fixed, thanks
Oh, no. It's ok. If
eg.Go
returns error, than egCtx will be cancelled by errgroup.2d312d8c6a
tod73ae9866c
d73ae9866c
to075984a07a
engine: Check object existance concurrentlyto engine: Check object existence concurrentlyCan we also either perform benchmarks on some actual hardware (server-grade CPU) or attach some k6 results (local.js is enough)?
The change is obviously on the critical path, so we don't want to acidentally add regressions.
075984a07a
to4b82c6b35c
Test
write 8kb 600th 15min
k6 output:
original:
with fix
On grafana boards there is no significant changes.
4b82c6b35c
to05838c26f7
@ -48,0 +54,4 @@
}
return nil
}
if exists.CompareAndSwap(false, res.Exists()) {
How is it different from
Store(true)
? I would expectStore
to have less overhead and more obvious, callingcancel()
twice is allowed too. Don't mind using your approach too.cancel
should be called only if object found, so we have to checkres.Exists()
. Or I don't understand your point.I mean
if res.Exists() { exists.Store(true); cancel() }
instead ofCompareAndSwap
In my approach we have estimated number of atomic operations equal to 1.
fixed.
Also dropped comment about concurrent exists.
@ -67,6 +67,12 @@ func (db *DB) Exists(ctx context.Context, prm ExistsPrm) (res ExistsRes, err err
return res, ErrDegradedMode
}
select {
Do all these
select
optimizations affect running speed? Asking because context expiring inExists()
is not likely, it is the first step in put, much faster than the expected operation time.These
select
are most required for blobovnicza tree.I think it is good practice to check
ctx.Done()
before any IO operation.05838c26f7
tof526f49995