Finalize archives into a compact file at the final path
Maintainer thường phản hồi trong vòng 1 ngày
@ArpitaSamanta10 đang làm issue này rồi.
Từ ngày 19/11/2026.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with Archive and ArchiveManifest in morango/sync/archive.py, then read spec §3.5 and the implementation plan's Task 21. Run the relevant tests in tests/testapp/tests/sync/test_archive.py, including the Windows-marked rename test. Done means finalize records completed_at, reclaims space, removes temporary state and the alias, renames the partial file, and leaves discard harmless afterward.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Overview
A completed archive becomes a compact file at its final path, and all temporary files and locks are removed. This issue is part of milestone M5 (archive).
Background & Motivation
During export, morango writes the archive to <path>.partial. The final path must exist only when the export completed. A reader can then trust that a file at the final path is a complete archive.
The dequeue step moves rows from Buffer to Store in the archive. This leaves free pages in the file. VACUUM reclaims them, but it needs up to twice the file size in free space. The target disk does not always have this space. The archive uses incremental auto-vacuum instead, which reclaims pages in place.
Design: spec. Plan: implementation plan, Task 21.
Description & Expected Outcomes
The archive keeps its manifest as a typed value. A write of a new manifest replaces all manifest entries.
When the archive is finalized, the archive records completed_at in the manifest and reclaims free pages. Then the archive closes its connection and removes the archive alias. It renames <path>.partial to <path> and releases the archive lock.
After finalization, a call to discard does nothing. The final file stays in place.
Deliverables & Contracts
The feature delivers these capabilities:
Archive.write_manifest(manifest)replaces all manifest entries.Archive.manifestreturns the current manifest value.Archive.finalize()produces the final file and cleans up all temporary state.
Acceptance Criteria
- After
finalize,pathexists, and<path>.partial,<path>.partial-journaland<path>.lockdo not exist. - After
finalize, the archive alias is not inconnections.databases, andfinalizedisTrue. - A reopened archive shows
completed_atset, and all other manifest fields are unchanged. - If 5,000 buffer rows are inserted and deleted before
finalize, the final file is smaller than the partial file beforefinalize. - A call to
discardafterfinalizedoes not change or delete the final file. - The rename test passes in the
windowstox environment.
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/archive.py(Archive,ArchiveManifest). - Related Patterns: Spec §3.5 describes the finalize sequence.
- Data Model & Schema Considerations: Uses
ArchiveManifestEntryrows from #376. No new schema. - Resilience & Failure Modes: If finalization fails, the export fails. The caller calls
close(), which discards the partial file. There is no resume before Phase 3.
Notes & Tradeoffs
- Dependencies: Blocked by: #377 (
ArchiveManifestvalue object), #378 (Archive.createanddiscard), #379 (archive lock). Blocks: #383. - Testing Requirements: Unit tests in
tests/testapp/tests/sync/test_archive.py. Mark the rename test with@pytest.mark.windows. - Tradeoffs & Alternatives Considered: The spec rejects
VACUUMat finalize because of its free-space cost. - Compatibility & Migrations:
auto_vacuum=INCREMENTALis set when the archive is created, before any table exists (#378).
Metadata
- Complexity: Medium
- 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.
- Ngôn ngữ chính
- Python
- Star
- 15
- Fork
- 27
- Merge trung bình
- 6 ngày 44 phút
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của learningequality/morango
-
Document disk export and deprecations in the changelogCó thể làm lại được @ArpitaSamanta10 đã nhận 14 ngày trước và không có pull request nào đang mở. Đang mởDEV: dev-ops DEV: distributions DOCS: developer
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
learningequality/morango#387 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend DEV: dev-ops TAG: unit tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
learningequality/morango#385 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 54/100
learningequality/morango#425 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 1/100
learningequality/morango#424 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DEV: backend P2 - normal
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
learningequality/morango#416 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của learningequality/morango
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
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"Có thể đã có người làm @cestercian đã nhận hôm nay. Đang mởcomp/cli P2 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
NousResearch/hermes-agent#162259 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
AOSSIE-Org/PictoPy#1802 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
community-request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
pytorch/pytorch#207247 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày