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

slicer: Do not put link objects that will be rejected #566

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

carpawell
Copy link
Member

Since link objects have payload now, they may overflow max regular object size. Client-size error is better that server-side overflow message. Not expected in practice but may be observed when running some extreme local installations for tests (e.g., 1K limit and 100K object).

@carpawell
Copy link
Member Author

However, we also may allow LINK objects to be bigger than regular object size limit.

Also, that is not really helpful if the whole object is PUT already and only the last iteration has failed. A user cannot even know any ID.

@@ -581,6 +581,10 @@ func (x *PayloadWriter) _writeChild(ctx context.Context, meta dynamicObjectMetad
payload := obj.Payload()
payloadAsBuffers := [][]byte{obj.Payload()}

if uint64(len(payload)) > x.payloadSizeLimit {
Copy link
Contributor

@cthulhu-rider cthulhu-rider Mar 5, 2024

Choose a reason for hiding this comment

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

@carpawell did u think about what will happen if we'll make recursion here? it will definitely converge (if x.payloadSizeLimit > 32+eps tbh), but whether the system is ready for this is a question

the 2nd question is what payload limit will be with x.payloadSizeLimit=64M?

Copy link
Member

Choose a reason for hiding this comment

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

Link objects are flat simple ones only for now. Extension can be made in the future, but I doubt it's needed.

Copy link
Contributor

@cthulhu-rider cthulhu-rider Mar 6, 2024

Choose a reason for hiding this comment

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

ok, i was just wondering. Metadata tracking could need extensions for this, placement/assembly would work i guess

Copy link
Member Author

@carpawell carpawell Mar 6, 2024

Choose a reason for hiding this comment

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

@carpawell did u think about what will happen if we'll make recursion here?

that will require node-side adoption for sure, and it is hard to predict how much of a change it will take

the 2nd question is what payload limit will be with x.payloadSizeLimit=64M?

1560671 parts can be attached to the payload (43 bytes is for 64mb varint + OID), that is 95TB

@@ -581,6 +581,10 @@ func (x *PayloadWriter) _writeChild(ctx context.Context, meta dynamicObjectMetad
payload := obj.Payload()
payloadAsBuffers := [][]byte{obj.Payload()}

if uint64(len(payload)) > x.payloadSizeLimit {
Copy link
Member

Choose a reason for hiding this comment

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

Link objects are flat simple ones only for now. Extension can be made in the future, but I doubt it's needed.

@@ -581,6 +581,10 @@ func (x *PayloadWriter) _writeChild(ctx context.Context, meta dynamicObjectMetad
payload := obj.Payload()
payloadAsBuffers := [][]byte{obj.Payload()}

if uint64(len(payload)) > x.payloadSizeLimit {
return fmt.Errorf("link's payload exceeds max available size: %d > %d", uint64(len(payload)), x.payloadSizeLimit)
Copy link
Contributor

@cthulhu-rider cthulhu-rider Mar 6, 2024

Choose a reason for hiding this comment

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

at this point we have complete chain accepted except linker, right? So, this makes the original object alive in the system, and we've done a lot of work. But here we fail. From one side, this looks pretty legit - we cannot form the complete chain. From the other one, we've made "enough" chain. What im thinking bout are:

  1. will system auto-remove the chain eventually? this could be a huge pile of data user doesnt expect to reside in his container
  2. if not, may be we'll let such chains to live and respond to user about this?

the case could be generalized to any problems with linker storage, but slicing is even more interesting

good to be discussed in a separate issue, but mb u already thought

Copy link
Member

Choose a reason for hiding this comment

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

We still have a valid object. Maybe it's better be controlled by some maximum object size limit (which can fail earlier than this one, but it'll leave incomplete chain then).

Copy link
Member Author

Choose a reason for hiding this comment

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

there will always be (potential) situations when a user did not know the exact size and we have to stop splitting when some objects are already PUT, so i see no good solution except accepting them and marking garbage only if an additional user command is received (e.g. vacuum) OR sending some signed request from the user/slicer that the whole split was a mistake and parts should be marked for deletion

@cthulhu-rider
Copy link
Contributor

@carpawell tests with small limit broke, should be fixed. For example, we can predict whether links will fit into the object, and if not, expect an introduced error. Tested limits' increase could also be needed

Since link objects have payload now, they may overflow max regular object size.
Client-size error is better that server-side overflow message. Not expected in
practice but may be observed when running some extreme local installations for
tests (e.g., 1K limit and 100K object).

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
@carpawell carpawell force-pushed the feat/more-valuable-error-on-link-overflow branch from 7ffed53 to f5ffd70 Compare March 7, 2024 14:53
@carpawell
Copy link
Member Author

tests with small limit broke, should be fixed

Just increased the limits, if you don't mind. There is not much we can do here.

For example, we can predict whether links will fit into the object

Only if we know the exact object size. That is not granted. And i think in practice a known object size is not the case where it cannot fit a link. Not sure what can store 95TB, know its size and stream it to the NeoFS.

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (master@0c41af6). Click here to learn what that means.

Files Patch % Lines
object/slicer/slicer.go 0.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #566   +/-   ##
=========================================
  Coverage          ?   68.15%           
=========================================
  Files             ?      122           
  Lines             ?     9964           
  Branches          ?        0           
=========================================
  Hits              ?     6791           
  Misses            ?     2799           
  Partials          ?      374           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@roman-khimov roman-khimov merged commit 6c908f3 into master Mar 7, 2024
12 checks passed
@roman-khimov roman-khimov deleted the feat/more-valuable-error-on-link-overflow branch March 7, 2024 15:06
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.

4 participants