-
Notifications
You must be signed in to change notification settings - Fork 675
add support for data file size limit #929
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
Conversation
Hi @mattsains. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@fuweid , would you be able to take a look at this PR? |
Investigating the test-windows failure, I discovered that the db.allocate function can actually cause the file size to grow through the truncate in the mmap function. Should I change the allocate function to call grow if a request to allocate beyond the end of the file is received, or should I just duplicate the max size check in allocate? specifically, this line here causes the file size to grow: https://github.com/etcd-io/bbolt/blob/main/db.go#L1168 |
@fuweid , I've added a test for making sure the db can open even if it's beyond the configured max size. I've also got all the builds to pass, so I think this is ready for a review and potentially approval |
hi @fuweid , I am awaiting feedback from you for this PR |
Thanks for the PR. My thoughts,
Overall, I agree that it's a valid requirement. However, I don't feel safe to support it in bbolt. Instead, I'd suggest to add this feature in your application, and as a best-effort approach. |
Could you explain what you mean by:
The max file size does not take effect unless (1) you turn it on in the configuration, and (b) you write to a database in a way that causes it to grow
I am happy to change it to only one location, but it seems to me that there are many places in the code where the size of the file is unintentionally grown, for example when mmaping the file on windows
What makes it hard? I think this PR does it, does it not? Am I missing some complexity?
I am really trying to make this maximum feature not be best effort, which is why I created this PR Look forward to your comments, @ahrtr |
20a41d8
to
07e0fdd
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.
The test cases have very similar implementation. Is it possible to create a common function to be reused/shared by all (or some) test cases?
@ahrtr hi there, I think this is ready for re-review |
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.
I will review the test cases when all the comments are resolved.
@ahrtr I've updated the PR based on your comments |
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.
Overall looks good with several minor comments. Thanks for your contribution!
I see that you use
|
@ahrtr I've made the changes you requested and audited my use of require vs assert. This PR is ready for re-review |
I've squashed the commits |
@mattsains please rebase to fix CI issue. thanks! |
closes #928 Signed-off-by: Matthew Sainsbury <matthew@sainsbury.io>
@fuweid rebased. Do we need the lgtm tag and/or assigning an approver? |
@mattsains It needs @ahrtr 's approval. :) |
Signed-off-by: Matthew Sainsbury <matthew@sainsbury.io>
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.
LGTM
Thanks for your first contribution!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, fuweid, mattsains The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
closes #928