Sync stage operations work with any peer connection
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Refatoração
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- backend, databases, distributed-systems
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 15
- Forks
- 27
- Merge médio
- 6d 44min
- PRs com merge (30d)
- 13
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de learningequality/morango
-
Document disk export and deprecations in the changelogTalvez livre de novo @ArpitaSamanta10 assumiu há 14 dias e não há nenhum pull request aberto. AbertaDEV: dev-ops DEV: distributions DOCS: developer
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
learningequality/morango#387 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
DEV: backend DEV: dev-ops TAG: unit tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
learningequality/morango#385 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 54/100
learningequality/morango#425 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 1/100
learningequality/morango#424 ·
Mantenedores costumam responder em até 1 dia
-
DEV: backend P2 - normal
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
learningequality/morango#416 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de learningequality/morango
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia
-
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"Talvez já em andamento @cestercian assumiu hoje. Abertacomp/cli P2 type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
NousResearch/hermes-agent#162259 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
AOSSIE-Org/PictoPy#1802 · 2 comentários ·
Mantenedores costumam responder em até 3 dias
-
community-request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NVIDIA-NeMo/Run#727 ·
Mantenedores costumam responder em até 1 dia
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
pytorch/pytorch#207247 · 1 comentário ·
Mantenedores costumam responder em até 1 dia