Skip to content

Commit

Permalink
object: Limit header length to 16KB
Browse files Browse the repository at this point in the history
Previously, NeoFS used 4MB as object header's length limit. The value
originally resulted from the default max gRPC message length.

Now header length can be up to 16KB only. To ensure the safety of data
uploaded before the restriction was introduced, this limit does not
apply to intra-container replication.

Closes #262.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
cthulhu-rider committed Feb 26, 2024
1 parent dcead71 commit 86de4dd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Changed
- Split ID is deprecated, the first child part is used instead and is known to the other parts (#283)
- Object header is now limited to 16KB (#262)

### Removed

Expand Down
4 changes: 3 additions & 1 deletion object/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ message PutRequest {
// Object signature if available
neo.fs.v2.refs.Signature signature = 2;

// Object's Header
// Object's Header. The maximum length is 16KB. The only exclusion are
// replication requests, i.e. requests sent by container nodes with
// 'meta_header.ttl=1': for such cases the limit is 4MB.
Header header = 3;

// Number of the object copies to store within the RPC call. By default
Expand Down
3 changes: 2 additions & 1 deletion object/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ message Header {
// string value of the object attribute
string value = 2 [json_name = "value"];
}
// User-defined object attributes
// User-defined object attributes. Attributes vary in length from object to
// object, so keep an eye on the entire Header limit depending on the context.
repeated Attribute attributes = 10 [json_name = "attributes"];

// Bigger objects can be split into a chain of smaller objects. Information
Expand Down
4 changes: 2 additions & 2 deletions proto-docs/object.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ are not set, they will be calculated by a peer node.
| ----- | ---- | ----- | ----------- |
| object_id | [neo.fs.v2.refs.ObjectID](#neo.fs.v2.refs.ObjectID) | | ObjectID if available. |
| signature | [neo.fs.v2.refs.Signature](#neo.fs.v2.refs.Signature) | | Object signature if available |
| header | [Header](#neo.fs.v2.object.Header) | | Object's Header |
| header | [Header](#neo.fs.v2.object.Header) | | Object's Header. The maximum length is 16KB. The only exclusion are replication requests, i.e. requests sent by container nodes with 'meta_header.ttl=1': for such cases the limit is 4MB. |
| copies_number | [uint32](#uint32) | | Number of the object copies to store within the RPC call. By default object is processed according to the container's placement policy. |


Expand Down Expand Up @@ -884,7 +884,7 @@ Object Header
| object_type | [ObjectType](#neo.fs.v2.object.ObjectType) | | Type of the object payload content |
| homomorphic_hash | [neo.fs.v2.refs.Checksum](#neo.fs.v2.refs.Checksum) | | Homomorphic hash of the object payload |
| session_token | [neo.fs.v2.session.SessionToken](#neo.fs.v2.session.SessionToken) | | Session token, if it was used during Object creation. Need it to verify integrity and authenticity out of Request scope. |
| attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes |
| attributes | [Header.Attribute](#neo.fs.v2.object.Header.Attribute) | repeated | User-defined object attributes. Attributes vary in length from object to object, so keep an eye on the entire Header limit depending on the context. |
| split | [Header.Split](#neo.fs.v2.object.Header.Split) | | Position of the object in the split hierarchy |


Expand Down

0 comments on commit 86de4dd

Please sign in to comment.