Skip to content

Make an append to a missing file agree across providers when another writer creates it meanwhile #65

Closed

Description

@serionist

An unconditional append (UpdateFileMode.Append, no conditions) to a missing file that another writer creates at the same moment ends differently by provider:

  • Physical and the append-by-rewrite providers (S3, MinIO, GCS, Box, SharePoint) refuse with a create-only failure (FileAlreadyExistsException from 2027.1).
  • Azure Blob re-reads and appends after the new content, as it does after any concurrent change (AzureBlobProviderTests.Races.cs, Append_CreatingRacesWithAnotherCreator).

Both keep the other writer's content, so nothing is lost, but the outcome differs, against "one meaning across providers". Making them agree changes what some provider does today, so it needs a decision: either the refusing providers retry and append after the new content (closer to what an append means), or Azure refuses.

Found in the plan review of #64 (P1) and left out of 2027.1 on purpose; docs/guide/providers.md records the difference until then.

Activity

  1. serionist commented on Oct 13, 2026

    @serionist
    OwnerAuthor

    One-way door: the maintainers' agreement. @serionist approved this change in the 2027.1.1 plan (docs/plans/2026-10-13-2027-1-1.md, decisions D1 and D2, approved 2026-10-13):

    • An append with no condition of the caller's retries after a concurrent change or create, on every provider, as Azure Blob does today: the provider reads the file again and appends after what is there now, up to five attempts in all, then throws PreconditionFailedException. A caller's own IfMatch or IfNotExists still fails at once.
    • AppendByRewriteAsync, a protected helper of WriteableFileProvider<TOptions> and so part of the Common API, keeps its signature and its promise (a concurrent write is never lost); it now retries where it threw at the first conflict. This is read as a fix toward one meaning across providers, the rule this difference broke, and ships as a patch, 2027.1.1.
    • Accepted with it: where a store's answer is lost and its SDK sends the write again, the retry can append the same bytes twice, as on Azure today and as a caller who retried by hand would. The guide says so.
  2. serionist commented on Oct 13, 2026

    @serionist
    OwnerAuthor

    Shipped in 2027.1.1 (nuget.org, every package), through #74: an append with no condition now reads the file again after a concurrent change or create and appends after it, on every provider, up to five attempts. One corner stays as it was, documented: on Linux and macOS, Physical's append that loses a new name throws FileAlreadyExistsException while the file there is still empty.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions