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
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
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.
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), withdbrequired.Acceptance Criteria
rmcb_list.Technical Pointers & Architecture
morango/sync/operations.py:1480-1521(NetworkPushTransferOperation.handle).BufferSerializerinmorango/api/serializers.py.Notes & Tradeoffs
tox -e postgresat the end of milestone M2.Metadata
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.xcodebase.