Repository navigation
fix(ingestion): migrate composite PaddleOCR layout selectors - #21236
yuzhichang merged 1 commit into
Conversation
Python stored layout_recognize as "<model>@<instance>@<provider>". The migration rejected a PaddleOCR composite and aborted InitDB, so a single legacy row prevented the server from starting. The Go PDF dispatcher already matches the provider spelling and resolves the tenant's PaddleOCR OCR model, so the composite's model and instance segments never select a model there. Convert the value to the parse method the dispatcher reads instead of failing the migration.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
Python stored
layout_recognizevalues as<model>@<instance>@<provider>. The Go parser-config migration treated a composite PaddleOCR selector as unsupported and returned an error, which rolled back the batch and madeInitDBfail. A single legacy dataset row therefore preventedmigrate_serverfrom starting, and because the migration version is only written after a successful run, every restart failed on the same row.The Go PDF dispatcher already handles this selector: it matches
@paddleocrand resolves the tenant's PaddleOCR OCR model, and the composite's model/instance segments are never dispatch selectors there. The migration now converts the value toparse_method: "paddleocr"instead of rejecting it, aligning migration with runtime. The OCR selectors that genuinely have no dispatch path (mistral ocr,somark,opendataloader) still fail fast so they cannot silently fall through to generic VLM chat.Related Issue
None.
Changes
internal/dao/ingestion_parser_config_migration.go: map composite@paddleocrreferences toparse_method: "paddleocr"; keep rejecting the three genuinely unsupported selectors.internal/dao/ingestion_parser_config_migration_test.go: add the PaddleOCR conversion case and drop it from the rejection table.Test Plan
bash build.sh --test ./internal/dao/...passes (internal/daoandinternal/dao/transactionboth ok).[email protected]@PaddleOCR→{"Parser:HipSignsRhyme":{"pdf":{"parse_method":"paddleocr"}}}.knowledgebase.id=76af0e2a647711f1bb3a0d315b6417e3) no longer aborts the migration.