-
Notifications
You must be signed in to change notification settings - Fork 101
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
Use cron schedule for defragmentation #194
Use cron schedule for defragmentation #194
Conversation
2635efa
to
341715d
Compare
@shreyas-s-rao I have rebased the PR. This PR is now ready for the review. While refactoring, i have added the changes for garbage-collection-period and delta-snapshot-period in same PR. Sorry to have it in single PR itself. |
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 except for few comments about modularity.
cmd/server.go
Outdated
} | ||
// If no storage provider is given, snapshotter will be nil, in which | ||
// case the status is set to OK as soon as etcd probe is successful | ||
handler = startHTTPServer(etcdInitializer, nil) |
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.
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.
cmd/server.go
Outdated
return nil | ||
}) | ||
runEtcdProbeLoopWithoutSnapshotter(tlsConfig, handler, stopCh, ackCh) | ||
defragSchedule, err := cron.ParseStandard(defragmentationSchedule) |
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.
Why not parse defragmentationSchedule
centrally once and then send around the parsed result?
cmd/server.go
Outdated
|
||
// start defragmentation without trigerring full snapshot | ||
// after each successful data defragmentation | ||
defragSchedule, err := cron.ParseStandard(defragmentationSchedule) |
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.
Why not parse defragmentationSchedule
centrally once and then send around the parsed result?
341715d
to
cd7ddc0
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.
Thanks for the change. LGTM
Thanks you for the review @amshuman-kr . I have addressed your comments. Yes indeed validation and configuration options handling is little decentralized currently. Added as and when required with new feature. I have created the issue to separately refactor related code. Don't want combine it all together. I have it partially in-porgress here |
Signed-off-by: Swapnil Mhamane <[email protected]>
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.
@swapnilgm Thanks a lot for the well-written and much needed PR! Overall looks good. Just a few changes required here and there. Please address them. Thanks.
Edit: While running the test, I see the following message for the defrag spec should defragment and reduce size of DB within time
:
{"level":"warn","ts":"2019-09-25T13:53:04.466+0530","caller":"clientv3/retry_interceptor.go:61","msg":"retrying of unary invoker failed","target":"passthrough:///127.0.0.1:60091","attempt":0,"error":"rpc error: code = DeadlineExceeded desc = context deadline exceeded"}
cd7ddc0
to
c0bc734
Compare
garbage-collection-period Signed-off-by: Swapnil Mhamane <[email protected]>
c0bc734
to
5b7bfba
Compare
Thank you for the review @shreyas-s-rao. PTAL. I have addressed the comments. PTAL.
This is due to vendor update. Retry_interceptor.go from etcd has log message irrespective of error. The error appears on etcd server stop call. So, nothing to worry about it. |
Signed-off-by: Swapnil Mhamane [email protected]
What this PR does / why we need it:
This PR changes the defragmentation period configuration to cron like schedule. Also, partially addresses #125
Which issue(s) this PR fixes:
Fixes partially #125
Special notes for your reviewer:
Release note: