Receive pushed data into an archive through the Peer protocol
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, databases, distributed-systems
Direzione di ricerca
Start with DiskSyncConnection in morango/sync/syncsession.py, then read TransferSessionViewSet and BufferViewSet in morango/api/viewsets.py, especially the scope checks at lines 348-354. Review spec §3.6 and implementation-plan Task 23 before implementing the six methods. Done means the listed acceptance criteria pass, including archive writes within assert_no_default_db_queries(); note that work is blocked by issues #367, #371, and #383.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Overview
A disk connection receives a push through the Peer protocol and stores the data in the archive, as a morango server does. This issue is part of milestone M6 (disk connection).
Background & Motivation
The shared Peer* operations from #374 drive a peer only through the Peer protocol. The network connection answers the protocol with HTTP calls to a server. The disk connection must answer the same protocol, with the archive in the role of the server.
The parity rule requires that the archive holds the same state as a server that receives the same push. For this reason, the disk connection calls the same receiver functions that the server uses. It does not use separate write logic.
Design: spec. Plan: implementation plan, Task 23.
User Story
As a Kolibri developer,
I want a push over a disk connection to complete all transfer stages,
So that the exported archive holds the same records and counters as a server.
Description & Expected Outcomes
The disk connection implements the six Peer protocol methods. It rejects a pull, because Phase 1 supports export only.
When a transfer session is created, the disk connection applies the same scope checks as the server. The filter must be in the write scope of the client certificate and the read scope of the archive certificate. The connection records the filter in the manifest.
When an update asks for a later stage, the disk connection runs each stage step in order up to that stage. It stops at the first step that does not complete. The steps compute the archive FSIC, accept record chunks, and dequeue the records into the archive store.
The disk connection returns every result as a PeerTransferSession. All writes to the archive happen inside a transaction on the archive alias.
Deliverables & Contracts
The feature delivers these capabilities:
create_transfer_session,get_transfer_session,update_transfer_session,close_transfer_session,push_record_chunkandpull_record_chunkonDiskSyncConnection, as spec §3.6 describes.- An update to a later stage runs every skipped stage step in order.
- A push through the shared
Peer*operations writesStore,RecordMaxCounterandDatabaseMaxCounterrows in the archive.
Acceptance Criteria
-
create_transfer_sessionfor a pull raisesMorangoError. - A filter outside the certificate scopes raises
MorangoError. -
create_transfer_sessionsets the manifestfilter. -
update_transfer_session(ts, transfer_stage="queuing")frominitializingrunsserializingandqueuing, and returns stagequeuingwith statuscompleted. -
push_record_chunksets the stage totransferringand increasesrecords_transferredby the chunk length. - An update to
dequeuingwritesStore,RecordMaxCounterandDatabaseMaxCounterrows in the archive and increments the archive instance counter. - Two calls to
close_transfer_sessiondo not raise. -
pull_record_chunkraisesMorangoError. - All archive writes pass inside
assert_no_default_db_queries().
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/syncsession.py(DiskSyncConnection). - Related Patterns:
TransferSessionViewSet(morango/api/viewsets.py:319) andBufferViewSet(morango/api/viewsets.py:452) are the server behavior to mirror. The scope checks are atmorango/api/viewsets.py:348-354. - Data Model & Schema Considerations: No schema change.
- Resilience & Failure Modes: The disk connection runs synchronously. Each stage step either completes or raises. Errors must not be suppressed.
Notes & Tradeoffs
- Dependencies: Blocked by: #367 (receiver helpers take
db), #371 (Peer protocol andPeerTransferSession), #383 (disk connection lifecycle). Blocks: #385, #386. - Kolibri companion changes: See spec §3.9. Kolibri routers must allow morango migrations on aliases that start with
morango_archive_. Kolibri settings overrides must list thePeer*operations. - Tradeoffs & Alternatives Considered: The spec rejects a run of the server middleware against the archive. Server operations read the HTTP request, and host operations also run in that path. The contract suite in #385 guards against drift from server behavior.
- Follow-up: A separate issue will split
update_transfer_sessioninto a field update and a stage advance (command-query separation).
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.
- Lingua principale
- Python
- Stelle
- 15
- Fork
- 23
- Merge medio
- 1g 11h
- PR unite (30g)
- 4
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di learningequality/morango
-
DEV: dev-ops DEV: distributions DOCS: developer
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
learningequality/morango#387 ·
-
DEV: backend DEV: dev-ops TAG: unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
learningequality/morango#385 ·
-
DEV: backend P0 - critical TAG: tech update / debt TAG: unit tests
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
learningequality/morango#364 ·
-
DEV: backend TAG: new feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
learningequality/morango#388 ·
-
DEV: backend TAG: unit tests
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
learningequality/morango#386 ·
Tutte le issue di learningequality/morango
Issue simili
-
needs-human needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
gke-labs/kube-agents#2400 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reusedForse già presa @sylvesterkaczmarek l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
google-deepmind/bsuite#56 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
LearningCircuit/local-deep-research#7206 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chingu-voyages/V62-tier3-team-33#285 ·
I maintainer di solito rispondono entro 1 giorno