-
Notifications
You must be signed in to change notification settings - Fork 0
Add fallback to previous version feature for s3 #19
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
base: main
Are you sure you want to change the base?
Add fallback to previous version feature for s3 #19
Conversation
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.
mrge found 4 issues across 7 files. Review them in mrge.io
version_id: state.version_id | ||
) | ||
|
||
versions = if state.versions, do: {:ok, state.versions}, else: list_object_versions(state) |
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.
I'm not 100% sure how s3 replication works, are the versions guaranteed to be the same across replicated buckets? If not, then it is possible we have stored the versions of one region, and now are trying a fallback region with the original versions
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.
Hmm but if the bucket fails and it chooses the failover bucket then the list_object_versions
will be called to the failover bucket, so the versions it gets will be from the new bucket.
but yea I see what you're saying, in the edge case that the version fails to deserialise and then the bucket fails midway ? Seems quite unlikely but I guess could happen.
Summary by mrge
Added a fallback feature for S3 fetches that tries previous object versions if deserialization fails.
version_fallback?
option to enable automatic fallback to older S3 object versions.previous_version/1
for S3 fetcher to retrieve earlier versions.