Shared reader for chunks of queued buffers

Aperta
#368 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
django, postgresql, python
Ambito
backend, database

Direzione di ricerca

First check the dependency in #365, then read morango/sync/operations.py:1480-1521 and the BufferSerializer pattern in morango/api/serializers.py. Verify the characterization suite from #363 and #364, including the offset, ordering, and rmcb_list requirements. Done means the network push preserves behavior and tox -e postgres passes without test edits.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

DEV: backend P0 - critical TAG: tech update / debt

Overview

This task (milestone M2) moves the code that reads one chunk of queued buffers out of the network push operation. The result is one reader that the shared push operation uses for every connection type.

Background & Motivation

A push reads queued buffers in chunks and sends each chunk to the peer. Today this read is inside NetworkPushTransferOperation, and it uses the default database. The shared push operation in #374 needs the same read for network and disk peers.

Design: spec. Plan: implementation plan, Task 7.

Description & Expected Outcomes

A private function returns the serialized buffers of one transfer session for an offset and a chunk size. It orders the buffers by primary key, and each item includes its record max counter list. The function reads from the database handle that the caller gives. The network push operation uses this function with the context database.

Deliverables & Contracts

The task delivers:

  • _serialize_buffer_chunk(transfer_session, offset, chunk_size, db), with db required.
  • A network push operation that uses this function, with no change in behavior.
Acceptance Criteria
  • With 5 buffers, an offset of 2, and a chunk size of 2, the function returns the 3rd and 4th buffers by primary key.
  • Each returned item has an rmcb_list.
  • The characterization suite passes without edits.

Technical Pointers & Architecture

  • Target Components: morango/sync/operations.py:1480-1521 (NetworkPushTransferOperation.handle).
  • Related Patterns: BufferSerializer in morango/api/serializers.py.
  • Data Model & Schema Considerations: None.
  • Resilience & Failure Modes: None.

Notes & Tradeoffs

  • Dependencies: Blocked by: #365 (Explicit database handle for sync database access). Blocks: #374.
  • Testing Requirements: This is a refactor. The characterization suite from #363 and #364 must pass without edits. Run tox -e postgres at the end of milestone M2.

Metadata

  • Complexity: Low
  • 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
27
Merge medio
6g 44m
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di learningequality/morango

Tutte le issue di learningequality/morango

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.