Comments (5)
Here the guess was almost correct, with small correction. All gossips spread very fast, all gossips about update come to the remote node sooner that the node 2 completes the first call to fetch metadata.
from scalecube-cluster.
The attempt to avoid the extra calls that is based on incarnationsis as follows: inside metadata we store it's version(incarnation). Any time we receive gossib that notifies about member update - we compare membershipEvent's incarnation to the incarnation for which we have stored metadata.
Make call to fetch metadata if only incarnation in membershipEvent is higher that the one in metadata.
from scalecube-cluster.
D 0008:59,103 i.s.c.m.MetadataStoreImpl Updated metadata: {key=0, incarnation=1} for local member ([email protected]:55103) [sc-cluster-55103-1] D 0008:59,104 i.s.c.m.MetadataStoreImpl Updated metadata: {key=1, incarnation=2} for local member ([email protected]:55103) [sc-cluster-55103-1] D 0008:59,104 i.s.c.m.MetadataStoreImpl Updated metadata: {key=2, incarnation=3} for local member ([email protected]:55103) [sc-cluster-55103-1] D 0008:59,105 i.s.c.m.MetadataStoreImpl Updated metadata: {key=3, incarnation=4} for local member ([email protected]:55103) [sc-cluster-55103-1] D 0008:59,105 i.s.c.m.MetadataStoreImpl Updated metadata: {key=4, incarnation=5} for local member ([email protected]:55103) [sc-cluster-55103-1]
At remote member:
I 0008:59,162 i.s.c.m.MembershipProtocolImpl Member updated: [email protected]:55103(1). Currently stored metadata for it: 0 [sc-cluster-55104-2] D 0008:59,163 i.s.c.m.MetadataStoreImpl Getting metadata for member [email protected]:55103 [sc-cluster-55104-2] I 0008:59,163 i.s.c.m.MembershipProtocolImpl Member updated: [email protected]:55103(2). Currently stored metadata for it: 0 [sc-cluster-55104-2] D 0008:59,164 i.s.c.m.MetadataStoreImpl Getting metadata for member [email protected]:55103 [sc-cluster-55104-2] I 0008:59,164 i.s.c.m.MembershipProtocolImpl Member updated: [email protected]:55103(3). Currently stored metadata for it: 0 [sc-cluster-55104-2] D 0008:59,165 i.s.c.m.MetadataStoreImpl Getting metadata for member [email protected]:55103 [sc-cluster-55104-2]
Here we see that all calls to fetch metadata were made at the moment we had the very old version of metadata (incarnation 0). That's according to the algorithm. But doesn't fix the issue.
from scalecube-cluster.
What might be done to avoid extra calls but maybe doesn't worth it:
Don't notify the cluster about too requent metadata updates. Instead - collect frequent updates in batches (based on some timeframe) and create just one incarnation for the batch of updates.
This will reduce not only number of RPC-s from all the members (but local) in cluster to fetch metadata (one per property update), but also number of member update events.
from scalecube-cluster.
Agreed to close. Thanks for such deep investigation @snripa .
from scalecube-cluster.
Related Issues (20)
- Add jackson smile
- Upgrade to Jackson 2.10.0 HOT 3
- Unstable testNodeJoinClusterWithNoInboundThenInboundRecover HOT 1
- Fix CI-CD
- Java 8 support problem HOT 1
- Wrong usage of concatDelayError() HOT 1
- Socket-leak when failed to est. connection HOT 1
- Cluster doesn't have 'joinAwait' method as example in README
- Any plan to sync artifacts to Maven Central repository? HOT 1
- Compatible with Reactor Netty 1.0.0 HOT 2
- clusterConfig.externalPort 设置端口号是干嘛的?实际 transport启动端口号并不是externalPort设置的
- clusterConfig.externalPort What's the purpose of setting the port number? The actual transport startup port number is not set by externalport
- Ordering HOT 3
- Add protobuf message codec
- Align configuration types to common style
- Detect non-writeable channel and stop writing to it
- support k8s HOT 1
- Expose member via multiple external hosts
- Get rid of pluggable MessageCodec/MetadataCodec
- Wrong response message when using "requestResponse" method (send message to self). HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalecube-cluster.