| Summary: | We should resubmit an elasticsearch index job that fails | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
| Component: | Searching - Elasticsearch | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
| Status: | Failed QA --- | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | dcook, magnus, phil |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36702 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | Trivial patch |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
| Attachments: | Bug 39605: Resubmit failed ES background jobs | ||
Created attachment 180800 [details] [review] Bug 39605: Resubmit failed ES background jobs This patch adds a resubmission of an indexing chunk that fails as a new background job To test: 0 - Have KTD using ES 1 - Apply patch, restart all 2 - Update a record 3 - Check background jobs and confirm it worked 4 - Edit koha-conf and set ES port to 9201, restart_all 5 - Update a record 6 - Check background jobs 7 - The job should be failing and creating new jobs 8 - Edit koha-conf and fix the port, restart_all 9 - Confirm the newest job now succeeds If there's a problem with the record, couldn't this lead to an infinite loop? (In reply to David Cook from comment #2) > If there's a problem with the record, couldn't this lead to an infinite loop? I thought the same thing. I think this needs an answer before we can consider signing off. |
Currently, we try/catch our batched ES updates and mark all the jobs we batched as finished no matter the outcome: es_indexer_daemon.pl: try { $biblio_indexer->update_index( \@bib_chunk ); } catch { $logger->warn( sprintf "Update of elastic index failed with: %s", $_ ); }; . . . # Finish $jobs->update({ progress => 1, status => 'finished', ended_on => \'NOW()', }); In the catch we should create a new background job to resubmit the failed jobs