ir: Execute netmap.addPeerIR only for state online #841

Merged
fyrchik merged 2 commits from acid-ant/frostfs-node:bugfix/ir-fix-mm into master 2023-12-11 13:14:43 +00:00
Member

Describe epoch a bit.

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

Describe `epoch` a bit. Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
acid-ant force-pushed bugfix/ir-fix-mm from 9121397cc1 to 64e2960aab 2023-12-05 08:37:22 +00:00 Compare
acid-ant requested review from storage-core-committers 2023-12-05 10:30:19 +00:00
acid-ant requested review from storage-core-developers 2023-12-05 10:30:20 +00:00
fyrchik approved these changes 2023-12-05 13:45:18 +00:00
@ -61,0 +62,4 @@
// But there is no guarantee that code will be executed in the same order.
// That is why we need to perform `addPeerIR` only in case when node is online,
// because in scope of this method, contract set state `ONLINE` for the node.
if updated && nodeInfo.IsOnline() {
Owner

So what happens for Maintenance?

So what happens for `Maintenance`?
Author
Member

This code will be skipped, and node will be updated in handler for NewEpoch. Here fixed an issue with exclusion of the node in MM from netmap.

This code will be skipped, and node will be updated in handler for `NewEpoch`. [Here](https://git.frostfs.info/TrueCloudLab/frostfs-node/pulls/757) fixed an issue with exclusion of the node in MM from netmap.
Owner

So if we update node's attributes, and we are in the maintenance mode, they will only be applied after we go online?

So if we update node's attributes, and we are in the maintenance mode, they will only be applied after we go online?
Author
Member

Right. In other case, node will move to online state by netmap.AddPeerIR.

Right. In other case, node will move to `online` state by [netmap.AddPeerIR](https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/commit/bc3186575ff47b75a811a78ddef3b10869f2d4e2/netmap/netmap_contract.go#L143).
Owner

Could you test this for >20 epoch ticks? (we have 15 snapshots in contract by default, thus 20)
Contract has some logic https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/netmap/netmap_contract.go#L504 , but I am not sure it'll continue to work if ir wont send updates.

Could you test this for >20 epoch ticks? (we have 15 snapshots in contract by default, thus 20) Contract has some logic https://git.frostfs.info/TrueCloudLab/frostfs-contract/src/branch/master/netmap/netmap_contract.go#L504 , but I am not sure it'll continue to work if ir wont send updates.
Author
Member

Tested in dev-env. Set maintenance status:

@:~$ docker inspect s01 | grep Image
            "Image": "truecloudlab/frostfs-dirty-storage:0.37.0-rc.1-144-g05249e6c",
@:~$
@:~$ frostfs-cli control set-status --endpoint s01.frostfs.devenv:8081 --status maintenance --wallet services/storage/wallet01.json 
Network status update request successfully sent.
@:~$ 
@:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch"
Epoch: 1
Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 ONLINE /dns4/s01.frostfs.devenv/tcp/8080
...

Force new epoch:

@:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333
Current epoch: 23, increase to 24.
Waiting for transactions to persist...
@:~$ 
@:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch"
Epoch: 24
Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 
... 
@:~$ 

Stop s01 container and force new epoch:

@:~$ docker stop s01
s01
@:~$ 
@:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch"
Epoch: 25
Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 
...
@:~$
@:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333
Current epoch: 50, increase to 51.
Waiting for transactions to persist...
@:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch"
Epoch: 51
Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 
...
@:~$

Node still in maintenance mode.
Start container and check for node status:

@:~$ docker start s01
s01
@:~$
@:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333
Current epoch: 55, increase to 56.
Waiting for transactions to persist...
@:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch"
Epoch: 56
Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080
...
@:~$ frostfs-cli control healthcheck --endpoint s01.frostfs.devenv:8081 --wallet /home/annikifa/workspace/frostfs-dev-env/services/storage/wallet01.json 
Enter password > 
Network status: MAINTENANCE
Health status: READY
@:~$
Tested in dev-env. Set maintenance status: ``` @:~$ docker inspect s01 | grep Image "Image": "truecloudlab/frostfs-dirty-storage:0.37.0-rc.1-144-g05249e6c", @:~$ @:~$ frostfs-cli control set-status --endpoint s01.frostfs.devenv:8081 --status maintenance --wallet services/storage/wallet01.json Network status update request successfully sent. @:~$ @:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch" Epoch: 1 Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 ONLINE /dns4/s01.frostfs.devenv/tcp/8080 ... ``` Force new epoch: ``` @:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333 Current epoch: 23, increase to 24. Waiting for transactions to persist... @:~$ @:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch" Epoch: 24 Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 ... @:~$ ``` Stop s01 container and force new epoch: ``` @:~$ docker stop s01 s01 @:~$ @:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch" Epoch: 25 Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 ... @:~$ @:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333 Current epoch: 50, increase to 51. Waiting for transactions to persist... @:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch" Epoch: 51 Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 ... @:~$ ``` Node still in maintenance mode. Start container and check for node status: ``` @:~$ docker start s01 s01 @:~$ @:~$ frostfs-adm morph force-new-epoch -c cnt_create_cfg.yml -r http://morph-chain.frostfs.devenv:30333 Current epoch: 55, increase to 56. Waiting for transactions to persist... @:~$ frostfs-cli netmap snapshot -g -r s04.frostfs.devenv:8080 | grep "Node\|Epoch" Epoch: 56 Node 1: 022bb4041c50d607ff871dec7e4cd7778388e0ea6849d84ccbd9aa8f32e16a8131 MAINTENANCE /dns4/s01.frostfs.devenv/tcp/8080 ... @:~$ frostfs-cli control healthcheck --endpoint s01.frostfs.devenv:8081 --wallet /home/annikifa/workspace/frostfs-dev-env/services/storage/wallet01.json Enter password > Network status: MAINTENANCE Health status: READY @:~$ ```
aarifullin approved these changes 2023-12-07 08:19:42 +00:00
acid-ant force-pushed bugfix/ir-fix-mm from 64e2960aab to 4af26a8952 2023-12-07 11:02:05 +00:00 Compare
acid-ant force-pushed bugfix/ir-fix-mm from 4af26a8952 to 05249e6c6b 2023-12-07 14:08:44 +00:00 Compare
acid-ant requested review from storage-core-committers 2023-12-07 14:08:53 +00:00
acid-ant requested review from storage-core-developers 2023-12-07 14:08:55 +00:00
dstepanov-yadro approved these changes 2023-12-08 07:06:46 +00:00
achuprov approved these changes 2023-12-08 09:18:52 +00:00
fyrchik approved these changes 2023-12-11 13:12:49 +00:00
fyrchik reviewed 2023-12-11 13:14:31 +00:00
@ -0,0 +1,43 @@
# Epoch
Owner

I like the doc! Also, created a #856

I like the doc! Also, created a https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/856
fyrchik merged commit 46532fb9ce into master 2023-12-11 13:14:43 +00:00
fyrchik referenced this pull request from a commit 2023-12-11 13:14:45 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 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#841
No description provided.