Fix object payload size limiter #293
Labels
No labels
P0
P1
P2
P3
good first issue
pool
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-sdk-go#293
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-sdk-go:fix/object_transformer"
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?
writeChunk
should not release new objects as this doesn't changepayloadSizeLimiter
internalstate.
MaxSize
:payloadSizeLimiter
releases object again although state is the same. This led to error because EC-encoder receives empty payload and couldn't not process it.25523066e7
to26e059e628
@aarifullin could you check the following case?
The last write is
maxSize + some bytes
. I.e. we must release 2 objects inwriteChunk()
.I have concerns because
chunk
variable is altered at the end of the loop, and we might hit the condition even ifwriteChunk
was called with non-empty chunk.You're talking about the case
N * max_size + some_bytes
. This releasesN + 1
objects - that has been before and that is for now.TestTransform
already checks for the number of produced objects.You're right. It hits. After first loop we write
max_size
bytes intopayload
and increasewritten
. Chunk is cut andsome_bytes
are left. Next iteration. We hit the condition, release the previousmax_size
write andpayload
is truncated for next iterations. We write remaining bytes intopayload
that is emptied before. Chunk is done ->writeChunk
is done. So, weClose()
target and this invocation releases last object and finishes the whole jobLet me be more clear:
Does this work as expected?
26e059e628
to5f962e0465
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
Please, check the new unit-test
TestTransformerNonMonotonicWrites
. I hope I correctly got your idea: firstly, it writes8 bytes
then24
bytes and we get 2 released objects as expected