https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42669

            Bug ID: 42669
           Summary: es_indexer_daemon.pl silently marks jobs finished on
                    indexing failure and doesn't recover from NoNodes
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: Searching - Elasticsearch
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
            Blocks: 39769

es_indexer_daemon.pl has two issues that cause silent data loss:

1. When update_index() throws an exception (e.g. NoNodes, BadResponse), the
   exception is caught and logged, but the job is still marked
status='finished'.
   This means records are never re-indexed and silently disappear from search
   results.

2. The Search::Elasticsearch client (cxn_pool=Static) marks nodes as 'dead'
   after a connection failure and applies exponential backoff up to 60 minutes.
   Since the indexer objects are created once at daemon startup, a brief ES
   restart (e.g. Docker upgrade) leaves the daemon permanently stuck in NoNodes
   state until manually restarted.

Fix:
- On NoNodes: abort the batch, recreate the indexer object (resetting the
  connection pool), and reset jobs to status='new' for automatic retry.
- On other indexing errors: mark jobs as 'failed' instead of 'finished'.

Test plan:
1. Start es_indexer_daemon.pl
2. Stop Elasticsearch
3. Add/modify a biblio record (triggers indexing job)
4. Verify the job stays in status='new' (not 'finished')
5. Restart Elasticsearch
6. Verify the job is picked up and indexed successfully


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39769
[Bug 39769] es_indexer_daemon.pl uses stale L1 cache
-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to