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
Fix GC issue for concurrent directory reuse after deletion #601
Conversation
1b4c6da
to
7400719
Compare
// Options used during Environment Setup. | ||
type Options struct { | ||
NewRepositoryOptions func(*repo.NewRepositoryOptions) | ||
OpenOptions func(*repo.Options) |
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.
The motivation is to be able to pass *repo.Options
to inject time in another test harness.
@@ -100,6 +100,9 @@ func (e *Environment) Close(ctx context.Context, t *testing.T) { | |||
} | |||
} | |||
|
|||
// may need to remove the maintenance lock | |||
os.Remove(e.configFile() + ".mlock") |
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.
For tests that run maintenance tasks, this file lingers around. Mmm, perhaps it should be removed on disconnect. Currently here to prevent the check below from failing a test.
|
||
// Run maintenance again | ||
th.fakeTime.Advance(maintenance.DefaultParams().SnapshotGC.MinContentAge + time.Hour) | ||
err = Run(ctx, th.Repository, maintenance.ModeFull, true) |
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.
Currently fails here.
err = Run(ctx, th.Repository, maintenance.ModeFull, true) | ||
require.NoError(t, err) | ||
|
||
info, err := r2.(*repo.DirectRepository).Content.ContentInfo(ctx, content.ID(s2.RootObjectID())) |
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.
perhaps add comment saying we are intentionally interleaving snapshot and maintenance and not flushing in order to create dangling reference to a deleted content.
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.
btw same exact thing will happen when you don't reuse a directory but a file:
create dir1/file1
create snaphot dir1
create dir2
move dir1/file1 to dir2/file2
delete snapshot dir1
delete dir1
snapshot dir2
7400719
to
7d962f7
Compare
Test timeout on Darwin. |
No description provided.