[PR #293] [MERGED] fix(p2p): send range header during URL probes #324

Closed
opened 2026-10-29 14:22:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/293
Author: @WindSongShaoGe
Created: 9/15/2026
Status: ✅ Merged
Merged: 9/17/2026
Merged by: @LSX-s-Software

Base: main ← Head: fix/skip-uuid-digest


📝 Commits (2)

  • a82a758 fix(p2p): send range header during URL probes
  • 51d211c test(p2p): enforce range requests in UUID facade mock

📊 Changes

2 files changed (+9 additions, -5 deletions)

View changed files

📝 storage/overlaybd/src/backend/registryfs_v2.rs (+5 -1)
📝 storage/overlaybd/src/image/image_file.rs (+4 -4)

📄 Description

What

Send Range: bytes=0-0 during HTTP URL resolution so direct UUID-facade layer opens can complete. Make the UUID facade mock reject GET requests without Range, matching the real facade.

Why

open_ro_p2p_uuid passes /p2p-uuid/<uuid> to open_source_blob_with_size. For HTTP URLs, RegistryFsV2 calls resolve_actual_url_once before the normal range read. That initial GET previously had no Range header and the UUID facade returned HTTP 400.

This is the direct UUID-facade path. The regular source-registry URL probe does not go through the P2P facade; this PR does not claim otherwise.

Addresses the direct UUID-facade compatibility problem discussed in this PR. No issue-closing claim.

Scope and non-goals

Only two files change: the URL probe and its UUID facade test mock. The broader OSS snapshot publication, digest lookup, hashing, file-retention, TCP and CI changes have been removed from this PR and preserved separately. The P2P full-chain harness remains on its separate test branch.

Design and behavior changes

  • Add a one-byte Range header to the URL probe.
  • Return HTTP 400 from the test facade when a GET omits Range, so the existing local-file-missing and remote UUID layer tests exercise the compatibility requirement.

Compatibility and operations

  • Public API or generated protocol: no API/schema changes; HTTP probes now carry Range.
  • Configuration or defaults: unchanged.
  • Snapshot manifest, artifact layout, or storage format: unchanged.
  • Upgrade and rollback: no migration required.
  • Host requirements, permissions, ports, or dependencies: unchanged.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Commands and results on 51d211c, based on main f58d55e:

cargo test -p overlaybd --lib image::image_file::tests       28 passed
cargo test -p overlaybd --lib backend::registryfs_v2::tests  18 passed
make fmt                                                  PASS
make clippy                                               PASS

Negative control: temporarily remove only the production Range fix while keeping the stricter mock. Both test_missing_file_lower_with_uuid_opens_from_p2p_uuid_facade and test_remote_lower_with_uuid_prefers_p2p_uuid_facade fail; the first reports HTTP 400 while resolving /p2p-uuid/.... Restoring the fix makes all 28 image tests pass.

Skipped checks and reasons: full VM/OSS/P2P-chain suites were not rerun for this narrow change. The prior full-chain results apply to the broader follow-up branch, not this two-file fix. No Go, schema, deployment or persisted-format changes.

Risks and reviewer notes

The Range header applies to HTTP URL probes generally; the registry suite covers existing redirect/authentication behavior. The fix is about URL resolution before range reads, not about missing Range headers in send_range_request.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by regression tests with a failing negative control.
  • Logs and examples contain no production credentials, tokens, or private registry information.
  • No generated code was manually edited.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/293 **Author:** [@WindSongShaoGe](https://github.com/WindSongShaoGe) **Created:** 9/15/2026 **Status:** ✅ Merged **Merged:** 9/17/2026 **Merged by:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Base:** `main` ← **Head:** `fix/skip-uuid-digest` --- ### 📝 Commits (2) - [`a82a758`](https://github.com/kvcache-ai/AgentENV/commit/a82a758a39247d07253703e85ebcceca4ce4a47d) fix(p2p): send range header during URL probes - [`51d211c`](https://github.com/kvcache-ai/AgentENV/commit/51d211ce47676ef637a9f79c494f50a6aa17fc48) test(p2p): enforce range requests in UUID facade mock ### 📊 Changes **2 files changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `storage/overlaybd/src/backend/registryfs_v2.rs` (+5 -1) 📝 `storage/overlaybd/src/image/image_file.rs` (+4 -4) </details> ### 📄 Description ## What Send `Range: bytes=0-0` during HTTP URL resolution so direct UUID-facade layer opens can complete. Make the UUID facade mock reject GET requests without Range, matching the real facade. ## Why `open_ro_p2p_uuid` passes `/p2p-uuid/<uuid>` to `open_source_blob_with_size`. For HTTP URLs, `RegistryFsV2` calls `resolve_actual_url_once` before the normal range read. That initial GET previously had no Range header and the UUID facade returned HTTP 400. This is the direct UUID-facade path. The regular source-registry URL probe does not go through the P2P facade; this PR does not claim otherwise. ## Related issue Addresses the direct UUID-facade compatibility problem discussed in this PR. No issue-closing claim. ## Scope and non-goals Only two files change: the URL probe and its UUID facade test mock. The broader OSS snapshot publication, digest lookup, hashing, file-retention, TCP and CI changes have been removed from this PR and preserved separately. The P2P full-chain harness remains on its separate test branch. ## Design and behavior changes - Add a one-byte Range header to the URL probe. - Return HTTP 400 from the test facade when a GET omits Range, so the existing local-file-missing and remote UUID layer tests exercise the compatibility requirement. ## Compatibility and operations - Public API or generated protocol: no API/schema changes; HTTP probes now carry Range. - Configuration or defaults: unchanged. - Snapshot manifest, artifact layout, or storage format: unchanged. - Upgrade and rollback: no migration required. - Host requirements, permissions, ports, or dependencies: unchanged. ## Validation - [x] `make fmt` - [x] `make clippy` - [ ] `make test-unit` - [ ] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed Commands and results on `51d211c`, based on main `f58d55e`: ```text cargo test -p overlaybd --lib image::image_file::tests 28 passed cargo test -p overlaybd --lib backend::registryfs_v2::tests 18 passed make fmt PASS make clippy PASS ``` Negative control: temporarily remove only the production Range fix while keeping the stricter mock. Both `test_missing_file_lower_with_uuid_opens_from_p2p_uuid_facade` and `test_remote_lower_with_uuid_prefers_p2p_uuid_facade` fail; the first reports HTTP 400 while resolving `/p2p-uuid/...`. Restoring the fix makes all 28 image tests pass. Skipped checks and reasons: full VM/OSS/P2P-chain suites were not rerun for this narrow change. The prior full-chain results apply to the broader follow-up branch, not this two-file fix. No Go, schema, deployment or persisted-format changes. ## Risks and reviewer notes The Range header applies to HTTP URL probes generally; the registry suite covers existing redirect/authentication behavior. The fix is about URL resolution before range reads, not about missing Range headers in `send_range_request`. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by regression tests with a failing negative control. - [x] Logs and examples contain no production credentials, tokens, or private registry information. - [x] No generated code was manually edited. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:22:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#324
No description provided.