staged_insert1 stores object paths with the class name and an empty store name, so garbage collection can delete its objects
維護者通常 6 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 78/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- mysql, postgresql, python
研究方向
閱讀 src/datajoint/staged_insert.py,特別查看第 103–124 行的路徑建構,以及第 214–222 行的 store 中繼資料;將它們與一般的 insert1 路徑比較。Issue 建議使用 self._table.table_name 和 config.resolve_store_name(store_name)。為一般資料表和 part 資料表上的物件屬性新增或執行測試,包含預設 store;當 staged 插入的資料列使用與 insert1 相同的路徑配置和解析後的 store 名稱時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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).
- 主要語言
- Python
- 星號
- 198
- 分支
- 103
- 平均合併
- 6 天 1 小時
- 30 天內合併 PR
- 10
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
datajoint/datajoint-python 的其他 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
datajoint/datajoint-python#1703 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
datajoint/datajoint-python#1702 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 74/100
datajoint/datajoint-python#1691 ·
維護者通常 6 天內回覆
-
dependencies needs-discussion
難度 2/5 1-3 小時 新手友好度 68/100
datajoint/datajoint-python#1687 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 80/100
datajoint/datajoint-python#1668 ·
維護者通常 6 天內回覆
查看 datajoint/datajoint-python 的全部 Issue
相似的 Issue
-
cognition
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100
collabnix/awesome-mcp-lists#433 ·
維護者通常 4 天內回覆
-
CrossEntropyFilter raises on zero probabilities and single-class results可能已有人在做 @NopeCharon 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
Archmonger/ServeStatic#129 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 2 天內回覆