Skip to content

Conversation

@mrcnc
Copy link
Contributor

@mrcnc mrcnc commented Nov 16, 2024

Inspired by the initial implementation in S3FileIO, this PR implements SupportsRecoveryOperations for GCSFileIO.

GCP recommends using soft delete instead of object versioning, so this implementation attempts to-restore a soft deleted object first. If soft delete is not enabled (which may be common since it's a relatively new feature), then it attempts to restore a previously deleted version by coping it to the live location, similar to the S3FileIO implementation.

@github-actions github-actions bot added the GCP label Nov 16, 2024
@amogh-jahagirdar amogh-jahagirdar self-requested a review November 20, 2024 18:44
Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar left a comment

Choose a reason for hiding this comment

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

Thanks @mrcnc , I think this is pretty close, just some comments on adding more details to the logs!

LOG.info("Latest deleted version was restored for {}", blob.getBlobId());
return true;
}
LOG.warn("No latest deleted version was found");
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we include the blobID in the log?

LOG.warn("No latest deleted version was found");

} catch (StorageException e) {
LOG.warn("Failed to restore latest deleted version", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

Comment on lines +305 to +308
LOG.warn("No soft deleted object was found");

} catch (StorageException e) {
LOG.warn("Failed to restore", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as below, could we include the blobID in these log messages?

Comment on lines +270 to +272
} catch (IllegalArgumentException e) {
LOG.warn("Invalid GCS path format: {}", path, e);
}
Copy link
Contributor

@amogh-jahagirdar amogh-jahagirdar Dec 10, 2024

Choose a reason for hiding this comment

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

Actually just noticed this, not sure it makes sense to swallow the IllegalArgumentException in case the path format is incorrect? I consider this just like the null or empty case where recoverFile can just throw. The best effort really is for the calls to attempt recovery, not the other validation imo.

@github-actions
Copy link

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 10, 2025
@github-actions
Copy link

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Jan 18, 2025
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.

2 participants