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

NetworkDB create NodeID for cluster nodes #1936

Merged
merged 1 commit into from
Sep 28, 2017

Conversation

fcrisciani
Copy link

Separate the hostname from the node identifier. All the messages
that are exchanged on the network are containing a nodeName field
that today was hostname-uniqueid. Now being encoded as strings in
the protobuf without any length restriction they plays a role
on the effieciency of protocol itself. If the hostname is very long
the overhead will increase and will degradate the performance of
the database itself that each single cycle by default allows 1400
bytes payload

Signed-off-by: Flavio Crisciani flavio.crisciani@docker.com

@fcrisciani fcrisciani force-pushed the netdb-nodeid branch 4 times, most recently from e940235 to dca40c7 Compare September 11, 2017 20:21
@codecov-io
Copy link

codecov-io commented Sep 11, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@0f08d31). Click here to learn what that means.
The diff coverage is 82.6%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1936   +/-   ##
=========================================
  Coverage          ?   37.93%           
=========================================
  Files             ?      137           
  Lines             ?    27289           
  Branches          ?        0           
=========================================
  Hits              ?    10351           
  Misses            ?    15667           
  Partials          ?     1271
Impacted Files Coverage Δ
agent.go 5.83% <ø> (ø)
networkdb/broadcast.go 83.63% <100%> (ø)
networkdb/cluster.go 45.7% <64.28%> (ø)
networkdb/delegate.go 70.25% <83.33%> (ø)
networkdb/networkdb.go 60.22% <90%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f08d31...4427afb. Read the comment docs.

Copy link
Contributor

@mavenugo mavenugo left a comment

Choose a reason for hiding this comment

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

How will this change impact a mixed cluster with existing nodes still using the NodeName to identify a node while an existing node upgraded with this change will be looking and populating nodeID field in the networkDB message ?

Will it have any impact ?

@@ -140,7 +140,7 @@ func (nDB *NetworkDB) handleNetworkEvent(nEvent *NetworkEvent) bool {
nDB.Lock()
defer nDB.Unlock()

if nEvent.NodeName == nDB.config.NodeName {
if nEvent.NodeName == nDB.config.NodeID {
Copy link
Contributor

Choose a reason for hiding this comment

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

Especially such changes where previously learnt messages from a node (prior to upgrading with this change) would have used NodeName in the messages. After the upgraded software, this node will be using NodeID, while the previous states maintained by the peers will still have the older states with the nodeName. And this check will fail, which is not expected.

@fcrisciani
Copy link
Author

discussed offline with @mavenugo, in the commit there is no change in the protobuf but only in the local variables, also every restart/upgrade the nodes are always using unique identifiers.
Old version nodes, will be identified by a longer name: -
Newer nodes will be identified by:

Separate the hostname from the node identifier. All the messages
that are exchanged on the network are containing a nodeName field
that today was hostname-uniqueid. Now being encoded as strings in
the protobuf without any length restriction they plays a role
on the effieciency of protocol itself. If the hostname is very long
the overhead will increase and will degradate the performance of
the database itself that each single cycle by default allows 1400
bytes payload

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
Copy link
Contributor

@mavenugo mavenugo left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants