-
-
Notifications
You must be signed in to change notification settings - Fork 147
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 ClientDeactivateThreshold in Project #454
Add ClientDeactivateThreshold in Project #454
Conversation
317535a
to
f600a3d
Compare
8a2a9c3
to
96a7ccc
Compare
Codecov Report
@@ Coverage Diff @@
## main #454 +/- ##
==========================================
+ Coverage 46.26% 46.65% +0.38%
==========================================
Files 69 69
Lines 5678 5749 +71
==========================================
+ Hits 2627 2682 +55
- Misses 2758 2763 +5
- Partials 293 304 +11
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for your contribution.
It would be ok to remove it.
We need to check that the query(aggregation) is not putting too much load on the DB. In a production environment, the number of projects may be small, but the number of clients may be large. It would be better to process the deactivation by project and check if the index is properly set.
Because We tried to use aggregation, I think there was a restriction on the type of the field. It would be good to change the structure to run the deactivation on a per-project basis as mentioned above, and change the type of the field to the user's input format(probably a string).
Yes, we need to apply proper pagination when fetching candidate clients from DB. After this work, I think we can add the deactivation setting to the Dashboard and CLI. |
Thank you for your feedbacks.
Do you mean iterating project with If my understanding is correct, I think your suggestion is much better then current implementation. This will definitely reduce cumbersome code to perform deactivateThreshold on clients, and keep previous query to get deactivate candidates! |
d9432f2
to
d5370de
Compare
I have implemented |
The number of projects is very small compared to the number of clients, and there are not many Yorkie users and projects yet. Therefore, it seems that there is no need to introduce pagination to the project now. How about leaving a TODO comment about the pagination of projects for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. It looks good overall.
I left a trivial comment.
858d58e
to
a8e4b9f
Compare
Add clientDeactivateThreshold in Project to set client’s deactivation threshold in individual projects for housekeeping. This will subtitute previousw DefaultHousekeepingDeactivateThreshold in global housekeeping configuration.
a8e4b9f
to
fe97326
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
This PR will be helpful to other developers as they develop other global settings that need to be moved to project settings.
ClientDeactivateThreshold
in Project
ClientDeactivateThreshold
in Project
What this PR does / why we need it:
Add
ClientDeactivateThreshold
inProject
to set client’s deactivation threshold in individual projects for housekeeping.This will subtitute preview
DefaultHousekeepingDeactivateThreshold
in global housekeeping configuration.Current housekeeping mechanism deactivates client with provided
DefaultHousekeepingDeactivateThreshold
global configuration. This deactivates all clients without considering each client’s workloads.In Yorkie,
Project
repesents specific workloads, and eachProject
has different configurations and workloads. Therefore, it will be more efficient to set deactivation conditions inProject
rather then global housekeeping deactivation configuration.For more information & context, follow this issue: #444
Which issue(s) this PR fixes:
Related #444
Special notes for your reviewer:
Below is the list to be considered before merge.
FindDeactivateCandidates()
have changed to fetch all projects first, and then fetch clients by projects usingget()
andfind()
. There is limit(candidatesLimit
) on clients to prevent overloading on memory, but pagination/limit on projects may also be needed. Then, what is a best pagination/limit strategy for projects on housekeeping? Any suggestions will be helpful. (Or, this may not be needed because we can shard project collections so that server can able to load all projects with no problem?)Does this PR introduce a user-facing change?:
Additional documentation:
Checklist: