client: Fix PatchPayload
method #268
No reviewers
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-go#268
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-sdk-go:fix/patch/4"
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?
PatchPayload
send a patch with empty payload patch if range's length is non-zero and if it's the first call.PatchPayload
that make other calls incorrectly set patch ranges.PatchPayload
method69bb03e9bc
to9ef9e51500
Please, add a test which fails on master and passes with your change.
@ -178,6 +178,20 @@ func (x *objectPatcher) PatchPayload(_ context.Context, rng *object.Range, paylo
return false
}
if n == 0 {
if rng.GetLength() != 0 && x.firstPatchPayload {
If
rng.GetLength() == 0
andn == 0
it should be an error.Also, where does
x.firstPatchPayload
restriction comes from?Fixed
Briefly, it comes from partitioning of a patch with the large payload for some cases
I don't understand, could you elaborate?
First of all, I removed
firstPatchPayload
because it's unnecessary structure's flag that only makes repeatingPatchPayload
incorrect - the secondPatchPayload
used distorted range offset because this flag was set to true. So, I replaced it withpatchIter
within this function that fixes that problem.Still, why do we need to check for
patchIter == 0
?.offet = 0, length =0
and the large payload.chunk = "large large payload...".
Read buffer size is limited. So, we expect that the payload is read by parts with fixed parameters.offset = 0, length = 0
till the last iteration (n == 0
) but it's still valid. If we don't check whether it's first iteration, then we'll fail although this case is validpatchIter
was exactly I was having in mind, nice9ef9e51500
tocfa90cf232
New commits pushed, approval review dismissed automatically according to repository settings
cfa90cf232
toc94f80dc3d
client: Fixto WIP: client: FixPatchPayload
methodPatchPayload
methodSome rework is still required
c94f80dc3d
to22d344044b
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
WIP: client: Fixto client: FixPatchPayload
methodPatchPayload
method@ -182,4 +194,3 @@
}
rngPart := object.NewRange()
if x.firstPatchPayload {
It seems to be another bug, multiple patches hasn't worked properly at all, right?
Right. Because I checked it on big files and didn't see incorrect behavior
22d344044b
tod342c0bc16