[#462] Implement PATCH for simple objects #462

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:feature/patch_object into feature/patch 2024-08-21 13:33:49 +00:00
Member

Signed-off-by: Marina Biryukova m.biryukova@yadro.com

Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova self-assigned this 2024-08-14 14:51:05 +00:00
mbiryukova added 1 commit 2024-08-14 14:51:10 +00:00
[#xxx] Implement PATCH for simple objects
Some checks failed
/ Vulncheck (pull_request) Successful in 1m49s
/ DCO (pull_request) Failing after 1m43s
/ Builds (1.21) (pull_request) Successful in 1m48s
/ Builds (1.22) (pull_request) Successful in 1m45s
/ Lint (pull_request) Failing after 1m15s
/ Tests (1.21) (pull_request) Successful in 2m4s
/ Tests (1.22) (pull_request) Successful in 2m16s
c242586506
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
mbiryukova force-pushed feature/patch_object from c242586506 to 704117c7bb 2024-08-14 14:51:29 +00:00 Compare
mbiryukova changed title from [#xxx] Implement PATCH for simple objects to [#462] Implement PATCH for simple objects 2024-08-14 14:51:52 +00:00
mbiryukova force-pushed feature/patch_object from 704117c7bb to 5fdb834e56 2024-08-14 15:08:08 +00:00 Compare
mbiryukova requested review from storage-services-committers 2024-08-16 07:07:09 +00:00
mbiryukova requested review from storage-services-developers 2024-08-16 07:07:10 +00:00
fyrchik requested review from aarifullin 2024-08-16 08:00:05 +00:00
aarifullin reviewed 2024-08-16 09:11:21 +00:00
@ -392,0 +400,4 @@
var rng object.Range
rng.SetOffset(prm.Range.Start)
rng.SetLength(prm.Range.End - prm.Range.Start + 1)
if prm.Range.End >= prm.ObjectSize {
Member

If the hanlder gets bytes=0-0, then range will be offset = 0, length = 1?
Have you checked the patching with 0,0?

If the hanlder gets `bytes=0-0`, then range will be `offset = 0, length = 1`? Have you checked the patching with `0,0`?
Author
Member

If handler gets range 0-0, it means that we have to replace the first byte of object with received one. Result is correct

If handler gets range `0-0`, it means that we have to replace the first byte of object with received one. Result is correct
Owner

S3 PATCH spec supports a more narrow set of usecases, e.g. it seems impossible to "just insert" and patch should always be equal in length to the part it replaces.

S3 PATCH spec supports a more narrow set of usecases, e.g. it seems impossible to "just insert" and patch should always be equal in length to the part it replaces.
Member

S3 PATCH spec supports a more narrow set of usecases, e.g. it seems impossible to "just insert" and patch should always be equal in length to the part it replaces.

This is important detail

> S3 PATCH spec supports a more narrow set of usecases, e.g. it seems impossible to "just insert" and patch should always be equal in length to the part it replaces. This is important detail
aarifullin approved these changes 2024-08-16 10:59:36 +00:00
aarifullin left a comment
Member

OK with me. I have expected that pool would be used like in this PR

OK with me. I have expected that `pool` would be used like in this PR
dkirillov reviewed 2024-08-19 06:50:41 +00:00
dkirillov reviewed 2024-08-19 06:50:48 +00:00
dkirillov approved these changes 2024-08-19 06:57:42 +00:00
dkirillov left a comment
Member

LGTM

LGTM
@ -534,0 +571,4 @@
}
n.prepareAuthParameters(ctx, &prmHead.PrmAuth, p.BktInfo.Owner)
obj, err := n.frostFS.HeadObject(ctx, prmHead)
Member

Why don't we use just

n.objectHead(ctx, p.BktInfo, objID)

instead of

prmHead := PrmObjectHead{
	Container: p.BktInfo.CID,
	Object:    objID,
}
n.prepareAuthParameters(ctx, &prmHead.PrmAuth, p.BktInfo.Owner)

n.frostFS.HeadObject(ctx, prmHead)

?

Why don't we use just ```golang n.objectHead(ctx, p.BktInfo, objID) ``` instead of ```golang prmHead := PrmObjectHead{ Container: p.BktInfo.CID, Object: objID, } n.prepareAuthParameters(ctx, &prmHead.PrmAuth, p.BktInfo.Owner) n.frostFS.HeadObject(ctx, prmHead) ``` ?
Author
Member

Changed

Changed
dkirillov marked this conversation as resolved
mbiryukova force-pushed feature/patch_object from 5fdb834e56 to a16720da17 2024-08-19 08:53:20 +00:00 Compare
dkirillov approved these changes 2024-08-19 12:29:50 +00:00
fyrchik reviewed 2024-08-19 12:32:37 +00:00
@ -0,0 +152,4 @@
return nil, fmt.Errorf("unknown unit in range header")
}
parts := strings.Split(strings.TrimPrefix(rangeStr, prefix), "/")
Owner

strings.Cut? It is intended to be used for 2 parts.

`strings.Cut`? It is intended to be used for 2 parts.
fyrchik marked this conversation as resolved
mbiryukova force-pushed feature/patch_object from a16720da17 to 40866df3a9 2024-08-20 08:30:26 +00:00 Compare
alexvanin approved these changes 2024-08-21 13:33:35 +00:00
alexvanin merged commit 40866df3a9 into feature/patch 2024-08-21 13:33:48 +00:00
alexvanin deleted branch feature/patch_object 2024-08-21 13:33:54 +00:00
alexvanin added this to the v0.31.0 milestone 2024-11-20 11:58:56 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-s3-gw#462
No description provided.