* fix(qdrant): 复制索引改用服务端返回的游标,重复游标报错并给分页加跳数上限 CopyIndices 用"上一页最后一个点的 id"当游标(repository.go:987)。Qdrant 的 scroll offset 是**包含**语义 —— proto 里写的是 "Start with this ID",实测下一页 正是从该 id 本身开始返回,所以每翻一页都会把上一页的最后一个点再读一次、再写一份 到目标库。服务端本来就把下一页该用的游标放在 ScrollResponse.next_page_offset ("Use this offset for the next query")里,而客户端只在 ScrollAndOffset() 中返回它, 本函数调用的 Scroll() 恰好把它丢掉了;终止条件也只能退化成"这一页比 64 短"。 在真实 Qdrant 1.19.1 上实测:150 个源 chunk 复制出 152 个目标点,chunk-63 与 chunk-126 各被复制两次(每个页边界一个),totalCopied 同步虚高。源库只要超过一页 (>64 个 chunk)就会命中,不需要服务端有任何异常行为。 本次修改: - 改用 q.client.ScrollAndOffset,游标直接取服务端返回的 next_page_offset;终止 条件改为"服务端没有下一页"(next_page_offset == nil),不再用短页推断读完。 - 记录用过的游标,重复即返回 "copy indices made no progress at cursor ...", 检测点在整页处理之前,重复的那一页不会再多写一份。 - 分页跳数上限 maxCopyPaginationHops(10000 页);触顶打印 Warn 并返回错误, 而不是把这一轮复制当成成功。 - 修复后同一份数据在真实 Qdrant 上测得 150 个目标点、0 重复。 回归用例用假 gRPC 服务端(拦截 unary RPC,对齐 repository_test.go 的 newInterceptedQdrantClient)复刻真实服务端的游标语义:150 个源 chunk 必须各复制 一次(修复前 152 个点、2 个重复);游标恒定不动的源端必须报 no progress (修复前 5 秒写入 3127040 个点仍未返回);一直推进但永不结束的源端在第 10000 页 被拦下。 * fix(qdrant): drop the CopyIndices page cap 10000 pages of 64 points capped a copy at 640k points and failed the whole clone beyond that. The scroll walks every point of the source knowledge base (a single-knowledge clone included), so a cap derived from the chunk map would cut off small clones out of large bases too. next_page_offset only moves forward, so the repeated-cursor check already stops a walk that cannot finish, and the task context bounds the rest. --------- Co-authored-by: linus-liu-web <11640009+linus-liu-web@users.noreply.github.com> Co-authored-by: wizardchen <wizardchen@tencent.com> |
||
|---|---|---|
| .. | ||
| access | ||
| repository | ||
| service | ||