-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
etcdutl: Fix snapshot restore memory alloc issue #17277
etcdutl: Fix snapshot restore memory alloc issue #17277
Conversation
Hi @ivanvc. 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/test-infra repository. |
0f9a53c
to
d5f4b3e
Compare
/ok-to-test |
542c737
to
11d8d88
Compare
11d8d88
to
362a524
Compare
362a524
to
cd9dfaf
Compare
server/storage/backend/backend.go
Outdated
@@ -151,11 +151,13 @@ type BackendConfig struct { | |||
Hooks Hooks | |||
} | |||
|
|||
type BackendConfigFunc func(*BackendConfig) |
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.
type BackendConfigFunc func(*BackendConfig) | |
type BackendConfigOption func(*BackendConfig) |
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.
Done.
server/storage/backend/backend.go
Outdated
} | ||
} | ||
|
||
func NewDefaultBackend(lg *zap.Logger, path string, bcfns ...BackendConfigFunc) Backend { |
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.
func NewDefaultBackend(lg *zap.Logger, path string, bcfns ...BackendConfigFunc) Backend { | |
func NewDefaultBackend(lg *zap.Logger, path string, opts ...BackendConfigOption) Backend { |
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.
Done.
server/config/config.go
Outdated
@@ -119,6 +119,7 @@ type ServerConfig struct { | |||
CompactionBatchLimit int | |||
CompactionSleepInterval time.Duration | |||
QuotaBackendBytes int64 | |||
InitialMmapSize uint64 |
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.
Do we still need this field?
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 don't think so, removed.
Accept a third argument for NewDefaultBackend for overrides to the BackendConfig. Add a new function, WithMmapSize, which modifies the backend config to provide a custom InitiamMmapSize. Signed-off-by: Ivan Valdes <ivan@vald.es>
cd9dfaf
to
4f66aa9
Compare
When running the snapshot command, allow receiving an initial memory map allocation for the database, avoiding future memory allocation issues. Co-authored-by: Benjamin Wang <benjamin.wang@broadcom.com> Co-authored-by: Fatih USTA <fatihusta86@gmail.com> Signed-off-by: Ivan Valdes <ivan@vald.es>
4f66aa9
to
be28833
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.
lgtm
Nice work! thx
Accept a third argument for NewDefaultBackend for overrides to the BackendConfig. Add a new function, WithMmapSize, which modifies the backend config to provide a custom InitiamMmapSize. Backports commit: d69adf4 / PR: etcd-io#17277 Signed-off-by: Ivan Valdes <ivan@vald.es>
When running the snapshot command, allow receiving an initial memory map allocation for the database, avoiding future memory allocation issues. Backports commit: be28833 / PR: etcd-io#17277 Co-authored-by: Fatih USTA <fatihusta86@gmail.com> Signed-off-by: Ivan Valdes <ivan@vald.es>
When running the snapshot command, allow receiving an initial memory map allocation for the database, avoiding future memory allocation issues. Backports commit: be28833 / PR: etcd-io#17277 Co-authored-by: Fatih USTA <fatihusta86@gmail.com> Signed-off-by: Ivan Valdes <ivan@vald.es>
When running the snapshot command, allow receiving an initial memory map allocation for the database, avoiding future memory allocation issues.
As discussed in the fortnightly etc triage meeting, I'm continuing the work from #16055 by squashing the commits and rebasing @fatihusta's original branch with main.
Fixes #16052.
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.