[#1892] neofs-adm: Support `MaintenanceModeAllowed` network setting

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
remotes/fyrchik/neofs-adm-fix-commands
Evgenii Stratonikov 2022-10-13 15:11:53 +03:00 committed by fyrchik
parent f2793060c5
commit 80d3c7f9d6
4 changed files with 9 additions and 2 deletions

View File

@ -20,6 +20,7 @@ Changelog for NeoFS Node
- Add new RPC `TreeService.Healthcheck` - Add new RPC `TreeService.Healthcheck`
- Fallback to `GET` if `GET_RANGE` from one storage nodes to another is denied by basic ACL (#1884) - Fallback to `GET` if `GET_RANGE` from one storage nodes to another is denied by basic ACL (#1884)
- List of shards and logger level runtime reconfiguration (#1770) - List of shards and logger level runtime reconfiguration (#1770)
- `neofs-adm morph set-config` now supports well-known `MaintenanceModeAllowed` key (#1892)
### Changed ### Changed
- Allow to evacuate shard data with `EvacuateShard` control RPC (#1800) - Allow to evacuate shard data with `EvacuateShard` control RPC (#1800)
@ -64,6 +65,9 @@ Storage nodes under maintenance are not excluded from the network map, but don't
serve object operations. (*) can be fetched from network configuration via serve object operations. (*) can be fetched from network configuration via
`neofs-cli netmap netinfo` command. `neofs-cli netmap netinfo` command.
To allow maintenance mode during neofs-adm deployments, set
`network.maintenance_mode_allowed` parameter in config.
When issuing an object session token for root (virtual, "big") objects, When issuing an object session token for root (virtual, "big") objects,
additionally include all members of the split-chain. If session context additionally include all members of the split-chain. If session context
includes root object only, it is not spread to physical ("small") objects. includes root object only, it is not spread to physical ("small") objects.

View File

@ -76,7 +76,7 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%d (int)\n", k, n))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%d (int)\n", k, n)))
case netmapEigenTrustAlphaKey: case netmapEigenTrustAlphaKey:
_, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (str)\n", k, v))) _, _ = tw.Write([]byte(fmt.Sprintf("%s:\t%s (str)\n", k, v)))
case netmapHomomorphicHashDisabledKey: case netmapHomomorphicHashDisabledKey, netmapMaintenanceAllowedKey:
vBool, err := tuple[1].TryBool() vBool, err := tuple[1].TryBool()
if err != nil { if err != nil {
return invalidConfigValueErr(k) return invalidConfigValueErr(k)
@ -168,7 +168,7 @@ func parseConfigPair(kvStr string, force bool) (key string, val interface{}, err
} }
val = valRaw val = valRaw
case netmapHomomorphicHashDisabledKey: case netmapHomomorphicHashDisabledKey, netmapMaintenanceAllowedKey:
val, err = strconv.ParseBool(valRaw) val, err = strconv.ParseBool(valRaw)
if err != nil { if err != nil {
err = fmt.Errorf("could not parse %s's value '%s' as bool: %w", key, valRaw, err) err = fmt.Errorf("could not parse %s's value '%s' as bool: %w", key, valRaw, err)

View File

@ -60,6 +60,7 @@ const (
netmapInnerRingCandidateFeeKey = "InnerRingCandidateFee" netmapInnerRingCandidateFeeKey = "InnerRingCandidateFee"
netmapWithdrawFeeKey = "WithdrawFee" netmapWithdrawFeeKey = "WithdrawFee"
netmapHomomorphicHashDisabledKey = "HomomorphicHashingDisabled" netmapHomomorphicHashDisabledKey = "HomomorphicHashingDisabled"
netmapMaintenanceAllowedKey = "MaintenanceModeAllowed"
defaultEigenTrustIterations = 4 defaultEigenTrustIterations = 4
defaultEigenTrustAlpha = "0.1" defaultEigenTrustAlpha = "0.1"
@ -550,6 +551,7 @@ func (c *initializeContext) getContractDeployData(ctrName string, keysParam []in
netmapInnerRingCandidateFeeKey, viper.GetInt64(candidateFeeInitFlag), netmapInnerRingCandidateFeeKey, viper.GetInt64(candidateFeeInitFlag),
netmapWithdrawFeeKey, viper.GetInt64(withdrawFeeInitFlag), netmapWithdrawFeeKey, viper.GetInt64(withdrawFeeInitFlag),
netmapHomomorphicHashDisabledKey, viper.GetBool(homomorphicHashDisabledInitFlag), netmapHomomorphicHashDisabledKey, viper.GetBool(homomorphicHashDisabledInitFlag),
netmapMaintenanceAllowedKey, viper.GetBool(maintenanceModeAllowedInitFlag),
} }
items = append(items, items = append(items,
c.Contracts[balanceContract].Hash, c.Contracts[balanceContract].Hash,

View File

@ -29,6 +29,7 @@ const (
candidateFeeInitFlag = "network.fee.candidate" candidateFeeInitFlag = "network.fee.candidate"
candidateFeeCLIFlag = "candidate-fee" candidateFeeCLIFlag = "candidate-fee"
homomorphicHashDisabledInitFlag = "network.homomorphic_hash_disabled" homomorphicHashDisabledInitFlag = "network.homomorphic_hash_disabled"
maintenanceModeAllowedInitFlag = "network.maintenance_mode_allowed"
homomorphicHashDisabledCLIFlag = "homomorphic-disabled" homomorphicHashDisabledCLIFlag = "homomorphic-disabled"
withdrawFeeInitFlag = "network.fee.withdraw" withdrawFeeInitFlag = "network.fee.withdraw"
withdrawFeeCLIFlag = "withdraw-fee" withdrawFeeCLIFlag = "withdraw-fee"