Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/panic in GETRANGE #2101

Merged
merged 3 commits into from
Dec 12, 2022
Merged

Fix/panic in GETRANGE #2101

merged 3 commits into from
Dec 12, 2022

Conversation

carpawell
Copy link
Member

Closes #2095.

@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3712

@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3713

@sami-nspcc
Copy link

I am running integration tests

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3714

@sami-nspcc
Copy link

I am running integration tests

@codecov
Copy link

codecov bot commented Nov 24, 2022

Codecov Report

Merging #2101 (bdb7a62) into master (9717d87) will decrease coverage by 0.00%.
The diff coverage is 9.09%.

@@            Coverage Diff             @@
##           master    #2101      +/-   ##
==========================================
- Coverage   30.78%   30.77%   -0.01%     
==========================================
  Files         382      382              
  Lines       28056    28065       +9     
==========================================
  Hits         8637     8637              
- Misses      18687    18696       +9     
  Partials      732      732              
Impacted Files Coverage Δ
pkg/local_object_storage/engine/tree.go 0.00% <0.00%> (ø)
pkg/services/object/get/prm.go 54.54% <0.00%> (-20.46%) ⬇️
pkg/services/object/get/assemble.go 89.23% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

acid-ant
acid-ant previously approved these changes Nov 25, 2022
@carpawell carpawell changed the base branch from support/v0.34 to master November 29, 2022 18:54
@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3731

@carpawell
Copy link
Member Author

Changed the base branch.

@sami-nspcc
Copy link

I am running integration tests

pkg/services/object/get/prm.go Outdated Show resolved Hide resolved
pkg/services/object/get/get_test.go Show resolved Hide resolved
pkg/services/object/get/assemble.go Show resolved Hide resolved
@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3740

@sami-nspcc
Copy link

I am running integration tests

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

}

if offset+length <= offset {
return nil, fmt.Errorf("invalid '%s' range: uint64 overflow", vs[i])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also check the test behaviour? They may check for out of range error.

Copy link
Member Author

@carpawell carpawell Dec 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like tests want OUT_OF_RANGE here /cc @abereziny

should be adapted then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay to change. We may update testcases to reflect this new error

@sami-nspcc
Copy link

I have recieved a notification of a new pull request. I am starting the build of images and binaries for further testing. Build number is 3771

@sami-nspcc
Copy link

I am running integration tests

@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report

}

if offset+length <= offset {
return nil, apistatus.ObjectOutOfRange{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me this is not a status error even though it probably will.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, can we print the text, but make sure user understands this is a local error.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, i agree but that is what our tests expect. we can look at this as an optimisation, a node should return that code. anyway SDK client panics in that case so we have to rerurn some error here. @fyrchik

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what have we decided?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure user understands this is a local error

we write rpc error: to all the RPC errors we get

Copy link
Member Author

@carpawell carpawell Dec 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

returned the previous version (not the status code) and suggest changing the test in its failure case

}

if offset+length <= offset {
return nil, apistatus.ObjectOutOfRange{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, can we print the text, but make sure user understands this is a local error.

Also, includes range parsing error messages enhancement.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
Stop child objects collection if the last returned object (the most "left"
object in the collected chain) starts exactly from the `GETRANGE`'s `from`
value.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@sami-nspcc
Copy link

Test run is finished. Please download the tarball from link. Untar and use allure open to watch the report. Build number is 3809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic on get range
6 participants