-
Notifications
You must be signed in to change notification settings - Fork 343
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
test(general): run gc action robustness tests #3927
test(general): run gc action robustness tests #3927
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3927 +/- ##
==========================================
+ Coverage 75.86% 77.20% +1.33%
==========================================
Files 470 481 +11
Lines 37301 28803 -8498
==========================================
- Hits 28299 22237 -6062
+ Misses 7071 4664 -2407
+ Partials 1931 1902 -29 ☔ View full report in Codecov by Sentry. |
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 could have sworn we added maintenance runs in the past. Was it removed at some point or am I losing my mind? 😄
…kopia into run-gc-action-robustness-tests
_, err := eng.ExecAction(ctx, engine.GCActionKey, nil) | ||
require.NoError(t, err) | ||
} | ||
th.RunN(ctx, t, numClients, runGCFcn) |
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.
Does it work? Is maintenance being triggered?
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.
Yes. Copied from the log:
STDERR: Running full maintenance... Looking for active contents... Looking for unreferenced contents... GC found 0 unused contents (0 B) GC found 0 unused contents that are too recent to delete (0 B) GC found 10022 in-use contents (42.2 MB) GC found 61 in-use system-contents (26.8 KB) Rewriting contents from short packs... Total bytes rewritten 873.7 KB Found safe time to drop indexes: 2024-06-21 11:08:20.307877 -0700 PDT Dropping contents deleted before 2024-06-21 11:08:20.307877 -0700 PDT Skipping blob deletion because not enough time has passed yet (59m59s left). Cleaned up 0 logs. Cleaning up old index blobs which have already been compacted... Finished full maintenance.
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.
Is this action being executed by a client?
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.
Yes. The test creates a single client, which connects to repo (kopia repo connect server
), followed by the maintenance action (kopia maintenance run --full
)
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'm confused 😕. That does not seem to match the expected behavior.
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 see. Can you clarify the expected behavior? I read through the documentation, and was not able to find any reference to a client not being allowed to run maintenance. Is this the expectation you are referring to? Let me know if I am misinterpreted the comment.
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.
Here's the explanation from snapshotter.go
// RunGC runs garbage collection on the server repository directly since clients
// are not authorized to do this.
func (mcs *MultiClientSnapshotter) RunGC(ctx context.Context, opts map[string]string) error {
return mcs.server.RunGC(ctx, opts)
}
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.
What's the alternative to make it clear and explicit?
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 could replace the function and the call to RunN
with
th.Engine().TestRepo.RunGC(ctx, nil)
This would run the maintenance command . However, it won't be counted in engine action stats.
Co-authored-by: Julio López <1953782+julio-lopez@users.noreply.github.com>
The robustness tests do not cover maintenance action at the moment. This PR adds the full maintenance action to the robustness tests.