object: Fix Put
for EC
object when node unavailable #1427
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1427
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/ec-writer"
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?
Add test for
ECWriter
.How to reproduce bug:
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
Put
forEC
object when node unavailableb7ad738537
tocd2b523a64
Could you describe what the bug was in the commit message?
I understand the diff, but fail to understand why the old code was incorrect.
@ -0,0 +79,4 @@
}
func (c multiAddressClient) ObjectDelete(_ context.Context, _ apiclient.PrmObjectDelete) (*apiclient.ResObjectDelete, error) {
panic("implement me")
We can use interface embedding for this purpose -- it will panic with NPE, but we won't have to write boilerplate.
This style is bad for real code, but good for tests IMO.
Agree, updated. Looks much better.
With the old code, there might be situation when context canceled earlier then we move to another part of nodes.
@ -0,0 +137,4 @@
data := make([]byte, 100)
_, _ = rand.Read(data)
var ver version.Version
version.Current()
?Fixed.
@ -0,0 +192,4 @@
require.NoError(t, err)
}
func testNodeMatrix(t testing.TB, dim []int) ([][]netmap.NodeInfo, [][]string) {
Have you copied this function from somewhere?
I am wondering about
dim
which is an array, but only has length=1 at the call-site.Yeah, copied. But in my defense, I will say that it has already been duplicated :-)
cd2b523a64
to549e54e436
[#xx] object: Fixto object: FixPut
forEC
object when node unavailablePut
forEC
object when node unavailable549e54e436
to518ed4be15
518ed4be15
toacd6eb1815
Commit message updated.
@ -223,1 +228,4 @@
})
}
}
err = eg.Wait()
The linter hasn't caught this, but it seems the error value is unused, unless it is the last loop iteration.
This was not a problem previously, because waiting was done once, outside the loop.
It this intentional?
Yes, it is intentional. The idea is to iterate over all nodes and return only the last error. All other errors will be logged inside
e.writePart(...)
.Put
forEC
object when node unavailable #1489