Skip to content

solve: lock local cache ingests across clients - #7187

Draft
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:fix-local-cache-ingest-locking
Draft

crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:fix-local-cache-ingest-locking

Conversation

@crazy-max

Copy link
Copy Markdown
Member

follow-up #7153 (comment)

Fix the ingest-file rename failures reported in #7153 (comment). Concurrent exports to the same local cache directory can open the same temporary ingest files because containerd local content store only coordinates writers within each store instance. This race occurs independently of reset=true and was observed both on master and with #7153 applied.

Coordinate writers and aborts with a filesystem lock per ingest reference, allowing contending exports to retry while preserving resumability for interrupted uploads. This complements #7153 protection against reset deleting blobs used by active exports.

Independent local content stores only coordinate writers within each
store instance. Concurrent cache exports to the same directory can open
the same ingest files, causing rename failures or incomplete writes.

Acquire a filesystem lock per ingest reference before opening a writer
or aborting an ingest. Release it when the writer closes or commits,
including error paths, and report contention as unavailable so existing
retry logic can wait. Preserve references so interrupted uploads remain
resumable, and retain lock files to avoid races with replacement inodes.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
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.

1 participant