pilorama: Fix TreeDrop #805
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#805
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:fix/bforest_tree_drop"
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?
invalidated. So, buckets should be gathered before deleting.
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
60ee316151
toc8a68155bf
[#XX] pilorama: Fix TreeDropto pilorama: Fix TreeDrop@ -1118,2 +1118,3 @@
var buckets [][]byte
for k, _ := c.Seek(prefix); k != nil && bytes.HasPrefix(k, prefix); k, _ = c.Next() {
err := tx.DeleteBucket(k)
buckets = append(buckets, k)
There is no need to create an intermediate slice, I believe we can just replace
c.Next()
withc.Seek(prefix)
Agree. But it is needed to add cursor rewind: https://github.com/boltdb/bolt/issues/357#issuecomment-97851571: added it at the end of
for
bodyNow it looks too complex IMHO. If I see this code in a week, I will be confused. @fyrchik , what's wrong with slice?
Nothing wrong, it bugs me when I see 2 iterations instead of 1.
In this case
buckets
slice will generally be of size 1-2, may be nothing bad.c8a68155bf
to8d5300c41a