Trustworthy garbage collection: complete reference discovery (#1469) + race-safe deletion (#1445)
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Stack technique
- python
- Domaine
- backend, data-engineering, databases
Piste de recherche
Commencez par lire les issues #1469 et #1445 afin de comprendre la séquence d’implémentation requise ainsi que les exigences liées à referenced_paths et à la suppression en deux phases. Examinez ensuite les cibles de documentation indiquées, en particulier reference/specs/garbage-collection.md, how-to/garbage-collection.md et reference/specs/codec-api.md. C’est terminé lorsque l’implémentation couvre à la fois la découverte et la sécurité contre les conditions de concurrence, et que la documentation couvre le contrat de codec, le workflow, la configuration, la concurrence et la sémantique de restauration.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Python
- Étoiles
- 197
- Forks
- 98
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 6
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de datajoint/datajoint-python
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
datajoint/datajoint-python#1539 · 3 commentaires ·
-
JSON path equality against a non-string value: silently empty on MySQL, raises on PostgreSQLOuvertebug
Difficulté 3/5 1-2 jours Accessibilité débutants 75/100
datajoint/datajoint-python#1564 ·
-
JSON path type annotation is not portable: `data.n:int` works on PostgreSQL, raises on MySQLOuvertebug
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
datajoint/datajoint-python#1563 ·
-
enhancement
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
datajoint/datajoint-python#1562 · 2 commentaires ·
-
bug
Difficulté 3/5 1-2 jours Accessibilité débutants 75/100
datajoint/datajoint-python#1561 · 1 commentaire ·
Toutes les issues de datajoint/datajoint-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
FuRongJun-1999/dsh-memory#56 ·
Les mainteneurs répondent en général sous 1 jour
-
Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
pgadmin-org/pgadmin4#10503 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
521xueweihan/HelloGitHub#3857 ·
-
needs-ac
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Ikalus1988/MisakaNet#2845 ·
Les mainteneurs répondent en général sous 1 jour
-
bug connectors operations
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
pyinfra-dev/pyinfra#1989 ·
Les mainteneurs répondent en général sous 3 jours