Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Scalecube based membership #48

Merged
merged 25 commits into from
Nov 12, 2016
Merged

Scalecube based membership #48

merged 25 commits into from
Nov 12, 2016

Conversation

ashwanthkumar
Copy link
Owner

@ashwanthkumar ashwanthkumar commented Oct 7, 2016

Extracting membership implementations as a separate library. I just stumbled upon this library today - Scalecube. I was looking for implementations of Gossip based membership and these guys implement SWIM in that library.

I took this opportunity to remove atomix also from the core and added it as a separate module.

@brewkode This is also making making baby steps towards rebalancing ( #49 ) following the progress on #43

This is awesome, while the tests work locally it fails sometimes on SnapCI because of the default Gossip settings. The fact that gossip isn't as relaiable and consistent as Atomix is a proof that this works.
- Removed the Member case class, it was not serving any use whatsoever
- Refactored both AtomixMembership + ScalecubeMembership for the new contract
- Reduced the Gossip interval for tests to see if it helps during SnapCI Builds
@ashwanthkumar
Copy link
Owner Author

This is kinda sad, that Cluster doesn't seem to converge even after 60 seconds on SnapCI for Scalecube based membership. Not sure what's going wrong, and I'm not able to reproduce it locally either. For now I've disabled the IntegrationTest. Will look into it further.

@codecov-io
Copy link

codecov-io commented Oct 8, 2016

Current coverage is 74.22% (diff: 80.89%)

Sunburst

No coverage report found for master at 0df596a.

Powered by Codecov. Last update 0df596a...c2cdddc

After learning about rxJava and scalecube more
@ashwanthkumar
Copy link
Owner Author

Fixed the test issue for ScaleCube on SnapCI.

@ashwanthkumar
Copy link
Owner Author

@brewkode please give this a look but don't merge it yet, I'm trying to take a first stab at #20 as part of this.

TLDR;
- Change contracts in Membership abstract class with scaladocs
- Adding MemberListener
- Bootstrapper -> SeedProvider - changed the names as it was confusing to use
- Integrated the new Membership contract with Atomix + ScaleCube implementations + fixing the tests too

MemberListener are pluggable event listeners to changes in membership. This allows us to write composable components like how should ConsistentHashRing react to new nodes or exit of an existing nodes in the cluster.

Membership implementations should just plug `onJoin` and `onLeave` methods in Membership to the actual membership events in the cluster. Membership would take care of calling all the event listeners in order with MemberAddress of the node that has the respective event.
… be just generated code + samples

Enable it back if you feel we're writing more code in it which isn't generated
Cluster brings the notion of a distributed system much more than Membership. Also update the module names to have cluster, suuchi-membership-* -> suuchi-clustre-*
@ashwanthkumar
Copy link
Owner Author

ashwanthkumar commented Oct 9, 2016

Timing of this Tweet! Wow!

https://twitter.com/kellabyte/status/784952690946080768

How do SWIM implementations that do consistent hashing with vnodes assign vnode partitions when there’s no master or consensus?

ClusterProvider uses ServiceLoader to load the actual implementation at runtime. This way we can keep the implementations outside and just provide stubs in the suuchi-core module.
Conflicts:
	suuchi-core/src/main/scala/in/ashwanthkumar/suuchi/rpc/Server.scala
@ashwanthkumar
Copy link
Owner Author

@brewkode I think we should merge this branch of take some features like extracting atomix out of the core and move back to JDK7, since most of our internal infra is still on JDK7. Especially the MR cluster.

Conflicts:
	suuchi-core/src/main/scala/in/ashwanthkumar/suuchi/partitioner/PartitionNode.scala
@ashwanthkumar
Copy link
Owner Author

We might need a config file based Membership provider in the core.

</parent>

<properties>
<log4j.version>2.6.2</log4j.version>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Do we need this?

</parent>

<properties>
<log4j.version>2.6.2</log4j.version>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Similarly do we need this in here?

@ashwanthkumar
Copy link
Owner Author

@brewkode Please start having a look at this when you've time.

cc: @gsriram7

@ashwanthkumar
Copy link
Owner Author

Merging this in. Will continue to work on the feedback through another PR.

@ashwanthkumar ashwanthkumar merged commit 9b68e18 into master Nov 12, 2016
@ashwanthkumar ashwanthkumar deleted the scalecube-membership branch November 12, 2016 10:58
@ashwanthkumar ashwanthkumar added this to the 0.2 milestone Jun 3, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants