mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #276] [CLOSED] fix(p2p): restore OSS snapshot layers through peers #311
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#311
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/276
Author: @WindSongShaoGe
Created: 9/11/2026
Status: ❌ Closed
Base:
main← Head:fix/p2p-snapshot-layer-compatibility📝 Commits (2)
dd69d8efix(p2p): restore OSS snapshot layers through peers1bfe8a1fix(p2p): retain origin fallback after peer open📊 Changes
7 files changed (+488 additions, -43 deletions)
View changed files
📝
docs/src/internals/p2p-design.md(+3 -1)📝
src/overlaybd/p2p/facade.rs(+152 -13)📝
src/snapshot/manager.rs(+24 -15)📝
src/snapshot/p2p.rs(+78 -5)📝
storage/overlaybd/src/backend/registryfs_v2.rs(+6 -1)📝
storage/overlaybd/src/image/image_file.rs(+216 -7)📝
storage/overlaybd/src/image/image_service.rs(+9 -1)📄 Description
What
Fix peer reads of OSS-backed snapshot layers. OverlayBD URL probes now send a bounded Range header, digest-addressed layers can be opened through the P2P facade, and local snapshot layers without digest/size metadata are described before publication. Enable TCP_NODELAY on facade connections used for small range reads during restore.
Why
The actual-URL probe previously sent GET without Range, so the range-only UUID facade returned HTTP 400. Fixing that probe alone still leaves layers without UUIDs on the OSS read path. In a cold-node restore where OSS data reads are blocked, these gaps prevent template or snapshot recovery.
The complete patch passed the strict two-node full-chain suite on main commit
3815a57: template launch and captured disk/memory recovery issued zero OSS data GETs, and OCI conversion reuse issued zero source-layer GETs.Related issue
No linked issue. A separate compatibility fix was requested in prior maintainer discussion.
Scope and non-goals
Includes layer publication/read-path fixes, focused regression tests, and P2P design documentation. The standalone full-chain E2E suite and its Compose/configuration files are retained on a separate test branch and are excluded from this PR. No changes to snapshot storage formats or publication compression policy.
Design and behavior changes
Range: bytes=0-0to actual-URL probes, matching the existing authentication probe./p2p-digest/{digest}using the existing canonical layer identity, descriptor validation, and bounded-range handling shared with the UUID facade.Compatibility and operations
Validation
make fmtmake clippymake test-unitmake -C services test(required whenservices/changes)maketargetCommands and results:
Strict E2E validation used the separately retained test commit
9a7cd21(main3815a57plus the complete patch). The production source files in that commit are byte-identical to this PR. Server/daemon were freshly built from that source and installed in an isolated test image using the previously passing run's dependencies.Result: all 6 stages passed (template P2P launch, source capture, snapshot P2P recovery, OSS fallback, OCI conversion reuse, and OCI fallback). The harness's 12 Python tests also passed. Run ID:
1789115644-117861. Template/snapshot data GETs to OSS and OCI source-layer GETs were zero in the corresponding P2P stages. The test image and suite are local validation artifacts, not public dependencies of this PR.Skipped checks and reasons:
Aggregate
make test-unitand other Rust integration targets were not run; validation focused on the affected modules and the strict two-node VM E2E suite. No Go or generated-code changes, so Go checks and regeneration were not required. No standalone performance benchmark was run.Risks and reviewer notes
This is broader than the earlier Range-only patch: digest reads, descriptorless-layer publication, and TCP_NODELAY are also included. The validation demonstrates the combined patch, not the individual performance contribution of each change.
Digest probing adds a P2P attempt on remote-layer opens. Computing missing local descriptors adds hashing work at publication. Publication still requires a digest present in the committed record. Publish-time recompression that changes local bytes remains outside the validated strict scenario; the E2E configuration disables publication compression. The facade does not receive OSS credentials, and P2P failures retain the existing origin fallback.
Checklist
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.