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

Fix TestBlocksCleaner_ShouldRemoveBlocksOutsideRetentionPeriod flakyness #894

Merged

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Jan 26, 2022

What this PR does:
TestBlocksCleaner_ShouldRemoveBlocksOutsideRetentionPeriod (like other tests) uses the filesystem-based object store. I found this suffers a race condition in the deletion of an empty dir: basically, if 2 goroutines delete an object in the same folder at the same time and, after their deletion, both of them detect that the dir is empty, the 2nd one trying to delete the empty dir will return error.

I will submit a fix to Thanos, but in the meanwhile I suggest to disable the blocks deletion concurrency in our tests.

Which issue(s) this PR fixes:
Fixes #824

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci marked this pull request as ready for review January 26, 2022 08:22
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find.

@pracucci
Copy link
Collaborator Author

I've submitted a fix to Thanos (PR 5103). Let's see if it gets merged quickly. If so, we can just upgrade Thanos and keep blocks deletion concurrency in our unit tests (which would be better so we exercise that code too).

@pracucci
Copy link
Collaborator Author

Let's merge this, since it's failing quite frequently in CI. I will rollback once Thanos PR is merged.

@pracucci pracucci merged commit 5c24428 into main Jan 26, 2022
@pracucci pracucci deleted the fix-TestBlocksCleaner_ShouldRemoveBlocksOutsideRetentionPeriod branch January 26, 2022 09:54
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.

Flaky unit test TestBlocksCleaner_ShouldRemoveBlocksOutsideRetentionPeriod
2 participants