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

Create snapshot when listing contents of a path. #1805

Merged
merged 51 commits into from Jul 8, 2022

Conversation

dwsteele
Copy link
Member

@dwsteele dwsteele commented Jul 5, 2022

Previously a callback was used to list path contents and if no sort was specified then a snapshot was not required. When deleting files from the path some filesystems could omit files that still existed, which meant the path could not be removed.

Filter . out of lists in the Posix driver since this special entry was only used by test code (and filtered everywhere in the core code).

Also remove callbacks from the storage interface and replace with an iterator that should be easier to use and guarantees efficient use of the snapshots.

@dwsteele dwsteele added this to the 2.40 milestone Jul 5, 2022
@dwsteele dwsteele self-assigned this Jul 5, 2022
@precision-software
Copy link

Continuing my review and should finish up by lunch tomorrow (PST). I'm not sure if it better to have a series of smaller PRs or a single big one like this one. Either way it amounts to the same work for reviewing, but I find myself longing for bite-sized pieces. Will continue in the AM.

@dwsteele
Copy link
Member Author

dwsteele commented Jul 8, 2022

I'm not sure if it better to have a series of smaller PRs or a single big one like this one.

In general we try to break patches up at much as possible, but this one was not as amenable to being split.

@dwsteele dwsteele changed the base branch from main to integration July 8, 2022 15:09
Copy link

@precision-software precision-software left a comment

Choose a reason for hiding this comment

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

I think we can further refine the way iterators are used, but this code is pretty good. My thinking is the storage driver API should return a single level iterator (which would internally include the storage list in some cases). We would build the universal recursive scan on top of the driver's single level scan. This is something to consider for the future to make the various drivers a bit more similar to each other.

Looks good. I'm in favor of fixing that missing "else", not because it is doing any harm, but because it looks so much like a bug I'm uncomfortable leaving it in place.

@dwsteele
Copy link
Member Author

dwsteele commented Jul 8, 2022

My thinking is the storage driver API should return a single level iterator (which would internally include the storage list in some cases).

Agreed. This would work for the object stores where we currently still have callbacks as well.

Looks good. I'm in favor of fixing that missing "else", not because it is doing any harm, but because it looks so much like a bug I'm uncomfortable leaving it in place.

Done in b54d25c. I was just holding it until you finished your review.

@dwsteele dwsteele linked an issue Jul 8, 2022 that may be closed by this pull request
@dwsteele dwsteele merged commit 75623d4 into pgbackrest:integration Jul 8, 2022
@dwsteele dwsteele deleted the dws-storage-list branch July 8, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A way to store backups in a non-cloud storage?
3 participants