-
Notifications
You must be signed in to change notification settings - Fork 100
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
Error handling for deletion of delta snapshots #793
base: master
Are you sure you want to change the base?
Error handling for deletion of delta snapshots #793
Conversation
@Shreyas-s14 Thank you for your contribution. |
Thank you @Shreyas-s14 for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below. |
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 @Shreyas-s14. Have few suggestions. PTAL
@@ -528,6 +528,51 @@ var _ = Describe("Snapshotter", func() { | |||
Expect(len(list)).Should(Equal(3)) | |||
}) | |||
}) |
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.
You can also add a positive test case when there is no error in deleting snapshots.
Expect(err).Should(HaveOccurred()) | ||
}) | ||
}) | ||
Context("When the number of errors while deleting are greater than the threshold", func() { |
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.
Context("When the number of errors while deleting are greater than the threshold", func() { | |
Context("When the number of errors while deleting are greater than or equal to threshold", func() { |
@@ -85,14 +86,15 @@ func (ssr *Snapshotter) RunGarbageCollector(stopCh <-chan struct{}) { | |||
eod = now.Truncate(24 * time.Hour).Add(23 * time.Hour).Add(59 * time.Minute).Add(59 * time.Second) | |||
trackingWeek = 0 | |||
) | |||
// snapStream indicates the list of snapshot, where first snapshot is base/full snapshot followed by list of incremental snapshots based on it. |
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.
You can move this comment to above as snapStream
is used there but defined here.
a0fee5d
to
8aea8c3
Compare
What this PR does / why we need it:
This PR changes the error handling for deletion of delta snapshots by replacing the current implementation with concatenation of errors using the errors.Join() method upto a threshold of 5. The process of continues with the deletion of the rest of the "deletable" delta snapshots even when an error is encountered, instead of halting the process. When the number of errors becomes greater than the threshold, it errors out for the current cycle.
Which issue(s) this PR fixes:
Fixes #652