innerring: Relax container homomorphic hashing check #1628

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-homorphic-check into master 2025-02-27 08:55:22 +00:00
Owner

Our initial desire was to prohibit using homomorphic hashing on the
network level because of the resource consumption. However, the ability
to use it, doesn't mean that we must. So only fail validation if
container wants to have homomorphic hashing, but the network prohibits
it.

For testing I have used custom frostfs-cli build

diff --git a/cmd/frostfs-cli/modules/container/create.go b/cmd/frostfs-cli/modules/container/create.go
index 30f9951807..585d43ddef 100644
--- a/cmd/frostfs-cli/modules/container/create.go
+++ b/cmd/frostfs-cli/modules/container/create.go
@@ -101,12 +101,12 @@ It will be stored in sidechain when inner ring will accepts it.`,
 
 		cnr.SetPlacementPolicy(*placementPolicy)
 
-		var syncContainerPrm internalclient.SyncContainerPrm
-		syncContainerPrm.SetClient(cli)
-		syncContainerPrm.SetContainer(&cnr)
+		// var syncContainerPrm internalclient.SyncContainerPrm
+		// syncContainerPrm.SetClient(cli)
+		// syncContainerPrm.SetContainer(&cnr)
 
-		_, err = internalclient.SyncContainerSettings(cmd.Context(), syncContainerPrm)
-		commonCmd.ExitOnErr(cmd, "syncing container's settings rpc error: %w", err)
+		// _, err = internalclient.SyncContainerSettings(cmd.Context(), syncContainerPrm)
+		// commonCmd.ExitOnErr(cmd, "syncing container's settings rpc error: %w", err)
 
 		putPrm := internalclient.PutContainerPrm{
 			Client: cli,

Testing done:

$ frostfs-adm -c frostfs-adm.yml morph set-config HomomorphicHashingDisabled=false
Waiting for transactions to persist...

$ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await
Enter password >
CID: CwmVmPwCai3SEJHrvnmKxBP2qqq9wwtZidE6zWay5CcC
awaiting...
container has been persisted on sidechain

$ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await -a  __SYSTEM__DISABLE_HOMOMORPHIC_HASHING=true
Enter password >
CID: 7rxWFLp1AP6VyJgejmG2eWbqrNFLRbh7TRf3Kbq1JC38
awaiting...
container has been persisted on sidechain

$ frostfs-adm -c frostfs-adm.yml morph set-config HomomorphicHashingDisabled=true
Waiting for transactions to persist...

$ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await
Enter password >
CID: CqrKPx6krr3j1EsB99PREwGBNR5QGKMpkAYqZge9LRtT
awaiting...
timeout: container has not been persisted on sidechain

$ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await -a  __SYSTEM__DISABLE_HOMOMORPHIC_HASHING=true
Enter password >
CID: 59hSL4sxVZLyLNqcKRUpGSws6r2nPwBDzoFocj3wMC3R
awaiting...
container has been persisted on sidechain
Our initial desire was to prohibit using homomorphic hashing on the network level because of the resource consumption. However, the ability to use it, doesn't mean that we must. So only fail validation if container wants to have homomorphic hashing, but the network prohibits it. For testing I have used custom frostfs-cli build ```diff diff --git a/cmd/frostfs-cli/modules/container/create.go b/cmd/frostfs-cli/modules/container/create.go index 30f9951807..585d43ddef 100644 --- a/cmd/frostfs-cli/modules/container/create.go +++ b/cmd/frostfs-cli/modules/container/create.go @@ -101,12 +101,12 @@ It will be stored in sidechain when inner ring will accepts it.`, cnr.SetPlacementPolicy(*placementPolicy) - var syncContainerPrm internalclient.SyncContainerPrm - syncContainerPrm.SetClient(cli) - syncContainerPrm.SetContainer(&cnr) + // var syncContainerPrm internalclient.SyncContainerPrm + // syncContainerPrm.SetClient(cli) + // syncContainerPrm.SetContainer(&cnr) - _, err = internalclient.SyncContainerSettings(cmd.Context(), syncContainerPrm) - commonCmd.ExitOnErr(cmd, "syncing container's settings rpc error: %w", err) + // _, err = internalclient.SyncContainerSettings(cmd.Context(), syncContainerPrm) + // commonCmd.ExitOnErr(cmd, "syncing container's settings rpc error: %w", err) putPrm := internalclient.PutContainerPrm{ Client: cli, ``` Testing done: ``` $ frostfs-adm -c frostfs-adm.yml morph set-config HomomorphicHashingDisabled=false Waiting for transactions to persist... $ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await Enter password > CID: CwmVmPwCai3SEJHrvnmKxBP2qqq9wwtZidE6zWay5CcC awaiting... container has been persisted on sidechain $ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await -a __SYSTEM__DISABLE_HOMOMORPHIC_HASHING=true Enter password > CID: 7rxWFLp1AP6VyJgejmG2eWbqrNFLRbh7TRf3Kbq1JC38 awaiting... container has been persisted on sidechain $ frostfs-adm -c frostfs-adm.yml morph set-config HomomorphicHashingDisabled=true Waiting for transactions to persist... $ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await Enter password > CID: CqrKPx6krr3j1EsB99PREwGBNR5QGKMpkAYqZge9LRtT awaiting... timeout: container has not been persisted on sidechain $ frostfs-cli container create -w ../dev-env/wallets/wallet.json -r s01.frostfs.devenv:8080 --policy 'REP 1' --await -a __SYSTEM__DISABLE_HOMOMORPHIC_HASHING=true Enter password > CID: 59hSL4sxVZLyLNqcKRUpGSws6r2nPwBDzoFocj3wMC3R awaiting... container has been persisted on sidechain ```
fyrchik added 1 commit 2025-01-30 13:29:55 +00:00
innerring: Relax container homomorphic hashing check
Some checks failed
DCO action / DCO (pull_request) Failing after 36s
Vulncheck / Vulncheck (pull_request) Successful in 53s
Build / Build Components (pull_request) Successful in 1m23s
Pre-commit hooks / Pre-commit (pull_request) Successful in 1m25s
Tests and linters / gopls check (pull_request) Successful in 2m35s
Tests and linters / Tests with -race (pull_request) Successful in 3m16s
Tests and linters / Run gofumpt (pull_request) Successful in 4m33s
Tests and linters / Lint (pull_request) Successful in 4m46s
Tests and linters / Staticcheck (pull_request) Successful in 4m55s
Tests and linters / Tests (pull_request) Successful in 5m24s
b8659dfd53
Our initial desire was to prohibit using homomorphic hashing on the
network level because of the resource consumption. However, the ability
to use it, doesn't mean that we must. So only fail validation if
container wants to have homomorphic hashing, but the network prohibits
it.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
requested reviews from storage-core-committers, storage-core-developers 2025-01-30 13:29:55 +00:00
fyrchik changed title from innerring: Relax container homomorphic hashing check to WIP: innerring: Relax container homomorphic hashing check 2025-01-30 13:30:10 +00:00
fyrchik force-pushed fix-homorphic-check from b8659dfd53 to 38216ba8ba 2025-02-27 07:05:25 +00:00 Compare
fyrchik added this to the v0.45.0 milestone 2025-02-27 07:08:07 +00:00
fyrchik force-pushed fix-homorphic-check from 38216ba8ba to 003d568ae2 2025-02-27 07:20:14 +00:00 Compare
fyrchik changed title from WIP: innerring: Relax container homomorphic hashing check to innerring: Relax container homomorphic hashing check 2025-02-27 07:20:16 +00:00
requested review from orikik 2025-02-27 07:20:28 +00:00
aarifullin approved these changes 2025-02-27 07:47:21 +00:00
elebedeva approved these changes 2025-02-27 07:54:17 +00:00
acid-ant approved these changes 2025-02-27 07:59:07 +00:00
fyrchik merged commit 003d568ae2 into master 2025-02-27 08:55:22 +00:00
fyrchik deleted branch fix-homorphic-check 2025-02-27 08:55:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
4 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#1628
No description provided.