Skip to content

Make stacked content pruning reference-aware - #1313

Merged
yzhuang-oai merged 1 commit into
mainfrom
support-diskimagekit-phase3-gc
Aug 17, 2026
Merged

Make stacked content pruning reference-aware#1313
yzhuang-oai merged 1 commit into
mainfrom
support-diskimagekit-phase3-gc

Conversation

@yzhuang-oai

Copy link
Copy Markdown
Contributor

Split from #1307. Adds reference-aware content-store pruning and GC safety for stacked disk content, including race-focused regression tests.

Validation: full Swift test suite passes locally.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dddf12157e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMStorageOCI.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase3-gc branch from dddf121 to 9001d8c Compare August 17, 2026 16:30

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9001d8c340

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMStorageOCI.swift Outdated
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase3-gc branch from 9001d8c to af825bd Compare August 17, 2026 16:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af825bd3da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/tart/VMDirectory.swift
@yzhuang-oai
yzhuang-oai force-pushed the support-diskimagekit-phase3-gc branch from af825bd to dfd52fa Compare August 17, 2026 17:04
@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

let contentURL = try contentStore.contentURL(for: contentDigest)

P2 Badge Validate content digests before assigning owners

When a structurally recognizable stacked cache record contains a malformed whole-file digest such as sha256:bad, diskContentDigests() returns it successfully because the manifest parser only checks that the annotation exists. This call then throws invalidContentDigest, causing VMStorageOCI.prunables()—and therefore manual and automatic cache pruning—to fail entirely because of one corrupted record, despite the preceding comment saying malformed records should not block pruning. Skip invalid digests along with other malformed manifest data.


try prunable.delete()
currentCacheUsedBytes = try prunables().map { try $0.allocatedSizeBytes() }.reduce(0, +)

P2 Badge Measure actual reclaimed bytes after reference transfers

When a concurrent stacked clone publishes a local manifest while automatic pruning is deleting its cached source record, the shared content moves from the record's attributed size into nonCacheContentDigests; deletion correctly preserves the file, but this recomputation drops its bytes from the prunable total anyway. The loop can consequently conclude that gigabytes were reclaimed even though only the small cache record was removed, leaving the pull that requested space to fail with ENOSPC. Base progress on actual freed storage rather than the changing set of eligible prunables.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@yzhuang-oai
yzhuang-oai merged commit 32a627c into main Aug 17, 2026
1 check passed
@yzhuang-oai
yzhuang-oai deleted the support-diskimagekit-phase3-gc branch August 17, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants