Skip to content

Conversation

louiscb
Copy link
Contributor

@louiscb louiscb commented May 8, 2025

Summary by mrge

Added a fallback feature for S3 fetches that tries previous object versions if deserialization fails.

  • New Features
    • Added version_fallback? option to enable automatic fallback to older S3 object versions.
    • Implemented previous_version/1 for S3 fetcher to retrieve earlier versions.
    • Updated tests to cover fallback logic.

@louiscb louiscb requested a review from sneako May 8, 2025 11:27
Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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)
Copy link
Member

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

Copy link
Contributor Author

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.

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.

2 participants