nex_docus/docs/sdd/architecture/decisions/ADR-0006-async-index-sync.md

18 lines
668 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# ADR-0006写路径异步索引同步
- **状态**Accepted
## 背景
文件变更(创建/修改/删除/移动)需同步维护向量索引与全文索引,但不能阻塞主请求线程。
## 决策
文件操作经 `ProjectFileService``FileVectorSyncService`(独立 DB 会话、按项目串行、后台 `asyncio.Task`)触发 ZVec 重向量化/删除;全文索引经 `search_service` 同步更新。整项目向量化走 `ProjectVectorizationTaskService`(后台任务 + 进度表)。
## 后果
- 写请求返回快,索引最终一致。
- 需处理并发同一项目的串行化与任务去重。
## 关联
DV-0002, DV-0006, DV-0010。