Fix Patch handler bugs #1338

Merged
fyrchik merged 1 commit from aarifullin/frostfs-node:fix/patch/3 into master 2024-09-04 19:51:11 +00:00
Member
  • Fix range provider in Patch handler: handle specific range with .offset = payload_length and length = 0
  • Fix audit patch stream
- Fix range provider in `Patch` handler: handle specific range with `.offset = payload_length` and `length = 0` - Fix audit patch stream
aarifullin added the
bug
label 2024-08-27 13:12:01 +00:00
aarifullin added 2 commits 2024-08-27 13:12:12 +00:00
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
[#XX] object: Fix range provider in Patch handler
Some checks failed
DCO action / DCO (pull_request) Failing after 1m45s
Tests and linters / Run gofumpt (pull_request) Successful in 1m51s
Build / Build Components (1.22) (pull_request) Successful in 2m20s
Vulncheck / Vulncheck (pull_request) Successful in 2m14s
Build / Build Components (1.23) (pull_request) Successful in 2m43s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m56s
Tests and linters / Tests (1.22) (pull_request) Successful in 2m59s
Tests and linters / Staticcheck (pull_request) Successful in 3m13s
Tests and linters / Tests (1.23) (pull_request) Successful in 3m18s
Tests and linters / gopls check (pull_request) Successful in 3m48s
Tests and linters / Lint (pull_request) Successful in 4m0s
Tests and linters / Tests with -race (pull_request) Successful in 4m1s
aa602c36d8
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
aarifullin requested review from storage-core-committers 2024-08-27 13:12:21 +00:00
aarifullin requested review from storage-core-developers 2024-08-27 13:12:24 +00:00
fyrchik reviewed 2024-08-27 13:15:30 +00:00
@ -204,7 +204,7 @@ func (a *auditPatchStream) CloseAndRecv(ctx context.Context) (*object.PatchRespo
if err != nil {
a.failed = true
}
a.objectID = resp.GetBody().ObjectID
Owner

I am wondering why protogetter linter hasn't catched this.

I am wondering why `protogetter` linter hasn't catched this.
fyrchik marked this conversation as resolved
@ -32,1 +34,4 @@
func (r *rangeProvider) GetRange(ctx context.Context, rng *objectSDK.Range) io.Reader {
// Remote GetRange request to a container node uses an SDK-client that fails range validation
// with zero-length. However, from the patcher's point of view, such request is still valid.
if rng.GetOffset() == r.originalPayloadLength && rng.GetLength() == 0 {
Owner

if rng.GetLength() == 0, we don't care what the offset is, could just return nopReader, right?

`if rng.GetLength() == 0`, we don't care what the offset is, could just return `nopReader`, right?
Author
Member

You're right. Fixed

You're right. Fixed
fyrchik marked this conversation as resolved
aarifullin force-pushed fix/patch/3 from aa602c36d8 to aaa7b7238e 2024-08-27 13:18:52 +00:00 Compare
aarifullin force-pushed fix/patch/3 from aaa7b7238e to 6488ddee88 2024-08-27 13:51:21 +00:00 Compare
fyrchik approved these changes 2024-08-27 15:07:46 +00:00
dstepanov-yadro approved these changes 2024-08-27 15:15:28 +00:00
acid-ant approved these changes 2024-08-28 06:10:22 +00:00
fyrchik merged commit 6488ddee88 into master 2024-08-28 10:37:46 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
4 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-node#1338
No description provided.