-
Notifications
You must be signed in to change notification settings - Fork 10
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 dataset size limits #191
Conversation
In Hub we need to change the behaviour of Share because It keeps retrying even after server error for quota exceeded, tracked in DroneDB/Hub#47 |
// It currently enumerates all the datasets and asks DDB for size. | ||
// If we notice a slowdown of the upload/share/push process this could be the culprit | ||
// A simple cache level could be the solution but it needs to be kept in sync | ||
// with all the dataset operations. Really a pain if it is not necessary. |
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.
We should at least memoize this. https://github.com/eirikt/Memoizer.NET
It's OK if we allow a user to exceed its quota, for a brief period of time, so long as at a certain point we detect that the quota has exceeded and we can take action.
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.
Very cool library, check #191 (comment)
I performed some empirical tests on my machine. I tested from 1 to 200 datasets the wait time after the new file upload.
There is definitely a linear correlation between the wait time and the number of datasets. |
🐢 |
I would add this right away, but you decide. It will take more work later imo. |
Tracked in #192 |
Works good for share and file upload endpoint. I found an issue with ddb push though; If I clone an empty repository, add lots of files (past my storage limit), then To reproduce:
|
Fixed in 8f3a3d1 |
Add search endpoint
Improvements tracked in #192 |
Looks good. Thanks! |
This PR closes #31 by adding the support for
maxStorageMB
user metadata.New configuration key
EnableStorageLimiter
to enable this limiter, if false it does not check the user's available storage space.New endpoint
GET /users/storage
it returns the current user's storage info:When the user goes beyong its quota a new
MaxUserStorageException
is thrown.