[go: nahoru, domu]

Skip to content
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

Merged
merged 30 commits into from
Jul 4, 2024

Conversation

chaitalisg
Copy link
Contributor
@chaitalisg chaitalisg commented Jun 18, 2024

The robustness tests do not cover maintenance action at the moment. This PR adds the full maintenance action to the robustness tests.

Copy link
codecov bot commented Jun 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.20%. Comparing base (cb455c6) to head (759c0fb).
Report is 181 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor
@redgoat650 redgoat650 left a 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? 😄

tests/robustness/multiclient_test/multiclient_test.go Outdated Show resolved Hide resolved
tests/robustness/multiclient_test/multiclient_test.go Outdated Show resolved Hide resolved
_, err := eng.ExecAction(ctx, engine.GCActionKey, nil)
require.NoError(t, err)
}
th.RunN(ctx, t, numClients, runGCFcn)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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?

Copy link
Contributor Author

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)

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author
@chaitalisg chaitalisg Jul 1, 2024

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)
}

Copy link
Collaborator

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?

Copy link
Contributor Author

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>
@julio-lopez julio-lopez enabled auto-merge (squash) July 4, 2024 03:34
@julio-lopez julio-lopez merged commit 3801e59 into kopia:master Jul 4, 2024
23 checks passed
@julio-lopez julio-lopez deleted the run-gc-action-robustness-tests branch July 4, 2024 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants