Sync stage operations work with any peer connection
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 30/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Start with morango/sync/operations.py:1201-1620 and the linked design spec and implementation plan, noting that #368, #371, and #373 are prerequisites. Review the characterization and network contract suites, then update the operation structure and test patch target described in the issue; done means all listed acceptance suites pass, including SQLite and PostgreSQL.
由索引模型根据 Issue 内容生成。
描述
Overview
One set of Peer*Operation classes drives the peer side of each transfer stage, through the Peer protocol. This work is part of milestone M4.
Background & Motivation
Today the Network*Operation classes call private HTTP methods on the connection. This ties the client-side stage logic to the network. Shared operations let the network and disk connections use the same logic. Import and resume support for disk can then reuse the same code later.
This task changes no behavior for network syncs.
Design: spec. Plan: implementation plan, Task 13.
Description & Expected Outcomes
A PeerOperation base class handles every PeerSessionContext. Its helper methods call the Peer protocol and read PeerTransferSession values.
Eight shared operations get the bodies of the current network operations:
PeerInitializeOperationPeerSerializeOperationPeerQueueOperationPeerPushTransferOperationPeerPullTransferOperationPeerDequeueOperationPeerDeserializeOperationPeerCleanupOperation
Two new base classes handle one connection type each. NetworkOperation handles NetworkSessionContext, and DiskOperation handles DiskSessionContext. The LegacyNetwork* operations become subclasses of NetworkOperation, because legacy peers are always servers.
Deliverables & Contracts
The operations deliver these capabilities:
- Each
Peer*Operationreturns the same status as the current network operation for the same state. - No operation reads or calls a private
_…member of the connection. - The push operation reads its records with
_serialize_buffer_chunkand the local database from the context.
Acceptance Criteria
- A fake Peer protocol connection shows the same status as the current operations for all eight stages. The push case uses two chunks.
- A test fails if an operation touches a connection attribute that starts with
_. - The characterization suite passes without edits.
- The network half of the contract suite passes without edits.
- The full test suite passes on SQLite and with
tox -e postgres.
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/operations.py:1201-1620. - Related Patterns:
get_buffersvalidation atmorango/sync/operations.py:1256-1289stays the same. - Data Model & Schema Considerations: None.
- Resilience & Failure Modes:
remote_proceed_tokeeps its handling ofcompletedand in-progress statuses.
Notes & Tradeoffs
- Dependencies: Blocked by: #368 (
_serialize_buffer_chunk), #371 (Peer protocol on the network connection), #373 (context hierarchy). Blocks: #375. - Testing Requirements: This is a refactor task. The characterization suite from #363 and #364 must pass without edits. One existing test changes:
tests/testapp/tests/integration/test_syncsession.py:374patchesNetworkOperation.put_buffers. The method moves toPeerOperation, so the patch target changes to it. - Tradeoffs & Alternatives Considered: The spec rejects separate
Disk*Operationclasses for every stage. They copy the client-side logic, and pull and resume need that logic again later. - Compatibility & Migrations: #375 keeps the old
Network*Operationnames.
Metadata
- Complexity: High
- Target Branch: release-v0.9.x
AI Usage
Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.
- 主要语言
- Python
- 星标
- 15
- 派生
- 27
- 平均合并
- 6 天 44 分钟
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
learningequality/morango 的其他 Issue
-
Document disk export and deprecations in the changelog可能重新可做 @ArpitaSamanta10 于 14 天前认领,目前没有进行中的 PR。 未关闭DEV: dev-ops DEV: distributions DOCS: developer
难度 1/5 1-3 小时 新手友好度 78/100
learningequality/morango#387 · 2 条评论 ·
维护者通常 1 天内回复
-
DEV: backend DEV: dev-ops TAG: unit tests
难度 2/5 1-3 小时 新手友好度 70/100
learningequality/morango#385 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 54/100
learningequality/morango#425 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 1/100
learningequality/morango#424 ·
维护者通常 1 天内回复
-
DEV: backend P2 - normal
难度 4/5 3-5 天 新手友好度 35/100
learningequality/morango#416 · 2 条评论 ·
维护者通常 1 天内回复
查看 learningequality/morango 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"可能已有人在做 @cestercian 今天认领。 未关闭comp/cli P2 type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#162259 · 1 条评论 ·
维护者通常 1 天内回复
-
bug enhancement
难度 1/5 1 小时以内 新手友好度 90/100
AOSSIE-Org/PictoPy#1802 · 2 条评论 ·
维护者通常 3 天内回复
-
community-request
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA-NeMo/Run#727 ·
维护者通常 1 天内回复
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
难度 2/5 1-3 小时 新手友好度 75/100
pytorch/pytorch#207247 · 1 条评论 ·
维护者通常 1 天内回复