nspcc-dev / neofs-sdk-go

Go implementation of NeoFS SDK
Apache License 2.0
6 stars 14 forks source link

Fix/Broken linking objects #427

Closed notimetoname closed 1 year ago

notimetoname commented 1 year ago

Did not allow updating neofs-node cause it was sending broken linking objects that had non-empty payload length and any replication failed (link objects do not have payload).

notimetoname commented 1 year ago

BTW, what behavior do you expect when an empty payload is streamed? I mean InitPayloadStream and immediate Close.

roman-khimov commented 1 year ago

BTW, what behavior do you expect when an empty payload is streamed?

An object with empty payload created?

cthulhu-rider commented 1 year ago

BTW, what behavior do you expect when an empty payload is streamed?

zero payload object if this fits user intention. Currently even if user suddenly realizes that he can't write all desired payload, he can't abort object creation gracefully. Abort method begs

notimetoname commented 1 year ago

@cthulhu-rider, @roman-khimov, i do not have strong thoughts about the zero payload object. Just found that during test fixing and decided to highlight it. We can create an issue about it or just wait for some feedback.

cthulhu-rider commented 1 year ago

i didn't got ur concern tbh. When we create new file, don't write any data to it and just close - it remains empty. Can we expect other behaviour for objects?

notimetoname commented 1 year ago

Can we expect other behaviour for objects?

Never thought it can be useful. You made me do it the first time. Just some intuitive reflections about empty objects: it looks more like a bug to me in a script/code that use a slicer instance for slicing empty payload. Not sure.

cthulhu-rider commented 1 year ago

@notimetoname currently slicer makes formatting as well, so it makes sense even with empty payload. Don't think it'll bother users much