mirror of
https://github.com/nspcc-dev/neofs-api-go.git
synced 2026-03-01 04:28:56 +00:00
Default CBF does not work with unspecified / distinct clauses #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @alexvanin on GitHub (Jan 26, 2021).
Originally assigned to: @fyrchik on GitHub.
Consider rules:
REP 2REP 2 CBF 3REP 2 IN X\nSELECT 2 FROM * AS XThey all have unspecified selection clause but this is correctly handled (#174).
Also they all have explicit or implicit
CBFvalue 3 (#156).In network map of 4 nodes I expect
GetContainerNodes()to return 4 nodes (#157) because it is smaller than max container size (2 * 3 = 6) but still bigger than min container size (2). Unfortunately all these placement rules produce 2 nodes as if CBF is 1.However if there is a rule with
ClauseSame, then function produce expected amount of nodes.Is it bug or somehow expected behavior?
/cc @realloc @fyrchik
@realloc commented on GitHub (Jan 26, 2021):
After a talk with @fyrchik we think that it's a bug. =) A Possible solution will be posted after additional discussion.
@fyrchik commented on GitHub (Jan 27, 2021):
SELECT N IN Attributegroups node byAttributeand returnsNbest possible buckets ("best" is defined deterministically by HRW). When default attribute is used, nodes can't be grouped by the value of some attribute. I have come up with 2 solutions:1.a. In this case for
SELECT 3 IN Countrywe can receive placement which uses more than 1 country in each replica. However, this happens only in the worst case, when there are less than 3 countries containing enough nodes to reach CBF.1.b Here we still receive exactly 3 countries for
SELECTfrom (a). For the default attribute (corresponding to "unique node") each bucket will contain as much nodes as possible.1a/1b.DISTINCTclause can be set as default by query parser, soSELECT 3 IN Countrywill behave as in1b, but raw protobuf format will be able to omit specifying clause thus leading to1abehaviour.After all I think there is a tradeoff between simplicity from the user POV and simplicity (i.e "no special cases") of selection algorithm. The former is more desirable in my opinion.
Thoughts? @alexvanin @realloc
@alexvanin commented on GitHub (Feb 3, 2021):
Seems like
1boption works great for our cases, it is simplest option and provides desired behavior. Option1agives more valid placements, however it decreases overall spatial locality in the system.Tried
1bwith such scenario, got expected result:@alexvanin commented on GitHub (Feb 3, 2021):
Fixed in #252