Summary: | Elasticsearch: Multiprocess reindexing sometimes doesn't reindex all records | ||
---|---|---|---|
Product: | Koha | Reporter: | Björn Nylén <bjorn.nylen> |
Component: | Searching - Elasticsearch | Assignee: | Björn Nylén <bjorn.nylen> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | P5 - low | CC: | andrew, caroline.cyr-la-rose, fridolin.somers, joonas.kylmala, nick, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.02,20.05.08
|
|
Circulation function: | |||
Attachments: |
Truncate commit size to make sure it's an integer
Truncate commit size to make sure it's an integer - QA update Bug 26996: Convert Elasticsearch indexer commit buffer size to integer Bug 26996: Convert Elasticsearch indexer commit buffer size to integer |
Description
Björn Nylén
2020-11-11 10:50:58 UTC
Created attachment 113482 [details] [review] Truncate commit size to make sure it's an integer Patch to truncate commit size to be sure it's an integer 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..." Thanks, this fixes the problem indeed. Few things to improve on the patch: - In the commit title describe what the fix does, not what the problem is. E.g. "Convert Elasticsearch indexer commit buffer size to int" and in the body describe that it fixes the buffer counter not resetting and the reason why it fixes it. - In the commit title use "Bug XXXX: YYY" format which is used by every other commit we have (now there is the "-" character instead). - Add whitespace between the multiplication and parentheses. Created attachment 114227 [details] [review] Truncate commit size to make sure it's an integer - QA update New patch with suggested QA changes. Moved the truncation to a separeate line to make it more obvious. Created attachment 114232 [details] [review] Bug 26996: Convert Elasticsearch indexer commit buffer size to integer When multithreaded indexing is used, the commit size for children are spread out resulting in them being of type float. When records are processed and the commit counter decreased it may then never reach *exactly* 0. This means records are never commited. This patch makes sure the counter is an integer to avoid the problem. 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 both processes are logging "Committing xxx records..." Sponsored-by: Lund University Library Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Created attachment 114679 [details] [review] Bug 26996: Convert Elasticsearch indexer commit buffer size to integer When multithreaded indexing is used, the commit size for children are spread out resulting in them being of type float. When records are processed and the commit counter decreased it may then never reach *exactly* 0. This means records are never commited. This patch makes sure the counter is an integer to avoid the problem. 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 both processes are logging "Committing xxx records..." Sponsored-by: Lund University Library Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> In testing it did seem as if the records were committed in the end, caught by the final index of remaining records, but very not ideal, especially in a large system Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.02 Pushed to 20.05.x for 20.05.08 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |