Trustworthy garbage collection: complete reference discovery (#1469) + race-safe deletion (#1445)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- backend, data-engineering, databases
Línea de trabajo
Empieza leyendo las issues #1469 y #1445 para entender la secuencia de implementación requerida y los requisitos de referenced_paths y de eliminación en dos fases. Después revisa los objetivos de documentación indicados, especialmente reference/specs/garbage-collection.md, how-to/garbage-collection.md y reference/specs/codec-api.md. Se considera terminado cuando la implementación aborda tanto el descubrimiento como la seguridad frente a condiciones de carrera, y la documentación cubre el contrato de codec, el flujo de trabajo, la configuración, la concurrencia y la semántica de restauración.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Umbrella tracking the invariant: garbage collection must never delete an object that is still referenced. Today it can, via two independent failure modes that look similar but have different root causes:
- Incomplete discovery — #1469:
dj.gc.scanhardcodes the built-in codec names (hash/blob/attach,object/npy), so files referenced by a custom codec are never enumerated. The store scan then reports live files as orphans andcollect()deletes them. (Row delete also fails to remove custom-codec files.) - Stale discovery / TOCTOU race — #1445: the scan is correct, but an insert during the scan→delete window has its file deleted out from under it.
They are complementary layers of one goal, not duplicates — and must be fixed in order:
- #1469 — complete reference discovery (correctness, FIRST). Codec-owned
referenced_pathshook;scanand delete-cleanup become codec-driven instead of name-hardcoded. Closes active data loss for real pipelines (aeon_mecha). - #1445 — race-safe deletion (hardening, SECOND). Two-phase quarantine → grace → purge with re-check-before-delete;
_trash/prefix for state.
Why the sequence matters
#1445's purge() re-check reruns the scan. On a codec-blind scan (pre-#1469) it would still classify a live custom-codec file as an orphan and purge it after the grace window — so the grace window can't save you from a scan that never sees the reference. Complete discovery (#1469) is the precondition for safe deletion (#1445).
Documentation (datajoint-docs) — to land with the implementation
Add
reference/specs/garbage-collection.md(new normative spec — none exists today). The orphan-determination model, thereferenced_pathscodec contract, the two-phase quarantine/grace/purge state machine, config keys (gc.grace_seconds), re-check/concurrency semantics, backend atomic-move requirements, andrestore. (#1445 explicitly asks for a written spec.)
Update
how-to/garbage-collection.md("Clean Up Object Storage") — document the two-phase workflow (quarantine/purge/restore,grace_seconds); note custom-codec external files are now handled; revise the "single-pass, best-effort" admonition added in #189 once two-phase lands.reference/specs/codec-api.md— documentreferenced_pathsas part of the Codec contract (required for any codec that owns external artifacts).how-to/create-custom-codec.md,explanation/custom-codecs.md,how-to/use-plugin-codecs.md— author guidance: if your codec writes external files, implementreferenced_pathsso delete + GC see them (otherwise files leak or, worse, get misclassified as orphans and deleted).reference/specs/provenance.md— the GC concurrency wording references single-pass semantics; align once two-phase ships (minor).- Optionally a short explainer (e.g. in
explanation/object-storage-overview.md) on how DataJoint tracks external references — codecs own their paths; delete and GC consult them.
- Lenguaje dominante
- Python
- Estrellas
- 197
- Forks
- 98
- Merge medio
- 6 d 7 h
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de datajoint/datajoint-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
datajoint/datajoint-python#1539 · 3 comentarios ·
-
dj.Diagram SVG output is not byte-reproducible: set iteration order leaks into node emission order Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
datajoint/datajoint-python#1551 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
datajoint/datajoint-python#1550 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
datajoint/datajoint-python#1547 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
datajoint/datajoint-python#1546 · 1 comentario ·
Todos los issues de datajoint/datajoint-python
Issues similares
-
Add: hunch Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
DiamondLightSource/dodal#2211 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
openml/openml-python#1749 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
sipyourdrink-ltd/bernstein#6191 ·