-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Saved Objects Migrations] The default migrations.batchSize
might be too large in some scenarios
#145753
Comments
Pinging @elastic/kibana-core (Team:Core) |
Related: #92933 I knew we had a discussion about dynamically adapting |
The related issue led me to a meta issue for improving SO migrations performance: #104083
Which adds the default value but doesn't seem to address the dynamic behavior we need. |
Thanks for finding those references @TinaHeiligers I think you might be remembering #109540 We are dynamically adjusting the write batch size, but we assume it's always safe to read 1000 docs at a time. In this case parsing the response from ES failed so the only resolution would be to ask for less results from ES. |
Dynamic size when readingThis kind of error shouldn't happen anymore with #157494, as we adjust the read batch size dynamically, both for:
So I think we are covered for the read part. Dynamic size when writingNow, regarding the write batch size, the whole set documents read and transformed in the steps above are is broken down in different batches, where each batch will have at most maxBatchSizeBytes bytes. These batches are then stored in ES through bulk update. So for these writes, our upper bound is defined by global size (Mb) rather than document count. So this covers the write part for the 2 loops described above (I have to check the error message for that case). Fixed size when picking up updated mappingsHowever, there is a third place where we bulk update documents: The When calling Thus, if a customer has large SO that must be "picked up" (e.g. after doing a PitfallsThe current
Possible improvements
|
Closed by #157494 |
Some Saved Objects might be very large. An example is
canvas-workpad
. It may have embedded images in it and a large definition on its own.This means that, in some edge cases, the migration might hit errors like:
When processing the default
migrations.batchSize
of 1000 documents per batch.This content length limit is imposed by buffer.constants.MAX_STRING_LENGTH.
We could either improve the error message to let users know that reducing
migrations.batchSize
might fix this for them or, even better, automatically reduce/estimate it ourselves, and reduce the batchSize accordingly.The text was updated successfully, but these errors were encountered: