-
Notifications
You must be signed in to change notification settings - Fork 122
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
Raft - Usage and Production Readiness #7
Comments
Hi Rob! Thanks for your interest. It's is ready for production use. I don't know about all usages of this library by existing users. However, I'm aware about adoption by Wargaming company. They are using this library actively and I have strong feedback. One of the use cases exactly the same as you described: coordination of job execution in cluster where only one node can execute the job at a time. So yes, you're on the right way. Leader election can be used as the form of distributed lock. However, you should choose election timeout carefully. For instance, lower election timeout should not be less than approximate execution time of your job. This assumption guarantees that the leader cannot be re-elected during execution of your job. Otherwise, in theory, you may have two jobs executing in the same time. This is called lease time in the context of distributed locks means the maximum time that the node can hold the lock without lease renewal. Keep in mind, it's software and no one immune from bugs. There a lot of special use cases that I cannot predict. From my side, I'm trying to fix them as fast as possible. PRs are also welcome. |
Hello! I'll make sure to contribute, should need be, but right now I'm just glad to be able to kickstart our initiative with your library. Just one more question, if I may: I'm not sure I found a way to enlist members in the cluster at runtime.
This might be a question with a classic RTFM response 😄 Thank you again. Best, |
It depends on hosting model of your application. If your app is on top of ASP.NET Core then use IConfiguration and yes, it's RTFM-like response. There a lot of articles about ASP.NET Core configuration model. If your app is not based on ASP.NET Core then you can enlist members programmatically as described here. In this case you can choose highly optimized network transport for Raft: TCP or UDP. Read the article carefully because the choice highly depends on particular use. However, when node started it's not possible to add new member to the configuration at runtime. You must inform other nodes about new member and utilize protected members from So what we have:
All these aspects perfectly described in this article. Hope you'll find it helpful. |
One more thing. If you need reliable replication between nodes then you need to use persistent Write-Ahead Log which is shipped with the library. Read more here. However, consensus is enough for your use case so no additional efforts required. |
I really appreciate your help. You’re absolutely right, I didn’t consider IOptionsMonitor - the RTFM part was mostly regarding your library and not ASP.NET Core itself. I do see your point regarding configuration hot-reloading. I am indeed using ASP.NET Core, and I guess the answer lies in a distributed configuration service just like you said. You’ve been absolutely stellar. I have plenty of reading ahead to do. Sorry for the bother and thank you kindly again for your time! |
You're welcome, Rob! If you'll have any questions then reopen this issue. |
Hello,
Thank you for sharing your work with the community.
The documentation of .NEXT is very detailed - going through it right now.
I'd be lying if I said that I understand all the complexities involved in what you've built.
That being said, I'm currently evaluating options to fulfill the following use case:
So I thought that some kind of leader election would get me there.
I've used distributed locks (via a DB) in the past, but I thought I could do better.
Would you say I'm on the right path with .NEXT Raft?
The other question is: are you currently using .NEXT Raft in production or know of case histories I might share with the higher-ups, so I can promote the usage of this library?
Thank you again for your contribution to the community and for your time.
Best,
Rob
The text was updated successfully, but these errors were encountered: