Skip to content

[9.2.0] Recover lost inputs from deduplicated Merkle subtrees under path mapping - #30193

Merged
Wyverald merged 1 commit into
bazelbuild:release-9.2.0from
fmeum:30103-chery
Jul 8, 2026
Merged

[9.2.0] Recover lost inputs from deduplicated Merkle subtrees under path mapping#30193
Wyverald merged 1 commit into
bazelbuild:release-9.2.0from
fmeum:30103-chery

Conversation

@fmeum

@fmeum fmeum commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Merkle subtrees for tree artifacts are deduplicated across actions by content. When such a shared subtree is uploaded for remote execution and one of its blobs is missing from the CAS, the resulting CacheNotFoundException is annotated with the exec path of whichever action happened to compute the shared subtree. With path mapping, other actions that join the deduplicated computation can then no longer map the lost input back to their own inputs, so the BulkTransferException surfaces as a fatal EXEC_IO_EXCEPTION instead of a LostInputsExecException and action rewinding never runs.

This change adds the unmapped exec path to the cache key of a tree artifact to avoid a shared upload in this case. Other artifact types are not affected and the fast path of a remote cache check without uploads is unaffected.

Fixes #30065.

RELNOTES: Fixed a spurious remote-execution failure with --experimental_output_paths=strip where a lost input in a tree artifact shared between actions could not be recovered by action rewinding.

Closes #30085.

PiperOrigin-RevId: 944321975
Change-Id: If36408a56ab8137b915970827ebbd7a91d9ad9c1
(cherry picked from commit 412de86)

Closes #30103

…ing (bazelbuild#30085)

Merkle subtrees for tree artifacts are deduplicated across actions by content. When such a shared subtree is uploaded for remote execution and one of its blobs is missing from the CAS, the resulting `CacheNotFoundException` is annotated with the exec path of whichever action happened to compute the shared subtree. With path mapping, other actions that join the deduplicated computation can then no longer map the lost input back to their own inputs, so the `BulkTransferException` surfaces as a fatal `EXEC_IO_EXCEPTION` instead of a `LostInputsExecException` and action rewinding never runs.

This change adds the unmapped exec path to the cache key of a tree artifact to avoid a shared upload in this case. Other artifact types are not affected and the fast path of a remote cache check without uploads is unaffected.

Fixes bazelbuild#30065.

No

- [x] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

RELNOTES: Fixed a spurious remote-execution failure with `--experimental_output_paths=strip` where a lost input in a tree artifact shared between actions could not be recovered by action rewinding.

Closes bazelbuild#30085.

PiperOrigin-RevId: 944321975
Change-Id: If36408a56ab8137b915970827ebbd7a91d9ad9c1
(cherry picked from commit 412de86)
@fmeum
fmeum requested a review from a team as a code owner July 8, 2026 14:50
@fmeum
fmeum requested a review from coeuvre July 8, 2026 14:50
@github-actions github-actions Bot added team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels Jul 8, 2026
@fmeum
fmeum requested a review from Wyverald July 8, 2026 15:02
@Wyverald
Wyverald added this pull request to the merge queue Jul 8, 2026
Merged via the queue into bazelbuild:release-9.2.0 with commit 1c0835a Jul 8, 2026
46 checks passed
@github-actions github-actions Bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jul 8, 2026
@fmeum
fmeum deleted the 30103-chery branch July 9, 2026 11:59
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Jul 14, 2026
### What does this PR do?
Bump the pinned Bazel version from 9.1.1 to 9.2.0 and refresh `MODULE.bazel.lock` accordingly.

### Motivation
Bazel 9.2.0 ships fixes this repo has been working around over the past month.

#### Windows issues
Our contributions:
- bazelbuild/bazel#29984, which should remove the need for temporary countermeasures we had to come up with:
  - DataDog/datadog-agent-buildimages#1212 (alas ineffective),
  - DataDog/datadog-agent-buildimages#1215 (effective),
  - #52500,
- bazelbuild/bazel#30182, which should remove the need for:
  - #52061,
  - #53591.

#### Caching issues
- bazelbuild/bazel#29791,
- bazelbuild/bazel#29868,
- bazelbuild/bazel#29885,
- bazelbuild/bazel#30193, a caveat mentioned in:
  - #53356.

#### Others
Also worth noting, though not tied to a specific incident here:
- bazelbuild/bazel#29807,
- bazelbuild/bazel#29898,
- bazelbuild/bazel#30194.

### Describe how you validated your changes
`bazel version` reports 9.2.0 after `bazelisk` re-bootstraps.
`bazel build //pkg/config/schema/...` completes successfully.
`bazel shutdown` followed by `bazel mod deps --lockfile_mode=refresh` leaves `MODULE.bazel.lock` unchanged.

### Additional Notes
None of the .bazelrc UAC/8dot3 workarounds (DataDog/datadog-agent-buildimages#1215, #52500, #52061, #53591) are removed here.
Each needs its own re-verification on Windows before being reverted as follow-ups.

Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/datadog-agent that referenced this pull request Aug 21, 2026
…xes (#53619) (#55228)

Bump the pinned Bazel version from 9.1.1 to 9.2.0 and refresh `MODULE.bazel.lock` accordingly.

Bazel 9.2.0 ships fixes this repo has been working around over the past month.

Our contributions:
- bazelbuild/bazel#29984, which should remove the need for temporary countermeasures we had to come up with:
  - DataDog/datadog-agent-buildimages#1212 (alas ineffective),
  - DataDog/datadog-agent-buildimages#1215 (effective),
  - #52500,
- bazelbuild/bazel#30182, which should remove the need for:
  - #52061,
  - #53591.

- bazelbuild/bazel#29791,
- bazelbuild/bazel#29868,
- bazelbuild/bazel#29885,
- bazelbuild/bazel#30193, a caveat mentioned in:
  - #53356.

Also worth noting, though not tied to a specific incident here:
- bazelbuild/bazel#29807,
- bazelbuild/bazel#29898,
- bazelbuild/bazel#30194.

`bazel version` reports 9.2.0 after `bazelisk` re-bootstraps. `bazel build //pkg/config/schema/...` completes successfully. `bazel shutdown` followed by `bazel mod deps --lockfile_mode=refresh` leaves `MODULE.bazel.lock` unchanged.

None of the .bazelrc UAC/8dot3 workarounds (DataDog/datadog-agent-buildimages#1215, #52500, #52061, #53591) are removed here. Each needs its own re-verification on Windows before being reverted as follow-ups.


(cherry picked from commit 695123c)

<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->

### What does this PR do?

### Motivation

### Describe how you validated your changes

### Additional Notes


Co-authored-by: rdesgroppes <rdesgroppes@gmail.com>
Co-authored-by: ali.benabdallah <ali.benabdallah@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Remote-Exec Issues and PRs for the Execution (Remote) team

2 participants