Skip to content

Make GoogleCloudStorageRetryingInputStream request same generation on resume #127626

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

nicktindall
Copy link
Contributor

@nicktindall nicktindall commented May 2, 2025

When we resume a download due to an IOException, we now specify the generation of the object that we were originally downloading in the request so that we can detect if the object changed.

Some decisions that were made

  • When resuming we send generation parameter rather than ifGenerationMatch. The former requests a specific generation where the latter requests the latest generation and triggers an error if its not the one specified. This distinction is only important if the bucket we're fetching from has object versioning enabled. If the object is overwritten and object versioning is enabled, resume with generation specified will succeed because the prior version will still be available, but resume with ifGenerationMatch specified would fail because the latest version is no longer the one we were downloading.
    • This is similar to the behaviour of the SDK in their own resumable channels
  • We ignore updates to metadata. We specify the generation, which is only bumped when the object contents are updated. If someone updates the metadata that shouldn't break a resume IMO. We could implement this behaviour by using ifMetagenerationMatch or Etags instead, but I don't think we want that.

Closes ES-11432

I marked this PR as "non-issue" because currently we never update objects with different contents. This is just future proofing.

@nicktindall nicktindall added >enhancement :Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs labels May 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

@elasticsearchmachine elasticsearchmachine added Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.0 labels May 2, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @nicktindall, I've created a changelog YAML for you.

Copy link
Contributor

@JeremyDahlgren JeremyDahlgren left a comment

Choose a reason for hiding this comment

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

Looks good, I just had the one question about the assertion in parseGenerationHeader(), the rest were a few small nits. Might be good to get a look from other folks with GCS code experience though.

Copy link
Contributor

@JeremyDahlgren JeremyDahlgren left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Snapshot/Restore Anything directly related to the `_snapshot/*` APIs >non-issue Team:Distributed Coordination Meta label for Distributed Coordination team v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants