staged_insert1 stores object paths with the class name and an empty store name, so garbage collection can delete its objects
Maintainer thường phản hồi trong vòng 6 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- mysql, postgresql, python
- Lĩnh vực
- data-engineering, databases
Hướng nghiên cứu
Đọc src/datajoint/staged_insert.py, đặc biệt là phần tạo đường dẫn ở dòng 103–124 và metadata của store ở dòng 214–222; so sánh chúng với đường xử lý insert1 thông thường. Issue đề xuất dùng self._table.table_name và config.resolve_store_name(store_name). Thêm hoặc chạy kiểm thử cho các thuộc tính đối tượng trên bảng thường và bảng part, bao gồm store mặc định; hoàn tất khi các hàng được chèn theo lô dùng cùng bố cục đường dẫn và tên store đã phân giải như insert1.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Python
- Star
- 198
- Fork
- 103
- Merge trung bình
- 6 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của datajoint/datajoint-python
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
datajoint/datajoint-python#1703 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
datajoint/datajoint-python#1702 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
datajoint/datajoint-python#1691 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
dependencies needs-discussion
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
datajoint/datajoint-python#1687 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
bool() ignores dj.TopĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
datajoint/datajoint-python#1668 ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của datajoint/datajoint-python
Issue tương tự
-
cognition
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Suggestion]: Geonode MCP ServerĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
collabnix/awesome-mcp-lists#433 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
CrossEntropyFilter raises on zero probabilities and single-class resultsCó thể đã có người làm @NopeCharon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Archmonger/ServeStatic#129 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày