Skip to content

Commit

Permalink
netmap: add some sane limits to rep/cbf, fix #307
Browse files Browse the repository at this point in the history
These are mostly some sanity checks, having unlimited replicas can be
problematic. Limiting the overall number of nodes is important wrt signature
collection, stack can't have more than 2048 elements.

Explain CBF a bit better at the same time.

Signed-off-by: Roman Khimov <[email protected]>
  • Loading branch information
roman-khimov committed Dec 27, 2024
1 parent e360d26 commit c04f714
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions netmap/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ message Selector {
// selector set, the root bucket containing all possible nodes will be used by
// default.
message Replica {
// How many object replicas to put
// How many object replicas to put. Limited to 8.
uint32 count = 1 [json_name = "count"];

// Named selector bucket to put replicas
Expand All @@ -109,11 +109,13 @@ message Replica {
// storage policy definition languages.
message PlacementPolicy {
// Rules to set number of object replicas and place each one into a named
// bucket
// bucket. Limited to 256 items.
repeated Replica replicas = 1 [json_name = "replicas"];

// Container backup factor controls how deep NeoFS will search for nodes
// alternatives to include into container's nodes subset
// Container backup factor (CBF) controls how deep NeoFS will search for
// alternative nodes to include into container's nodes subset. In total,
// the number of container nodes is Selector (used by Replica) count
// times CBF. This number is limited to 64 per-Replica and 512 overall.
uint32 container_backup_factor = 2 [json_name = "containerBackupFactor"];

// Set of Selectors to form the container's nodes subset
Expand Down
6 changes: 3 additions & 3 deletions proto-docs/netmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,8 @@ storage policy definition languages.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a named bucket |
| container_backup_factor | [uint32](#uint32) | | Container backup factor controls how deep NeoFS will search for nodes alternatives to include into container's nodes subset |
| replicas | [Replica](#neo.fs.v2.netmap.Replica) | repeated | Rules to set number of object replicas and place each one into a named bucket. Limited to 256 items. |
| container_backup_factor | [uint32](#uint32) | | Container backup factor (CBF) controls how deep NeoFS will search for alternative nodes to include into container's nodes subset. In total, the number of container nodes is Selector (used by Replica) count times CBF. This number is limited to 64 per-Replica and 512 overall. |
| selectors | [Selector](#neo.fs.v2.netmap.Selector) | repeated | Set of Selectors to form the container's nodes subset |
| filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of named filters to reference in selectors |
| subnet_id | [neo.fs.v2.refs.SubnetID](#neo.fs.v2.refs.SubnetID) | | DEPRECATED. Was used for subnetwork ID to select nodes from, currently ignored. |
Expand All @@ -497,7 +497,7 @@ default.

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| count | [uint32](#uint32) | | How many object replicas to put |
| count | [uint32](#uint32) | | How many object replicas to put. Limited to 8. |
| selector | [string](#string) | | Named selector bucket to put replicas |


Expand Down

0 comments on commit c04f714

Please sign in to comment.