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

storage: fix Pebble.DeleteDirAndFiles #48144

Merged

Conversation

petermattis
Copy link
Collaborator

Fix Pebble.DeleteDirAndFiles to actually delete the specified
directory. Previously it was only recursively deleting the directory's
contents. Not deleting the directory was causing the TestDiskQueue and
TestSpillingQueue tests to fail which assert that the queue directory
does not exist at the end of the test.

This fix also addresses a TODO to use a RemoveAll function which has
been implemented in pebble/vfs.FS for a while.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@petermattis
Copy link
Collaborator Author

@asubiotto Does this matter in practice, or does it only affect tests?

@petermattis
Copy link
Collaborator Author

@asubiotto Does this matter in practice, or does it only affect tests?

That is, should this be backported?

@blathers-crl
Copy link

blathers-crl bot commented Apr 29, 2020

❌ The GitHub CI (Cockroach) build has failed on e6962a6e.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@petermattis
Copy link
Collaborator Author

CI failure for TestEngineFSFileNotFoundError. Pebble.DeleteDirAndFiles is not returning an error if the specified directory does not exist.

Fix `Pebble.DeleteDirAndFiles` to actually delete the specified
directory. Previously it was only recursively deleting the directory's
contents. Not deleting the directory was causing the `TestDiskQueue` and
`TestSpillingQueue` tests to fail which assert that the queue directory
does not exist at the end of the test.

This fix also addresses a TODO to use a `RemoveAll` function which has
been implemented in `pebble/vfs.FS` for a while.

Release note: None
@petermattis petermattis force-pushed the pmattis/pebble-delete-dir-and-files branch from e6962a6 to 0e7b2e1 Compare April 29, 2020 12:07
Copy link
Member

@itsbilal itsbilal left a comment

Choose a reason for hiding this comment

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

:lgtm: thanks for catching this!

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto)

@petermattis
Copy link
Collaborator Author

TFTR!

thanks for catching this!

Thank the unit tests.

bors r+

@asubiotto
Copy link
Contributor

@asubiotto Does this matter in practice, or does it only affect tests?

This does not matter in practice because the flow cleans up leftover directories on Cleanup.

@craig
Copy link
Contributor

craig bot commented Apr 29, 2020

Build succeeded

@craig craig bot merged commit 26b9716 into cockroachdb:master Apr 29, 2020
@petermattis petermattis deleted the pmattis/pebble-delete-dir-and-files branch April 29, 2020 14:16
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.

4 participants