Use containersOf
in neofs-adm #200
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#200
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fyrchik/frostfs-node:fix-containers-of"
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?
Fix (partially) #175.
containersOf
6a7155fc90@ -117,3 +125,3 @@
}
out, err := json.Marshal(containers)
_, err = f.Write([]byte{']'})
If written = 0, then only one parenthesis will go to the file?
Fixed
7294708168
to6e693335e1
@ -113,1 +115,3 @@
cnt.EACL = ea
// Writing directly to the file is ok, because json.Encoder does no internal buffering.
if written != 0 {
_, err = f.Write([]byte{','})
Just for my curiosity.
Are
cnt
-s big? It they are not, wouldn't be better to collect them in one slice?and then invoke
data, err := json.Marshal(&cnts)
and justioutil.WriteFile()
for once?If they are big, then yes - stream marshalling is not supported by
encoding/json
and the such way is neededIt was done like this before.
We have no limits on the number of containers: there can be a lot of them and
eACL
can be big too (64kb is the limit, already happened in practice).@ -50,2 +49,2 @@
if _, ok := itm.(stackitem.Null); !ok {
return unwrap.ArrayOfBytes(res, err)
// Nothing bad, except live session on the server, do not report to the user.
defer func() { _ = inv.TerminateSession(sid) }()
not sure exactly, but not that necessary as i remember according to my new neo-go API discoverings (4 months ago, could be wrong), actors do not do that as i remember (again, could be wrong)
That is why we ignore error.
I meant that it looks like
neo-go
team also thinks that we can dropdefer
at all. But not a problem.It costs us (almost) nothing and neo-go internals can change any time.
@ -120,0 +133,4 @@
func dumpSingleContainer(bw *io.BufBinWriter, ch util.Uint160, inv *invoker.Invoker, id []byte) (*Container, error) {
bw.Reset()
emit.AppCall(bw.BinWriter, ch, "get", callflag.All, id)
can we use (tuned)
Call
here?mean
Invoker
's methodWe can, but this PR is only about
containersOf
refactoring.