node: Bind length of copies number to number of replicas #665

Merged
fyrchik merged 1 commit from acid-ant/frostfs-node:bugfix/compare-copies-num-with-rep into master 2023-08-30 17:11:59 +00:00
Member

Allow to use one digit in copies number array for backward compatibility.

Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com

Allow to use one digit in copies number array for backward compatibility. Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant force-pushed bugfix/compare-copies-num-with-rep from 7e668a79f6 to aef2bc4244 2023-08-30 10:46:51 +00:00 Compare
acid-ant requested review from storage-core-committers 2023-08-30 11:08:29 +00:00
acid-ant requested review from storage-core-developers 2023-08-30 11:08:29 +00:00
fyrchik approved these changes 2023-08-30 12:13:35 +00:00
@ -76,1 +76,4 @@
cnLen := len(cfg.copyNumbers)
if cnLen > 0 && cnLen != 1 && cnLen != cfg.policy.NumberOfReplicas() {
return nil, errors.New("copies number accepts only one number or array with length " +
Owner

What about a defining a constant error (like errNilBuilder?

What about a defining a constant error (like `errNilBuilder`?
Author
Member

Why not, added.

Why not, added.
fyrchik marked this conversation as resolved
@ -232,4 +232,2 @@
expectedRem: replicas,
},
{
name: "compatible zero copy numbers, len 2",
Owner

Do we have INcompatible tests?

Do we have INcompatible tests?
Author
Member

No, let's create them. Updated.

No, let's create them. Updated.
fyrchik marked this conversation as resolved
acid-ant force-pushed bugfix/compare-copies-num-with-rep from aef2bc4244 to 63942ae2be 2023-08-30 12:23:29 +00:00 Compare
fyrchik approved these changes 2023-08-30 17:11:47 +00:00
fyrchik merged commit fe5aa06a75 into master 2023-08-30 17:11:59 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#665
No description provided.