-
Notifications
You must be signed in to change notification settings - Fork 49
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
Enabled jobs instead of cronjobs to take care of running compaction. #235
Conversation
@abdasgupta Labels area/todo, kind/todo do not exist. |
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 PR. I have a few suggestions and questions which I added as a comment to the affected line(s).
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 @abdasgupta for the well written PR!
Just one query from me and some nitpicks
Thanks!
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.
Hey @abdasgupta
Just adding below some changes to the job that needs to be made before this PR is merged
This is to ensure it correctly works with the etcdbr version
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.
Just some last comments. Thanks for your effort 👍
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
I tested and played around with it w/o facing any issues 👍
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
There are a few comments that still use the old name LeaseController
that you may want to fix.
config controllersconfig.CompactionLeaseConfig | ||
} | ||
|
||
// NewCompactionLeaseController creates a new LeaseController object |
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.
// NewCompactionLeaseController creates a new LeaseController object | |
// NewCompactionLeaseController creates a new CompactionLeaseController object |
} | ||
} | ||
|
||
// NewCompactionLeaseControllerWithImageVector creates a new LeaseController object |
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.
// NewCompactionLeaseControllerWithImageVector creates a new LeaseController object | |
// NewCompactionLeaseControllerWithImageVector creates a new CompactionLeaseController object |
return lc.InitializeControllerWithImageVector() | ||
} | ||
|
||
// InitializeControllerWithImageVector will use LeaseController client to initialize image vector for etcd |
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.
// InitializeControllerWithImageVector will use LeaseController client to initialize image vector for etcd | |
// InitializeControllerWithImageVector will use CompactionLeaseController client to initialize image vector for etcd |
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
Added test case for lease controller in separate test file.
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
Comments have been addressed. Reviewer is absent.
How to categorize this PR?
/area performance
/kind enhancement
What this PR does / why we need it:
Earlier cronjobs are scheduled through druid for backup compaction of ETCD. But that incurs huge cost as we have to predefine schedule and resources for compaction jobs. This PR enabled to run jobs instead of cronjobs to run the backup compaction. Jobs are triggered based on the number of events that accumulated as delta snapshot after last full snapshot.
cc @aaronfern
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note:
A new controller named lease controller has been introduced. Lease controller will be responsible for creating compaction job based on the delta event lease. For this, two new `Lease`s are introduced: One to hold the value of the latest full snapshot revision and one for the last delta revision.