-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Deprecate sorting in reindex #49458
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
deprecated
text must be on a single line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/reference/docs/reindex.asciidoc
Outdated
@@ -478,6 +478,10 @@ which defaults to a maximum size of 100 MB. | |||
`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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a suggestion re: streamlining the deprecated
note. Also left a minor editorial comment.
Otherwise LGTM.
docs/reference/docs/reindex.asciidoc
Outdated
@@ -837,8 +818,8 @@ POST _reindex | |||
---------------------------------------------------------------- | |||
// TEST[setup:big_twitter] | |||
|
|||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.