Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can create container with wrong policy that doesn't work after that on put #1704

Closed
alexchetaev opened this issue Aug 18, 2022 · 6 comments · Fixed by #1842 or #1827
Closed

Can create container with wrong policy that doesn't work after that on put #1704

alexchetaev opened this issue Aug 18, 2022 · 6 comments · Fixed by #1842 or #1827
Assignees
Labels
blocked Can't be done because of something bug Something isn't working enhancement Improving existing functionality neofs-cli NeoFS CLI application issues U4 Nothing urgent

Comments

@alexchetaev
Copy link

alexchetaev commented Aug 18, 2022

Steps

  • Create container by command: neofs-cli --rpc-endpoint 172.26.160.159:8080 -w /etc/neofs/storage/wallet.json container create --policy "REP 1 IN LOC_MOW SELECT 1 FROM LOC_MOW FILTER 'UN-LOCODE' EQ 'RU MOW' AS LOC_MOW"
  • Try to put object to new container: neofs-cli --rpc-endpoint 172.26.160.159:8080 -w /etc/neofs/storage/wallet.json object put --file /tmp/object.sample --cid CTw3xRmXHYvvpTK5ECx8uZbaBDd7oJmJANLa8JRZDSch

Expected result
We can't create container with wrong policy

Current behaviour
We can create container but can't put object to it after that.

root@az:~# neofs-cli --rpc-endpoint 172.26.160.159:8080 -w /etc/neofs/storage/wallet.json container create --policy "REP 1 IN LOC_MOW SELECT 1 FROM LOC_MOW FILTER 'UN-LOCODE' EQ 'RU MOW' AS LOC_MOW" Enter password > container ID: CTw3xRmXHYvvpTK5ECx8uZbaBDd7oJmJANLa8JRZDSch root@az:~# neofs-cli --rpc-endpoint 172.26.160.159:8080 -w /etc/neofs/storage/wallet.json object put --file /tmp/object.sample --cid CTw3xRmXHYvvpTK5ECx8uZbaBDd7oJmJANLa8JRZDSch Enter password > 13578240 / 135266304 [=============>----------------------------------------------------------------------------------------------------------------------------] 10.04% 1s rpc error: client failure: status: code = 1024 message = selector not found: REPLICA 'LOC_MOW'

root@az:~# neofs-cli --endpoint localhost:8091 -w /etc/neofs/storage/wallet.json control netmap-snapshot
Enter password >
Epoch: 146
Node 1: s2vW4EGK7MeLo25Xko84UM9br6rThhQ1SUsuuBvtn5C7 ONLINE [/dns4/node1.neofs/tcp/8080]
Continent: Europe
Country: Russia
CountryCode: RU
Deployed: YACZROKH
Location: Moskva
Price: 10
SubDiv: Moskva
SubDivCode: MOW
UN-LOCODE: RU MOW
Node 2: v8UZzuh1h3ztah8yy6yFWju2ANcggDP9PFs4rMfi3TjE ONLINE [/dns4/node2.neofs/tcp/8080]
Continent: Europe
Country: Russia
CountryCode: RU
Deployed: YACZROKH
Location: Saint Petersburg (ex Leningrad)
Price: 10
SubDiv: Sankt-Peterburg
SubDivCode: SPE
UN-LOCODE: RU LED
Node 3: 26nMT18EeporTymzapViVjRpttNsqcXAbNnhUXp69PLwW ONLINE [/dns4/node4.neofs/tcp/8080]
Continent: Europe
Country: Finland
CountryCode: FI
Deployed: YACZROKH
Location: Helsinki (Helsingfors)
Price: 10
SubDiv: Uusimaa
SubDivCode: 18
UN-LOCODE: FI HEL

@alexchetaev alexchetaev added bug Something isn't working triage labels Aug 18, 2022
@cthulhu-rider
Copy link
Contributor

Container creation is detached from the network state completely. Placement policy is an unchanged operator over network map sets, so described scenario is completely valid. The creator can't predict can network satisfy his placement rules or not. Another example: one can create a container with "valid" policy which won't work after the epoch tick.

@alexchetaev alexchetaev added the U4 Nothing urgent label Aug 23, 2022
@fyrchik
Copy link
Contributor

fyrchik commented Aug 29, 2022

I think we may try to construct a container in the neofs-cli, failing if we can't. We should be able to remove this behaviour with some (--force) flag.
As an optional feature, we can output the current list of nodes in --verbose mode.

@fyrchik
Copy link
Contributor

fyrchik commented Sep 19, 2022

Also it would be nice to have a separate command to print current nodes in container.

@fyrchik
Copy link
Contributor

fyrchik commented Sep 19, 2022

Blocked by #1793.

@fyrchik
Copy link
Contributor

fyrchik commented Oct 5, 2022

Closed via #1704. Container create can fail if there are no nodes to select from. --force flag allows to ignore this check.

@fyrchik
Copy link
Contributor

fyrchik commented Oct 5, 2022

Reopening for this task #1704 (comment)

aprasolova pushed a commit to aprasolova/neofs-node that referenced this issue Oct 19, 2022
Validate policy before container creation

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this issue Oct 19, 2022
…s for container, grouped by replica (nspcc-dev#1704)

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Can't be done because of something bug Something isn't working enhancement Improving existing functionality neofs-cli NeoFS CLI application issues U4 Nothing urgent
Projects
None yet
4 participants