staged_insert1 stores object paths with the class name and an empty store name, so garbage collection can delete its objects
Mantenedores costumam responder em até 6 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 78/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- mysql, postgresql, python
- Domínio
- data-engineering, databases
Direção de pesquisa
Leia src/datajoint/staged_insert.py, especialmente a construção do caminho nas linhas 103–124 e os metadados do store nas linhas 214–222; compare-os com o caminho normal de insert1. A issue sugere usar self._table.table_name e config.resolve_store_name(store_name). Adicione ou execute testes para atributos de objeto em tabelas normais e tabelas part, incluindo o store padrão; o trabalho estará concluído quando as linhas inseridas em lote usarem a mesma estrutura de caminho e o mesmo nome de store resolvido que insert1.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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).
- Linguagem predominante
- Python
- Estrelas
- 198
- Forks
- 103
- Merge médio
- 6d 1h
- PRs com merge (30d)
- 10
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de datajoint/datajoint-python
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
datajoint/datajoint-python#1703 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
datajoint/datajoint-python#1702 ·
Mantenedores costumam responder em até 6 dias
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
datajoint/datajoint-python#1691 ·
Mantenedores costumam responder em até 6 dias
-
dependencies needs-discussion
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
datajoint/datajoint-python#1687 ·
Mantenedores costumam responder em até 6 dias
-
bool() ignores dj.TopAbertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
datajoint/datajoint-python#1668 ·
Mantenedores costumam responder em até 6 dias
Todas as issues de datajoint/datajoint-python
Issues semelhantes
-
cognition
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
collabnix/awesome-mcp-lists#433 ·
Mantenedores costumam responder em até 4 dias
-
CrossEntropyFilter raises on zero probabilities and single-class resultsTalvez já em andamento @NopeCharon assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Archmonger/ServeStatic#129 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 2 dias