Deprecate sorting in reindex#49458
Conversation
Reindex sort never gave a guarantee about the order of documents being indexed into the destination, though it could give a sense of locality of source data. It prevents us from doing resilient reindex and other optimizations and it has therefore been deprecated. Related to elastic#47567
|
Pinging @elastic/es-distributed (:Distributed/Reindex) |
Had to skip testing this prior to 7.6 in order to add the warning.
e8d552a to
459b66c
Compare
docs/reference/docs/reindex.asciidoc
Outdated
| `sort`::: | ||
| (Optional, list) A comma-separated list of `<field>:<direction>` pairs to sort by before indexing. | ||
| Use in conjunction with `max_docs` to control what documents are reindexed. | ||
| deprecated[7.6, sort in reindex is deprecated] *NOTE: Sorting in reindex is deprecated.* | ||
| Sorting in reindex was never guaranteed to index | ||
| documents in order and prevents future evolution of reindex such as resilience and performance | ||
| improvements. If used in combination with `max_docs`, consider using a query filter instead. |
There was a problem hiding this comment.
I feel like the deprecated macro and the bold note are a bit redundant.
I'd place this content into a block deprecated macro like below.
`sort`:::
+
--
(Optional, list) A comma-separated list of `<field>:<direction>` pairs to sort by before indexing.
Use in conjunction with `max_docs` to control what documents are reindexed.
deprecated::[7.6,Sort in reindex is deprecated. Sorting in reindex was never guaranteed to index documents in order and prevents reindex such as resilience and performance improvements. If used in combination with `max_docs`, consider using a query filter instead.]
--
There was a problem hiding this comment.
I tried this now, but I get an error saying:
element listitem: validity error : Element listitem content does not follow the DTD
which is why I originally went for the simpler solution. My asciidoc skills are not super-advanced, so maybe there is a trick to make this work?
There was a problem hiding this comment.
I was able to get this working on my end without that error.
Here's the commit on my fork if that helps:
https://github.com/jrodewig/elasticsearch/commit/7111829c9d08cba24af5dc776c53e958a7490a58
Feel free to cherry-pick it or copy/paste the contents.
There are a few tricks:
- The delimiter setup is needed.
- The
deprecatedtext must be on a single line.
There was a problem hiding this comment.
What you have is workable though. If you're not able to get the streamlined deprecated note working, I wouldn't hold up this PR. We can reformat it as a separate issue.
docs/reference/docs/reindex.asciidoc
Outdated
| Use in conjunction with `max_docs` to control what documents are reindexed. | ||
| deprecated[7.6, sort in reindex is deprecated] *NOTE: Sorting in reindex is deprecated.* | ||
| Sorting in reindex was never guaranteed to index | ||
| documents in order and prevents future evolution of reindex such as resilience and performance |
There was a problem hiding this comment.
I'd go with "further" rather than "future"
| documents in order and prevents future evolution of reindex such as resilience and performance | |
| documents in order and prevents further development of reindex, such as resilience and performance |
docs/reference/docs/reindex.asciidoc
Outdated
|
|
||
| <1> `_reindex` defaults to sorting by `_doc` so `random_score` will not have any | ||
| effect unless you override the sort to `_score`. | ||
| <1> you may need to adjust the `min_score` depending on the relative amount of |
There was a problem hiding this comment.
| <1> you may need to adjust the `min_score` depending on the relative amount of | |
| <1> You may need to adjust the `min_score` depending on the relative amount of |
jrodewig
left a comment
There was a problem hiding this comment.
LGTM. I can address reformatting the deprecated note as a separate issue.
Streamline deprecation notice and better text. Add deprecation notice to ILM reindex doc.
|
Thanks for reviewing @jrodewig and @tbrooks8. |
|
@elasticmachine run elasticsearch-ci/bwc |
Reindex sort never gave a guarantee about the order of documents being indexed into the destination, though it could give a sense of locality of source data. It prevents us from doing resilient reindex and other optimizations and it has therefore been deprecated. Related to #47567
This reverts commit 27d45c9.
Reindex sort never gave a guarantee about the order of documents being indexed into the destination, though it could give a sense of locality of source data. It prevents us from doing resilient reindex and other optimizations and it has therefore been deprecated. Related to elastic#47567
Reindex sort never gave a guarantee about the order of documents being indexed into the destination, though it could give a sense of locality of source data. It prevents us from doing resilient reindex and other optimizations and it has therefore been deprecated. Related to #47567
Moved the deprecation warning to ReindexValidator to ensure it runs early and works with resilient reindex. Also check that the warning is reported back also for wait_for_completion=false. Follow-up to elastic#49458
Moved the deprecation warning to ReindexValidator to ensure it runs early and works with resilient reindex. Also check that the warning is reported back for wait_for_completion=false. Follow-up to #49458
Moved the deprecation warning to ReindexValidator to ensure it runs early and works with resilient reindex. Also check that the warning is reported back for wait_for_completion=false. Follow-up to elastic#49458
Reindex sort never gave a guarantee about the order of documents being indexed into the destination, though it could give a sense of locality of source data. It prevents us from doing resilient reindex and other optimizations and it has therefore been deprecated. Related to elastic#47567
Moved the deprecation warning to ReindexValidator to ensure it runs early and works with resilient reindex. Also check that the warning is reported back for wait_for_completion=false. Follow-up to elastic#49458
Relates: #4341 Deprecate sorting in reindex elastic/elasticsearch#49458 (issue: elastic/elasticsearch#47567) Closes #4356
Relates: #4341 Deprecate sorting in reindex elastic/elasticsearch#49458 (issue: elastic/elasticsearch#47567) Closes #4356
Relates: #4341 Deprecate sorting in reindex elastic/elasticsearch#49458 (issue: elastic/elasticsearch#47567) Closes #4356 (cherry picked from commit 20a2133)

Reindex sort never gave a guarantee about the order of documents being
indexed into the destination, though it could give a sense of locality
of source data.
It prevents us from doing resilient reindex and other optimizations and
it has therefore been deprecated.
Related to #47567
The deprecation notice in ILM documentations use of sorted reindex may need further refinement once we move to removing sort.