staged_insert1 stores object paths with the class name and an empty store name, so garbage collection can delete its objects
Les mainteneurs répondent en général sous 6 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 78/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- mysql, postgresql, python
- Domaine
- data-engineering, databases
Piste de recherche
Lisez src/datajoint/staged_insert.py, en particulier la construction du chemin aux lignes 103–124 et les métadonnées du store aux lignes 214–222 ; comparez-les au chemin normal de insert1. L’issue suggère d’utiliser self._table.table_name et config.resolve_store_name(store_name). Ajoutez ou exécutez des tests pour les attributs d’objet sur les tables normales et les tables part, y compris le store par défaut ; le travail est terminé lorsque les lignes insérées par lots utilisent la même structure de chemin et le même nom de store résolu que insert1.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
For an <object@> attribute, insert1 builds the object's path from the table name and records the resolved store name. staged_insert1 does neither (staged_insert.py#L103-L124, #L214-L222):
- it builds the path from the class name;
- it records the store as declared, which is
""for the default store (<object@>).
Garbage collection can then delete objects that rows still refer to.
Repro (master, eefe74b4; MySQL and PostgreSQL; stores local, the default, and other)
A Manual table Recording with data : <object@>, and a part table Session.Item with the same attribute. One row in each is inserted with insert1, and one with staged_insert1:
| Row | Inserted with | Stored path |
Stored store |
|---|---|---|---|
rec_id=1 |
insert1 |
_schema/<db>/recording/rec_id=1/data_… |
local |
rec_id=2 |
staged_insert1 |
_schema/<db>/Recording/rec_id=2/data_….dat |
"" |
item_id=1 |
insert1 |
_schema/<db>/session__item/sess_id=1/item_id=1/… |
local |
item_id=2 |
staged_insert1 |
_schema/<db>/Item/sess_id=1/item_id=2/… |
"" |
Consequences
- Case-insensitive file stores (macOS, Windows).
Recording/andrecording/are the same folder there. The store listing reports it asrecording/, so the collector does not match the staged row's path and reports its object as orphaned.collect(dry_run=False)deleted it, andfetch1forrec_id=2then raisedMissingExternalFile. - Any store, after
stores.defaultchanges.- The empty store name of the staged rows resolves to the new default, so their objects can no longer be read. Rows inserted with
insert1namelocaland still read. - The collector for
localalso treats the staged objects as belonging to another store (gc.py#L183), and reports them as orphaned.
- The empty store name of the staged rows resolves to the new default, so their objects can no longer be read. Rows inserted with
- Part tables. The path gets the part's class name alone (
Item), not the table namesession__item.
These are gaps left by #1465 and #1575, which aligned the metadata of the regular insert path.
Expected
staged_insert1 stores the same path layout and the same resolved store name as insert1.
Suggested fix
Build the path with self._table.table_name, and record config.resolve_store_name(store_name).
- Langage dominant
- Python
- Étoiles
- 198
- Forks
- 103
- Merge moyen
- 6 j 1 h
- PR mergées (30 j)
- 10
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
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
datajoint/datajoint-python#1703 ·
Les mainteneurs répondent en général sous 6 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
datajoint/datajoint-python#1702 ·
Les mainteneurs répondent en général sous 6 jours
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
datajoint/datajoint-python#1691 ·
Les mainteneurs répondent en général sous 6 jours
-
dependencies needs-discussion
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
datajoint/datajoint-python#1687 ·
Les mainteneurs répondent en général sous 6 jours
-
bool() ignores dj.TopOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
datajoint/datajoint-python#1668 ·
Les mainteneurs répondent en général sous 6 jours
Toutes les issues de datajoint/datajoint-python
Issues similaires
-
cognition
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
[Suggestion]: Geonode MCP ServerOuverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
collabnix/awesome-mcp-lists#433 ·
Les mainteneurs répondent en général sous 4 jours
-
CrossEntropyFilter raises on zero probabilities and single-class resultsPeut-être pris @NopeCharon l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Archmonger/ServeStatic#129 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 2 jours