-
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
Fixes etcdutl snapshot restore memory alloc. issue #16055
Conversation
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
etcdutl/etcdutl/snapshot_command.go
Outdated
@@ -75,6 +76,7 @@ func NewSnapshotRestoreCommand() *cobra.Command { | |||
cmd.Flags().StringVar(&restorePeerURLs, "initial-advertise-peer-urls", defaultInitialAdvertisePeerURLs, "List of this member's peer URLs to advertise to the rest of the cluster") | |||
cmd.Flags().StringVar(&restoreName, "name", defaultName, "Human-readable name for this member") | |||
cmd.Flags().BoolVar(&skipHashCheck, "skip-hash-check", false, "Ignore snapshot integrity hash value (required if copied from data directory)") | |||
cmd.Flags().Int64Var("aBackendBytes, "quota-backend-bytes", 0, "Backend quota size. 0 means use the default quota.)") |
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.
Can you add information about what is the default quota.
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 refactored all PR. I hope better then old PR. Could you please review again.
etcdutl/etcdutl/snapshot_command.go
Outdated
@@ -75,6 +76,7 @@ func NewSnapshotRestoreCommand() *cobra.Command { | |||
cmd.Flags().StringVar(&restorePeerURLs, "initial-advertise-peer-urls", defaultInitialAdvertisePeerURLs, "List of this member's peer URLs to advertise to the rest of the cluster") | |||
cmd.Flags().StringVar(&restoreName, "name", defaultName, "Human-readable name for this member") | |||
cmd.Flags().BoolVar(&skipHashCheck, "skip-hash-check", false, "Ignore snapshot integrity hash value (required if copied from data directory)") | |||
cmd.Flags().Int64Var("aBackendBytes, "quota-backend-bytes", 0, "Backend quota size. 0 means use the default quota.)") |
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.
Can you replace 0 with the default quota?
server/storage/backend/backend.go
Outdated
@@ -151,6 +151,15 @@ type BackendConfig struct { | |||
Hooks Hooks | |||
} | |||
|
|||
type NewDefBackend struct { |
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.
No need for struct here.
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
@@ -38,6 +38,7 @@ var ( | |||
restorePeerURLs string | |||
restoreName string | |||
skipHashCheck bool | |||
initialMmapSize = uint64(10 * 1024 * 1024 * 1024) |
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.
10 gigs? why so large?
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 copied from here
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 think this is looking pretty good, thanks @fatihusta.
Suggest potentially squashing commits down to 1 or 2 if you have time. Also one small nitpick on alignment.
server/config/config.go
Outdated
@@ -124,6 +124,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.
Nit - Alignment of unit64
here looks slight off.
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. :) thanks for your review.
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
Signed-off-by: Fatih USTA <fatihusta86@gmail.com>
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 if the commits can be squashed so that it can be easy to backport.
As discussed in the fortnightly etcd triage meeting, I'm continuing the work by squashing the commit and rebasing main in PR #17277. |
superseded by #17277 |
Fixes: #16052
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.