-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Housekeeping structure improvement #706
Comments
For leader-election based master-slave structure, I have implemented leader election using MongoDB: #529
I think we can use CronJob to regularly run housekeeping process or use simple Job to run housekeeping on demand (this will require API for triggering). For implementation, we can use yorkie CLI like
For standalone mode, both cron job or event-based job will be well suited for several background tasks to run. For implementation, https://github.com/go-co-op/gocron will do the work for cron job. |
I read #529 and understood the comments and source code changes. Very interesting! But I still have some questions.
|
I think we can remove the housekeeping & leader election overhead of each servers on the cluster, which will ease server to handle more workloads. If we run housekeeping only on the master node, it will be a huge burden for the master node to process as cluster gets bigger (elected nodes might die out because of the overhead, which will lead something like election storm).
I agree that we should improve current housekeeping structure. One simple idea is to reference Another idea is that we can implement something like DAG workflow to schedule and run background process that has dependency. I found something similar to this idea: https://github.com/fieldryand/goflow |
I'd like to evaluate the possibility of introducing gocron library for this issue. This library provides a simple way to schedule tasks in Go. And it seems that the library also considering both standalone and distributed system. |
What would you like to be added:
Cluster mode, and several background tasks are required, so the Housekeeping execution structure for this needs to be improved.
yorkie/server/backend/housekeeping/housekeeping.go
Line 110 in 12e86a2
Why is this needed:
Currently, Housekeeping is running a background routine unrelated to RPC and is running at regular intervals.
the housekeeping task only has logic to remove inactive clients. However, other logic may be added later. How should we introduce a structure for this?
In yorkie's cluster mode, I think problems will arise if multiple nodes run the same housekeeping logic redundantly at the same time.
I think we need to research good practices, pros and cons, and come up with a method that suits the yorkie project.
The text was updated successfully, but these errors were encountered: