tree: Add ApplyBatch method #1449
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#1449
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/tree_sync_race"
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?
Concurrent Apply can lead to child node applies before parent, so
undo/redo operations will perform. This leads to performance degradation
in case of tree with many sublevels.
572da86df7
to5dd4f0afd7
5dd4f0afd7
to87ce7722c7
@ -384,7 +376,7 @@ func (s *Service) syncLoop(ctx context.Context) {
return
case <-s.syncChan:
ctx, span := tracing.StartSpanFromContext(ctx, "TreeService.sync")
s.log.Debug(logs.TreeSyncingTrees)
Should be in a separate commit.
done
@ -202,3 +190,1 @@
unappliedOperationHeight = min(unappliedOperationHeight, m.Time)
heightMtx.Unlock()
return err
if len(batch) == 1000 {
Magic constant.
fixed
87ce7722c7
todbc91a4570
WIP: tree: Add ApplyBatch methodto tree: Add ApplyBatch method@ -561,0 +609,4 @@
}
ops := make([]*Move, 0, len(m))
for _, op := range m {
Can we move this loop inside
View
? In case ofnil
fortreeRoot
we may exit from it faster.fixed
@ -106,6 +106,33 @@ func (s *Shard) TreeApply(ctx context.Context, cnr cidSDK.ID, treeID string, m *
return s.pilorama.TreeApply(ctx, cnr, treeID, m, backgroundSync)
}
// TreeApply implements the pilorama.Forest interface.
TreeApply
->TreeApplyBatch
fixed
dbc91a4570
to743e960b3b
New commits pushed, approval review dismissed automatically according to repository settings
@ -561,0 +620,4 @@
var logKey [8]byte
binary.BigEndian.PutUint64(logKey[:], op.Time)
seen := b.Get(logKey[:]) != nil
if !seen {
!seen
->b.Get(logKey[:]) == nil
No, thx. With
seen
is clearer.