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

Use ExternalAddr attribute for inter-node communication #1817

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Sep 27, 2022

No description provided.

@codecov
Copy link

codecov bot commented Sep 27, 2022

Codecov Report

Merging #1817 (7c26df5) into master (2e3ef81) will decrease coverage by 0.11%.
The diff coverage is 0.00%.

❗ Current head 7c26df5 differs from pull request most recent head c0dc2be. Consider uploading reports for the commit c0dc2be to get more accurate results

@@            Coverage Diff             @@
##           master    #1817      +/-   ##
==========================================
- Coverage   31.06%   30.95%   -0.12%     
==========================================
  Files         374      372       -2     
  Lines       26377    25882     -495     
==========================================
- Hits         8195     8012     -183     
+ Misses      17492    17194     -298     
+ Partials      690      676      -14     
Impacted Files Coverage Δ
pkg/network/validation.go 73.91% <0.00%> (-7.04%) ⬇️
pkg/local_object_storage/engine/info.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/local_object_storage/writecache/put.go 0.00% <0.00%> (-65.86%) ⬇️
pkg/local_object_storage/writecache/state.go 33.33% <0.00%> (-42.43%) ⬇️
pkg/local_object_storage/writecache/options.go 28.57% <0.00%> (-28.58%) ⬇️
pkg/local_object_storage/writecache/flush.go 23.01% <0.00%> (-24.66%) ⬇️
pkg/local_object_storage/shard/mode.go 92.00% <0.00%> (-8.00%) ⬇️
pkg/local_object_storage/engine/shards.go 66.29% <0.00%> (-2.65%) ⬇️
pkg/local_object_storage/shard/shard.go 71.17% <0.00%> (-1.98%) ⬇️
pkg/local_object_storage/engine/control.go 69.41% <0.00%> (-1.36%) ⬇️
... and 25 more

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

acid-ant
acid-ant previously approved these changes Sep 27, 2022
Copy link
Member

@carpawell carpawell left a comment

Choose a reason for hiding this comment

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

Commit format, CHANGELOG.

@@ -17,12 +17,15 @@ func (x Node) PublicKey() []byte {
// IterateAddresses iterates over all announced network addresses
// and passes them into f. Handler MUST NOT be nil.
func (x Node) IterateAddresses(f func(string) bool) {
for _, addr := range (netmap.NodeInfo)(x).ExternalAddresses() {
Copy link
Contributor

Choose a reason for hiding this comment

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

So firstly we are going to process external addresses everywhere, is it expected for intra-container communication? I thought "old" addresses are preferred for this purpose.

@cthulhu-rider
Copy link
Contributor

cthulhu-rider commented Sep 28, 2022

@fyrchik are you sure you've covered all the needed places? I see a few more places of NumberOfNetworkEndpoints and IterateNetworkEndpoints.

pkg/core/netmap.Node type was borned to become a complete type mediator for SDK netmap.NodeInfo, but we haven't finished the job yet. Lets do it within a separate issue?

@realloc
Copy link

realloc commented Sep 28, 2022

IIRC, the ExternalAddr attribute should be used for client (sdk?) connections to nodes. For inter-node communication we have to use addressed from netmap and use ExternalAddr as a fallback only, if there is an option allowing such behaviour.

@fyrchik
Copy link
Contributor Author

fyrchik commented Sep 28, 2022

There are 3 different approaches:

  1. Don't touch the address structure, and decide if we want to use external addressses on the callsite (client cache).
  2. Modify network.Address to have external field and take it into account during sorting.
  3. Filter external addresses during placement.Node construction.

I decided to go with the first, because this way there are fewer places with filtering logic, so less bugs. Also, it will be easier to change allow_external setting on SIGHUP.

@@ -6,7 +6,7 @@ Changelog for NeoFS Node
### Added
- Serving `NetmapService.NetmapSnapshot` RPC (#1793)
- `netmap snapshot` command of NeoFS CLI (#1793)

- `apiclient.allow_external` config flag to fallback to node external addresses (#1817)
Copy link
Member

Choose a reason for hiding this comment

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

do we need to add that to the Update from... section 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.

I think no, it is a completely new feature, old nodes are expected to continue working.

Copy link
Member

Choose a reason for hiding this comment

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

yes, but how will an admin know about that? i try to write any config changes to that section. but ok

Copy link

Choose a reason for hiding this comment

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

I suggest adding this to Update section. With new behaviour node admins can explicitly declare external addresses for their node, not only listen corresponding addresses.

Copy link
Contributor Author

@fyrchik fyrchik Oct 4, 2022

Choose a reason for hiding this comment

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

Yes, but do we need Added section in this case? Every added feature can be used in some way, I've thought Updating from was for things requiring special care.
Fixed anyway.

Copy link

Choose a reason for hiding this comment

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

If we need Ops attention, we add/duplicate something in Updating from. For this particular case we need to highlight it.

pkg/core/client/client.go Outdated Show resolved Hide resolved
pkg/core/netmap/nodes.go Outdated Show resolved Hide resolved
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
carpawell
carpawell previously approved these changes Oct 4, 2022
…rator

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
@fyrchik fyrchik merged commit 236414d into nspcc-dev:master Oct 4, 2022
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
…rator

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
U3 Regular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants