Fix epoch metric #773

Merged
fyrchik merged 1 commit from dstepanov-yadro/frostfs-node:fix/epoch_metric into master 2023-11-01 10:57:32 +00:00

metricsCollector was assigned before initialization, so epoch metric wasn't updated.

Closes #764

`metricsCollector` was assigned before initialization, so epoch metric wasn't updated. Closes #764
fyrchik approved these changes 2023-11-01 10:04:23 +00:00
fyrchik reviewed 2023-11-01 10:07:01 +00:00
@ -561,3 +560,4 @@
c.shared = initShared(appCfg, key, netState, relayOnly)
netState.metrics = c.metricsCollector
Owner

So we partially initialize netState because we need it in initShared and then finalize netState initialization.
The same problem with metrics can happen inside initShared
To me the problem is that initialization order in code does not match real order.
What about initializing metrics first somewhere? Or is it too much work?

So we partially initialize `netState` because we need it in `initShared` and then finalize `netState` initialization. The same problem with metrics can happen inside `initShared` To me the problem is that initialization order in code does not match real order. What about initializing metrics first somewhere? Or is it too much work?
Author
Member

shared holds metrics, so looks like metrics are initialized correctly. Also cfgNetmap holds netstate, so it also looks ok for me. So i don't think it should be refactored.

`shared` holds metrics, so looks like metrics are initialized correctly. Also `cfgNetmap` holds `netstate`, so it also looks ok for me. So i don't think it should be refactored.
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed fix/epoch_metric from 6a91c18f78 to 616aafc494 2023-11-01 10:45:28 +00:00 Compare
fyrchik requested review from storage-core-developers 2023-11-01 10:49:48 +00:00
fyrchik requested review from storage-core-committers 2023-11-01 10:49:50 +00:00
fyrchik merged commit c7a7229484 into master 2023-11-01 10:57:32 +00:00
acid-ant approved these changes 2023-11-01 14:07:13 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-developers
No milestone
No project
No assignees
3 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#773
No description provided.