Commit 2bd4e5e
引擎兜底路径的自增号播种此前是一次 `limit: 5000`、无排序、无过滤的
`find`,把「任意 5000 行窗口内的最大值」当成全表 MAX。对象超过 5000 行、
或某 scope 的行被其他 scope 挤出窗口时,播种低于真实 MAX,计数器从已被
占用的号段起号 —— 对 `unique` 记录号字段就是直接发出重复业务标识符。
改为完整扫描:`keysetWalk` 按 `id` 游标分页(非 offset,#4363),前缀
下推为 `$startsWith`,数值最大值在引擎侧逐值解析。刻意不委托给
`orderBy desc + limit 1` 或聚合 `max` —— 两者按文本排序,字典序等于
数值序仅当 scope 内全部补零到同一定宽,而格式语言不保证(无 `{0..0}`
槽位时渲染裸计数器,`'9' > '10'`;定宽越过后溢出)。
扫描无法走完时拒绝播种并大声失败,不用已读部分的下界起号 —— 与 #6114
对读故障的处置同族。声明 `supports.autonumber` 的驱动不受影响。
Claude-Session: https://claude.ai/code/session_019Q7oc7ASjh8yxyS3Yz78We
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 747d2e4 commit 2bd4e5e
3 files changed
Lines changed: 630 additions & 23 deletions
File tree
- .changeset
- packages/objectql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments