Repository navigation
feat(search): keep tika out of tag updates and retry incomplete extractions - #4113
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 71 |
🟢 Coverage 72.69% diff coverage · +0.23% coverage variation
Metric Results Coverage variation ✅ +0.23% coverage variation (-1.00%) Diff coverage ✅ 72.69% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (0b73e9e) 95037 29280 30.81% Head commit (cf5a087) 95213 (+176) 29557 (+277) 31.04% (+0.23%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4113) 271 197 72.69% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
I like the change in general. But since existing index entries don't have Extracted set, every file in the index will go through Tika again on the next space walk after the upgrade. If that's fine it should be mentioned in the release notes, but maybe there's a way to avoid it? For example, flip the flag to something like ExtractionFailed, so entries written before this change count as extracted by default.
good point, yes, inverting the field is a good idea, the only downside is that old failed resources are marked as ok! |
butonic
left a comment
There was a problem hiding this comment.
Keeping tika out of tag updates is the right idea 👍 but the error handling around Extracted loses files from the index, and the upgrade path re-extracts everything. Details inline.
Since the event handlers now call UpdateMetadata, UpsertItem has no production callers left. Only the Searcher interface, the mock and service_test.go still use it. I'd drop it from the interface, regenerate the mock and point the tests at UpdateMetadata / IndexSpace. Otherwise it is one more public entry point that does a full stat + extraction, which is exactly what this PR tries to get rid of.
mostly not, AFAICT: before this PR a failed extraction did not index the resource at all, so One thing left IMO: deterministic failures like an encrypted pdf are now retried on every |
This comment was marked as outdated.
This comment was marked as outdated.
|
Changed my mind on the follow up: the counter changes what we store in the index, and if |
|
The retry delays are a lower bound: Related: on a transient error (tika unreachable, 5xx, timeout, download failed) we now write nothing at all, so a new file uploaded while tika is down is not findable by name until a walk after tika is back. Tagging it does not help either, the An actual timer could be a ticker that queries for entries whose |
Description
Files Tika cannot parse stay findable, and their content is retried a limited number of times.
container-exceptionin the metadata, or no metadata at all) is still indexed by name, path and tags.ExtractionFailureobject (Count,RetryAt). It is retried after 1h, then after 24h. After the third failure the service logs a warning and stops trying until the file changes.opencloud search index --force-rescanignores the limit.--force-rescan, and there is no forced re-extraction on upgrade.UpsertItemis no longer part ofSearcher.UpdateMetadatastats the resource once and reuses one basic extractor.extractionfailure.count>=3. The search README documents the limits.How Has This Been Tested?
Types of changes