From 62ef0d024ecc21807a73e6f0c53fdd24b7d96ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Nyl=C3=A9n?= Date: Wed, 11 Nov 2020 08:35:21 +0100 Subject: [PATCH] Bug 26996 - Elasticsearch: Multiprocess reindexing sometimes doesn't reindex all records This is caused by the comit size for childs are of type float wich may casuse the child to never commit it's buffer to es. To test you must find a set of circumstances that causes the issue. For me: 1. Run: ./rebuild_elasticsearch -v -b -p 2 -c 400 2. Note that only one process is logging "Committing xxx records..." 3. Kill processes. 4. Apply patch. 5. Repeat 1 6. Note that only both processes are logging "Committing xxx records..." Sponsored-by: Lund University Library --- misc/search_tools/rebuild_elasticsearch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/search_tools/rebuild_elasticsearch.pl b/misc/search_tools/rebuild_elasticsearch.pl index ff83562f25..44437cf96e 100755 --- a/misc/search_tools/rebuild_elasticsearch.pl +++ b/misc/search_tools/rebuild_elasticsearch.pl @@ -187,7 +187,7 @@ if ($slice_count > 1) { } } # Fudge the commit count a bit to spread out the Elasticsearch commits - $commit *= 1 + 0.10 * $slice_index; + $commit = int( $commit *(1 + 0.10 * $slice_index) ); _log(1, "Processing slice @{[$slice_index + 1]} of $slice_count\n"); $iterator_options{slice} = { index => $slice_index, count => $slice_count }; } -- 2.25.1