Skip to content

Conversation

@okummer
Copy link
Contributor

@okummer okummer commented Apr 6, 2023

When a bucket is restored to an earlier state of itself, only a few objects might actually have changed. Changed objects can be identified by comparing the etag of the desired version with the etag of the most recent version. If the etags agree, the object can be skipped. Because the most recent version of any object is always listed first in the response from list_object_versions, its etag is definitely known when handling the version to be restored.

Added a test that checks that no new version is created when the object was not changed.

Also running the existing test in a configuration that uses the same source and destination bucket without requiring another call of "s3-pit-restore --test". Because this is a frequent use case, it should be tested without special effort.

This PR solves a similar, but not the same problem as PR #24. PR #24 can also detect objects that need not be updated when source and target bucket differ, but it needs a separate head_object call for each object. This PR addresses the case of restoring a single bucket to a previous state, only, but without a performance penalty.

When a bucket is restored to an earlier state of itself, only a few objects
might actually have changed. Changed objects can be identified by comparing
the etag of the desired version with the etag of the most recent version.
If the etags agree, the object can be skipped. Because the most recent version
of any object is always listed first in the response from list_object_versions,
its etag is definitely known when handling the version to be restored.

Added a test that checks that no new version is created when the object was
not changed.

Also running the existing test in a configuration that uses the same source
and destination bucket without requiring another call of
"s3-pit-restore --test". Because this is a frequent use case, it should be
tested without special effort.
@okummer
Copy link
Contributor Author

okummer commented Apr 11, 2023

My PR still contains an error. I will open another PR once I have fixed it.

@okummer okummer closed this Apr 11, 2023
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.

1 participant