-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add ability to use Gossip strategy #59
Comments
Great suggestion! |
@beardedeagle are you able to confirm Kamil's workaround above should work? Are there cases we should be aware of, where that workaround would not work? |
Is not so easy, normally when you use Gossip strategy is because you add/remove nodes without the need to know them in advance. Passing Node.list() will work only when the multicast discovery of the Gossip strategy has finished connecting nodes. And still you cannot add nodes later, at least not easily. Maybe the correct way is to ignore any predefined nodes list, listen for Or just create your own Genserver that listens to nodes events and when you have a quorum, start mnesiac using Node.list(). jm2c |
Hrm, I have some thoughts on how this should be handled, but need to mull them over for the night or so before I'm ready to commit to a specific method and put hands to keyboard. Unfortunately, the solution won't be as simple as using |
Thanks! Looking forward to see any solution for that. Feel free to ask for any help if needed. |
Alright, apologies, poor work/life balance has lead to some priorities slipping. Getting back to this, and I can see two strategies (much like @xadhoom mentioned): a) have mnesiac wait until gossip quorum is achieved, then start mnesia with nodes in quorum. this can be achieved relatively easily, however it would only work for a static gossip cluster, without the ability for dynamic membership, and even then conflict resolution comes into play. b) have mnesiac allow for nodes to be added dynamically, but this entails ensuring mnesia is properly handled during these events which could lead to loss of data during handling due to how mnesia is designed. This could be solved via queuing, etc. But again, conflict resolution comes into play. So I think before we can solve for true dynamic membership, we first need to solve for conflict resolution of records. I've got idea's on how to handle conflict resolution, both by offering some default strategies and by allowing users to define their own. Even with that though, documentation will be key as this is an area where a ton of foot gunning can come into play. |
We currently use b). |
@KamilLelonek that's how I've used it for a couple of years now too. The issue is I don't have anything built into this library to handle this scenario SAFELY. I instead farmed this functionality out to another library I wrote at my current employer, but am working on having it released to me. That aside, I have several improvements that could be made to that library that I haven't had time to make, that could be folded into this library, or made into another library to accomplish the same thing effectively. |
I'm hoping to wrap up #53 by EOY, then I can focus on this |
Proposal
Allow to use
mnesiac
withCluster.Strategy.Gossip
, i.e. when hosts are not known upfront.Background
Currently, it looks like
hosts
are required when configuringmnesiac
which requires to know them in advance. I'd like to dynamically read them instead of explicitly list in a config.Workarounds
Not sure, but I guess - provide
Node.list/0
ashosts
maybe.The text was updated successfully, but these errors were encountered: