-
-
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
Housekeeping is Not Working Properly on Single Project #744
Comments
I am interested in this issue. Can I work on it? |
Sure. If you have any questions, feel free to let me know. |
@hackerwins @krapie In the second call of HouseKeeping, although there is a project that clearly needs to be deactivated, it fails to find any projects because there are no projects with an ID greater than 4. To address this, what do you think about modifying the |
func (d *DB) listProjectInfos(
_ context.Context,
pageSize int,
housekeepingLastProjectID types.ID,
) ([]*database.ProjectInfo, error) {
// Do something...
} How about renaming this function to |
Thank you for clarifying the actual problem of this issue. Modifying to circular form & clarifying function name seems like a good idea ( |
What happened:
Housekeeping is not working properly on single project(default project).
I think this is because
listProjectInfos()
queries projects on$gt
(greater than) option. If there is only one project, thelistProjectInfos()
function queries for a larger_id
, which excludes that single project. This will not fetch any projects, leading to empty candidates list for deactivation.yorkie/server/backend/database/mongo/client.go
Lines 244 to 261 in 8987b45
It seems like memDB is also causing the same problem.
yorkie/server/backend/database/memory/database.go
Lines 228 to 260 in 8987b45
MemDB is fetching projects successfully because it uses
LowerBound()
, but it skips appending project wheni == 0 && info.ID == housekeepingLastProjectID
.What you expected to happen:
Housekeeping fetches single project and clients for deactivation.
How to reproduce it (as minimally and precisely as possible):
Simply run server with mongoDB attached and project deactivation threshold(
--client-deactivate-threshold
) with smaller interval (ex:10s
), and create clients for housekeeping.Anything else we need to know?:
Environment:
Any
Any
yorkie version
):v0.4.11
v.0.4.11
The text was updated successfully, but these errors were encountered: