SQL backends: LSI Query orders items that share an index sort key differently from the service
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by reading order_by_columns in crates/storage-postgres/src/data/query_scan.rs and query_order_columns in crates/storage-sqlite/src/data/query_scan.rs, then run 366-probe.py against the service and ExtendDB. Measure LSI tie ordering for number and binary base sort keys and partitions with more than four tied items before choosing a rule. Done when forward and reverse results, page boundaries, and LastEvaluatedKey match the service.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
On a local secondary index, when several items in one partition share the same index sort key value, ExtendDB orders them by the base table sort key in byte order. The service orders them differently, and two fresh tables gave the same order, so the order depends on the key values. Pages and LastEvaluatedKey follow each side's order, so a client paging an LSI partition with ties sees different page contents on ExtendDB than on the service.
Found while verifying the fix for #366, which keeps ExtendDB's current order unchanged; this is a separate, pre-existing divergence.
Measured against the service (2026-10-21, us-east-1)
Table with partition key pk, sort key sk, LSI on lsk. Partition p holds nine items; three groups share an lsk value. Insertion order of (sk, lsk): (t07,m) (t03,m) (T05,m) (t01,a) (t10,z) (t02,z) (t04,m) (_09,a) (t06,z).
Query on the LSI, pk = p, no limit, forward, shown as [lsk, sk]:
| order | |
|---|---|
| service (two fresh tables, identical) | [a,_09] [a,t01] [m,t03] [m,t07] [m,t04] [m,T05] [z,t06] [z,t02] [z,t10] |
ExtendDB, PostgreSQL and SQLite, main at ec81e9d4 |
[a,_09] [a,t01] [m,T05] [m,t03] [m,t04] [m,t07] [z,t02] [z,t06] [z,t10] |
ScanIndexForward = false returns the exact mirror on both sides. With Limit set, page boundaries and LastEvaluatedKey ({lsk, pk, sk}) follow each side's order, so the second page of Limit 2 is [m,t03] [m,t07] on the service and [m,T05] [m,t03] on ExtendDB.
Within a group the service order is not byte order of sk (T05 t03 t04 t07) and not insertion order (t07 t03 T05 t04). Across groups the index sort key orders in byte order on both sides.
Expected
Items that share an LSI sort key value are returned in the order the service returns them, forward and reverse, with the same page boundaries.
Where
order_by_columns in crates/storage-postgres/src/data/query_scan.rs and query_order_columns in crates/storage-sqlite/src/data/query_scan.rs order an LSI query by (sk, base_sk) on main (and by (sk, base_pk, base_sk) after #366). The rule the service applies to ties has to be measured on more shapes before it can be implemented: the probe above used string base sort keys of mixed case; number and binary sort keys, and partitions with more than four tied items, have not been measured.
Probe
366-probe.py from the #366 work creates the table above and prints the forward and reverse order and the Limit 2, Limit 3 and Limit 1 page sequences; it runs against the service with no endpoint set and against an ExtendDB server with EXTENDDB_TEST_ENDPOINT set.
- Ngôn ngữ chính
- Rust
- Star
- 517
- Fork
- 60
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- 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 ExtendDB/extenddb
-
backend:mongodb bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 2 ngày
-
backend:cassandra bug
Độ 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 2 ngày
-
documentation
Độ 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 2 ngày
-
backend:cassandra bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[storage.cassandra] accepts unknown keys silentlyCó thể đã có người làm @LeeroyHannigan đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
ExtendDB/extenddb#540 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của ExtendDB/extenddb
Issue tương tự
-
area:io kernel-paused needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bherbruck/solvecraft#7854 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
transit-audio/transit#159 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
HakanSeven12/OpenCADStudio#2257 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
priority: low ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
storytold/photocraft#9884 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
triage: new type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Jagalite/superseedr#376 ·
Maintainer thường phản hồi trong vòng 1 ngày