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

support 'projecting' from replica bucket as a way of restoring images incorrectly hard deleted #4125

Closed
wants to merge 3 commits into from

Conversation

twrichards
Copy link
Contributor

@twrichards twrichards commented Jul 31, 2023

https://trello.com/c/ffAUNID4/1621-lazarus-mechanism-to-restore-deleted-grid-images-from-replica-bucket

Following on from the excellent #4116. Adds a fallback to the 'replica bucket' (see https://github.com/guardian/editorial-tools-platform/pull/696 for more about replica buckets) when the file cannot be found in the main image bucket.

This should help us restore images quickly which have been hard deleted by mistake (perhaps by reaper) - so long as we have the ID of course.

Requires new (optional) bit of image loader config s3.image.replicaBucket.

@twrichards twrichards requested a review from a team as a code owner July 31, 2023 12:07
@twrichards twrichards force-pushed the support-projecting-from-replica-bucket branch from 6162c93 to 557ec6a Compare July 31, 2023 12:19
@twrichards twrichards force-pushed the support-projecting-from-replica-bucket branch from 557ec6a to a7aa975 Compare July 31, 2023 12:27
Copy link
Member

@andrew-nowak andrew-nowak left a comment

Choose a reason for hiding this comment

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

code seems good to me, though I think the main logic can be made easier to follow - I haven't tested in TEST myself but trust you have :)

image-loader/app/model/Projector.scala Outdated Show resolved Hide resolved
@twrichards
Copy link
Contributor Author

This approach doesn't reinstate the image file in the image bucket (nor does it recreate thumbs or optimised image, which will have been deleted during reaping), so closing this PR in favour of #4128 which achieves the intentions of this PR but via image-loader so it can regenerate all it needs but preserving original uploadTime, uploadedBy and original filename.

@twrichards twrichards closed this Aug 1, 2023
@twrichards twrichards deleted the support-projecting-from-replica-bucket branch September 20, 2023 12:06
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