traverser: Check for placement vector out of range #1516
No reviewers
TrueCloudLab/storage-core-developers
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#1516
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/traverser-out-range"
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?
Placement vector may contain fewer nodes count than it required by policy
due to the outage of the one of the node.
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
afacc86f35
to9e11e3dc85
9e11e3dc85
to6132971266
@ -117,2 +116,2 @@
unsortedVector = append(unsortedVector, ns[i][:rem[i]]...)
regularVector = append(regularVector, ns[i][rem[i]:]...)
if len(ns[i]) < rem[i] {
unsortedVector = append(unsortedVector, ns[i]...)
Looks like you have forgotten
regularVector = append(regularVector, ns[i][rem[i]:]...)
hereBut the like you wrote will panic!
I meant that the second slice is not updated.
It should not because we do not have enough nodes for that in the current vector.
@ -113,3 +113,2 @@
rem = defaultCopiesVector(cfg.policy)
var unsortedVector []netmap.NodeInfo
var regularVector []netmap.NodeInfo
var unsortedVector, regularVector []netmap.NodeInfo
Unrelated non-functional change, please, remove.
Other than this LGTM
Reverted.
6132971266
tobc1b4957e4
@ -116,3 +116,2 @@
for i := range rem {
unsortedVector = append(unsortedVector, ns[i][:rem[i]]...)
regularVector = append(regularVector, ns[i][rem[i]:]...)
if len(ns[i]) < rem[i] {
Linter complains about the size of this function.
How about
It is also somewhat more readable and concise IMO
Nice! Updated.
bc1b4957e4
to4d9d049e5a
4d9d049e5a
tof12f04199e