Add support EC parameters #1065
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1065
Loading…
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-node:adm_ec_parameters"
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?
@ -34,6 +34,8 @@ alphabet-wallets: /home/user/deploy/alphabet-wallets
network:
max_object_size: 67108864
epoch_duration: 240
max_EC_data_count: 12
let's use
only_small_letters
fixed
@ -107,2 +111,3 @@
Endpoint: "https://neo.rpc.node:30333",
MaxObjectSize: 67108864, // 64 MiB
MaxObjectSize: 67108864, // 64 MiB
MaxECDataCount: 12,
The comment woudn't hurt, it is a magic constant, otherwise.
The choice is indeed arbitrary.
The reasons are:
12+4
.fixed
@ -106,2 +107,4 @@
bw := io.NewBufBinWriter()
c, err := helper.GetN3Client(viper.GetViper())
This is a lot of code for a simple parameter addition, what is the reason?
@ -26,6 +26,8 @@ const (
ContractsURLFlagDesc = "URL to archive with compiled FrostFS contracts"
EpochDurationInitFlag = "network.epoch_duration"
MaxObjectSizeInitFlag = "network.max_object_size"
MaxECDataCountinitFlag = "network.max_ec_data_count"
MaxECDataCountinitFlag -> MaxECDataCountFlag
fixed
@ -46,3 +46,3 @@
cmd.Printf(format, "Withdrawal fee", netInfo.WithdrawalFee())
cmd.Printf(format, "Homomorphic hashing disabled", netInfo.HomomorphicHashingDisabled())
cmd.Printf(format, "Maintenance mode allowed", netInfo.MaintenanceModeAllowed())
cmd.Printf(format, "Maximum count of data shards", netInfo.MaxECDataCount())
Why have you removed
cmd.Printf(format, "Maintenance mode allowed"...
?fixed
ccf3103451
tod5bdd48413
@ -27,2 +27,4 @@
EpochDurationInitFlag = "network.epoch_duration"
MaxObjectSizeInitFlag = "network.max_object_size"
MaxECDataCountFlag = "network.max_ec_data_count"
MaxECParityCountConfig = "network.max_ec_parity_count"
Config -> Flag.
@ -27,6 +27,8 @@ func TestGenerateConfigExample(t *testing.T) {
require.Equal(t, "https://neo.rpc.node:30333", v.GetString("rpc-endpoint"))
require.Equal(t, filepath.Join(appDir, "alphabet-wallets"), v.GetString("alphabet-wallets"))
require.Equal(t, 67108864, v.GetInt("network.max_object_size"))
require.Equal(t, 12, v.GetInt("network.max_EC_data_count"))
Let's use only_small_letters here too.
d5bdd48413
to0b7ab2eb02
0b7ab2eb02
toa2719fe3e9
Please, look at staticcheck warnings
@ -108,0 +114,4 @@
prm := make(map[string]any)
for k, v := range m {
switch k {
case netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig:
Why we need to modify parameters for EC here?
There's a rule that the total of
MaxECDataCount
andMaxECParityCount
can't be more than 256. If a user only picks one of these, we need to get the other from the network.If it is requirement to avoid setting one value without another, maybe it is better to set it only in pair?
In this case, we can skip getting the previous values and avoid iteration over the whole map for editing two keys.
This will simplify the code, but this behavior may not be obvious to users
I have no objections to setting both: but we better still have 2 separate parameters, they just need to be provided simultaneously.
What is the reason to set configs for EC one by one? Because we have ability to skip check for
256
by calling contract method directly.Because this is how they are stored in the netmap contract.
fixed
a2719fe3e9
toe52f6eeba8
e52f6eeba8
toc51dd39b80
@ -131,0 +141,4 @@
var sumEC int64
_, okData := args[netmap.MaxECDataCountConfig]
_, okParity := args[netmap.MaxECParityCountConfig]
if (okData || okParity) && !(okData && okParity) {
This is
okData == okParity
(which is also quite readable IMO: their existence status must be the same).fixed
Please, rebase on master,
gofumpt
commits should already be there.c51dd39b80
to727f6bb0b8
727f6bb0b8
to92569b9bbf