Skip to main content

Ingestion Run

Ingestion Run 是统一的入库批次追踪模型,为所有入库入口(单文件上传、批量上传、URL 导入、连接器同步)提供可观测性。

概念定位

IngestionRun 模型

字段类型说明
idUUIDRun ID
tenant_idUUID租户 ID
dataset_idUUID目标数据集
kindString(80)入库类型
requested_byString发起者
statusStringpending/running/completed/failed/cancelled
configJSONB运行配置
statsJSONB统计信息
error_messageText错误信息
created_atDateTime创建时间
started_atDateTime开始时间
finished_atDateTime结束时间

kind 枚举

kind来源
upload单文件上传
upload_batch批量上传
upload_urlURL 导入
connector:url_batchURL 批量连接器
connector:web_crawlWeb 爬虫连接器

stats 字段结构

{
"total": 10,
"succeeded": 8,
"failed": 1,
"skipped": 1,
"elapsed_ms": 45000
}

IngestionRunDocument

Run 与文档的关联表:

字段类型说明
run_idUUID关联 IngestionRun
document_idUUID关联 Document
source_refString来源引用(文件名/URL/key)
statusStringcreated/pending/processing/completed/failed/quarantined/cancelled

状态机

API 端点

方法路径说明
GET/ingestion-runs/runsRun 列表
GET/ingestion-runs/runs/{run_id}Run 详情
GET/ingestion-runs/runs/{run_id}/export导出 Run JSON
GET/ingestion-runs/runs/{run_id}/export-html导出 HTML 报告
GET/ingestion-runs/runs/{run_id}/compare/{other_id}两次 Run 对比
POST/ingestion-runs/runs/{run_id}/replay重放 Run
Run 对比

/compare/{other_run_id} 可对比两次入库 Run 的差异(新增/修改/删除的文档),适合验证增量同步效果。

批量操作与重试

场景方式
单文档重试POST /documents/{id}/retry
批量重试POST /documents/batch/retry
批量重新入库POST /documents/batch/reingest
Run 重放POST /ingestion-runs/runs/{id}/replay
设计理念

IngestionRun 是轻量级的 "best-effort" 追踪,提供企业级可观测性而不增加入库关键路径延迟。Run 创建和更新均为异步操作。

相关链接