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

node: Serve NetmapService.NetmapSnapshot RPC #1793

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

cthulhu-rider
Copy link
Contributor

There is no more need to serve the same request on Control API.

@cthulhu-rider cthulhu-rider self-assigned this Sep 17, 2022
@codecov
Copy link

codecov bot commented Sep 17, 2022

Codecov Report

Merging #1793 (9509db4) into master (c7f8599) will increase coverage by 0.24%.
The diff coverage is 38.46%.

❗ Current head 9509db4 differs from pull request most recent head 0e7bc5d. Consider uploading reports for the commit 0e7bc5d to get more accurate results

@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
+ Coverage   33.41%   33.66%   +0.24%     
==========================================
  Files         352      352              
  Lines       23962    23737     -225     
==========================================
- Hits         8008     7991      -17     
+ Misses      15287    15081     -206     
+ Partials      667      665       -2     
Impacted Files Coverage Δ
pkg/morph/client/netmap/netmap.go 20.21% <0.00%> (-0.67%) ⬇️
pkg/services/control/convert.go 0.00% <ø> (ø)
pkg/services/control/ir/service.pb.go 22.42% <ø> (ø)
pkg/services/control/ir/service_grpc.pb.go 0.00% <ø> (ø)
pkg/services/control/ir/types.pb.go 35.00% <ø> (ø)
pkg/services/control/rpc.go 0.00% <ø> (ø)
pkg/services/control/service.go 20.73% <ø> (-1.25%) ⬇️
pkg/services/control/service.pb.go 8.24% <ø> (-0.34%) ⬇️
pkg/services/control/service_grpc.pb.go 0.00% <ø> (ø)
pkg/services/control/service_neofs.pb.go 11.26% <ø> (-0.55%) ⬇️
... and 9 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this pull request Sep 22, 2022
There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this pull request Sep 22, 2022
There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
cthulhu-rider pushed a commit to cthulhu-rider/neofs-node that referenced this pull request Sep 22, 2022
There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
@cthulhu-rider cthulhu-rider marked this pull request as ready for review September 22, 2022 08:33
acid-ant
acid-ant previously approved these changes Sep 22, 2022
fyrchik
fyrchik previously approved these changes Sep 22, 2022
CHANGELOG.md Outdated Show resolved Hide resolved
netMap atomicstd.Value // type netmap.NetMap
}

func (c *cfg) ProcessCurrentNetMap(f func(netmap.NetMap)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just getter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need is to perform exact single action. We could implement it as a getter, doesn' matter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also think CurrentNetmap() netmap.NetMap is simpler to read and use.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally I've decided to leave netmap service package a dummy message constructor. All the business logic is implemented on application side. 0e7bc5d

There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
…map reader

Replace `ProcessCurrentNetMap` method of `NodeState` interface with
`ReadCurrentNetMap` one with two changes:
 * Replace network map type from NeoFS SDK package with the
   protocol-generated message. This replaces all the business logic to
   the application layer.
 * Support error return. This allows to cover problem node states.

Return an error from `NodeState.ReadCurrentNetMap` method implemeted
through `atomic.Value` if `Store` method has not been called yet.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
@fyrchik fyrchik merged commit 93742d3 into nspcc-dev:master Sep 27, 2022
@cthulhu-rider cthulhu-rider deleted the feature/netmap-snapshot branch September 30, 2022 13:25
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
There is no more need to serve the same request on Control API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
…map reader

Replace `ProcessCurrentNetMap` method of `NodeState` interface with
`ReadCurrentNetMap` one with two changes:
 * Replace network map type from NeoFS SDK package with the
   protocol-generated message. This replaces all the business logic to
   the application layer.
 * Support error return. This allows to cover problem node states.

Return an error from `NodeState.ReadCurrentNetMap` method implemeted
through `atomic.Value` if `Store` method has not been called yet.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants