Skip to content

Data corruption in Azure storage driver when using Writer() interface #4571

Closed

Description

@vespian

Description

This is a followup for the azure-sdk-go bug report here. The TLDR is:

When uploading data using the Azure SDK's NewAppendBlobClient.AppendBlock API, data corruption occurs if timeout occurs. Specifically, when a chunk upload fails with "500 Operation timeout", the Azure driver code does not take into account that operation might have succded as per Azure API docs, and just retries the upload resulting in duplicate blocks.

Reproduce

This issue usually occurs when throttling is in effect due to excessive number of requests.

Expected behavior

The code in this situation should:

  • Use AppendPositionAccessConditions in AppendBlockOptions
  • If you get a 412 (precondition not met) error, it means the previous attempt succeeded
  • If not - download the range of the last append to verify if the block contains the expected data
  • Continue with the next block if verification succeeds, otherwise retry the current block

registry version

latest master : 51bdcb7

Additional Info

Fix was implemented here: https://gitlab.com/gitlab-org/container-registry/-/merge_requests/2059/diffs?commit_id=959132477ef719249270b87ce2a7a05abcd6e1ed

Activity

  1. vespian commented on Feb 13, 2025

    @vespian
    Author
  2. milosgajdos commented on Feb 13, 2025

    @milosgajdos
    Member

    Can you open a PR @vespian ?

  3. vespian commented on Feb 13, 2025

    @vespian
    Author

    Unfortunately, my current workload is quite heavy and I won't be able to port these changes myself in the near term.

    The fix in our fork is relatively straightforward and the codebases are pretty similar. The main difficulty are going to be small idiosyncrasies between your codebase and our fork. I'll be happy to follow the issue and provide guidance/feedback to whoever picks up the implementation. Please feel free to tag me if you have any questions about our approach.

  4. milosgajdos commented on Feb 13, 2025

    @milosgajdos
    Member

    That's the same for all of us unfortunately...none of us gets paid for this 🙃

    maybe @kirat-singh can pick this up since he was the person who updated the Azure parts recently

  5. added
    priority/P1
    on Feb 22, 2025
  6. added this to the Registry/3.0.0 milestone on Feb 22, 2025
  7. milosgajdos commented on Mar 27, 2025

    @milosgajdos
    Member

    Closing #4576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/P1

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions