Skip to content
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

Replace delimited_payload_filter by delimited_payload #26625

Merged
merged 8 commits into from
Nov 24, 2017

Conversation

liketic
Copy link
Contributor

@liketic liketic commented Sep 13, 2017

Closes #21978 . Any comments are appreciated. 😄

@elasticmachine
Copy link
Collaborator

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@cbuescher
Copy link
Member

I believe the issue this is trying to fix is #21978.
@liketic The PR seems a bit out of date, would you mind rebasing or merging master to this branch so it can be tested?

@liketic liketic force-pushed the rebane-delimited_payload_filter branch from 6ddd158 to 7704d34 Compare October 26, 2017 03:08
@liketic
Copy link
Contributor Author

liketic commented Oct 26, 2017

@cbuescher Thanks for your attention! Yes, my mistake. I rebased the pr, please review and test. Thanks a lot! 👍

@cbuescher
Copy link
Member

@elasticmachine test this please

@@ -191,10 +193,15 @@
input -> new CommonGramsFilter(input, CharArraySet.EMPTY_SET)));
filters.add(PreConfiguredTokenFilter.singleton("czech_stem", false, CzechStemFilter::new));
filters.add(PreConfiguredTokenFilter.singleton("decimal_digit", true, DecimalDigitFilter::new));
// TODO deprecate delimited_payload_filter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the deprecation also needs to happen in this PR. Using the old name, either in the settings when creating an index or when using it in an already existing index should trigger a deprecation warning and an entry in the logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed 7e7c54d

@liketic
Copy link
Contributor Author

liketic commented Oct 31, 2017

@cbuescher Thanks for your help! Could you guide me where to add that log? Thanks in advance!

@cbuescher cbuescher self-assigned this Nov 1, 2017
@cbuescher
Copy link
Member

cbuescher commented Nov 1, 2017

@liketic I have to admit I'm not entirely sure where the best place would be to add that kind deprecation logging. I would need to do some digging as well, but one idea to look at might be the AnalysisRegistry itself, where I think all calls to obtain an instance of a named token filter need to go though "getTokenFilterProvider()". Not sure if this is the most elegant place to put the deprecation though.

@liketic
Copy link
Contributor Author

liketic commented Nov 2, 2017

@cbuescher Thanks! I'm trying to add deprecation log in AnalysisRegistry, please review again.

@jpountz
Copy link
Contributor

jpountz commented Nov 3, 2017

I think a better way to do this would be to register delimited_payload_filter with a wrapper of the analysis factory of delimited_payload that emits a deprecation log when the version is >= 7.0. This way old indices that use delimited_payload_filter would not pollute the deprecation log since they would still be using the deprecated filter (which they cannot change).

@cbuescher cbuescher added :Search Foundations/Mapping Index mappings, including merging and defining field types review :Search Relevance/Analysis How text is split into tokens and removed :Search Foundations/Mapping Index mappings, including merging and defining field types labels Nov 16, 2017
@liketic
Copy link
Contributor Author

liketic commented Nov 21, 2017

@jpountz I tried to add a wrapper class. I'm not sure it's correct. Could you please review it?

Copy link
Contributor

@jpountz jpountz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment about naming but things look good to me otherwise.

import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings;

public class DelimitedPayloadTokenFilterFactoryWrapper extends DelimitedPayloadTokenFilterFactory {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename it to something like LegacyDelimitedPayloadTokenFilterFactory but other than that, this is indeed the approach I was thinking of.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@liketic liketic force-pushed the rebane-delimited_payload_filter branch from ced2441 to 45f6aed Compare November 22, 2017 08:16
@liketic
Copy link
Contributor Author

liketic commented Nov 22, 2017

Hi @cbuescher Could you please review again? Thanks in advance.


==== The `delimited_payload_filter` is deprecated

The `delimited_payload_filter` is deprecated and should be replaced by `delimited_payload`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should make it clearer that the filter is just renamed, and its only the old name that is deprecated, something like "The delimited_payload_filter is renamed to delimited_payload, the old name is deprecated and will be removed at some point, so it should be replaces by delimited_payload" or slightly different.

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liketic thanks, this looks also good to me. I left a tiny comment regarding the migration note but other than that I agree this is ready. I will kick off the remaining CI tests once this small change has been adressed and will continue to merge after CI is green.

@liketic liketic force-pushed the rebane-delimited_payload_filter branch from f8e3e3f to d3e6cfb Compare November 22, 2017 12:38
@liketic
Copy link
Contributor Author

liketic commented Nov 22, 2017

@cbuescher Thanks for your help. I pushed d3e6cfb . 👍

@cbuescher
Copy link
Member

@liketic thanks a lot for the last change
@elasticmachine test this please

@cbuescher
Copy link
Member

@liketic seems like there are still some checkstyle conventions that CI is complaining about now, sorry about that:

LegacyDelimitedPayloadTokenFilterFactory.java:30: Line is longer than 140 characters

btw. you can run gradle precommit (this skips all the long-running tests) either in the root folder or the affected module to check for these kind of errors locally, but I also keep forgetting that. Can you change that line and then run these checks locally once to make sure there are no other style errors?

@liketic
Copy link
Contributor Author

liketic commented Nov 23, 2017

@cbuescher My fault. Please test again. Thanks!

@cbuescher
Copy link
Member

@elasticmachine test this please

@cbuescher
Copy link
Member

@liketic thanks, the checkstyle etc... passes now, the current errors seem unrelated to this PR but I'd still like to try to get a clean run. Would you be able to merge in master once more so we get a current state there?

@cbuescher
Copy link
Member

@elasticmachine test this please

@cbuescher cbuescher merged commit 4885acb into elastic:master Nov 24, 2017
@cbuescher
Copy link
Member

@liketic sorry this took a while longer, but thanks for this PR. I just merged it to master.
@jpountz maybe we can backport this to one of the coming 6.x versions? If we deprecate in, say 6.2., like in this PR, would you be okay to remove in 7.0 or should we leave this as is, wdyt?

martijnvg added a commit that referenced this pull request Nov 24, 2017
* es/master: (38 commits)
  Backport wait_for_initialiazing_shards to cluster health API
  Carry over version map size to prevent excessive resizing (#27516)
  Fix scroll query with a sort that is a prefix of the index sort (#27498)
  Delete shard store files before restoring a snapshot (#27476)
  Replace `delimited_payload_filter` by `delimited_payload` (#26625)
  CURRENT should not be a -SNAPSHOT version if build.snapshot is false (#27512)
  Fix merging of _meta field (#27352)
  Remove unused method (#27508)
  unmuted test, this has been fixed by #27397
  Consolidate version numbering semantics (#27397)
  Add wait_for_no_initializing_shards to cluster health API (#27489)
  [TEST] use routing partition size based on the max routing shards of the second split
  Adjust CombinedDeletionPolicy for multiple commits (#27456)
  Update composite-aggregation.asciidoc
  Deprecate `levenstein` in favor of `levenshtein` (#27409)
  Automatically prepare indices for splitting (#27451)
  Validate `op_type` for `_create` (#27483)
  Minor ShapeBuilder cleanup
  muted test
  Decouple nio constructs from the tcp transport (#27484)
  ...
@liketic liketic deleted the rebane-delimited_payload_filter branch November 24, 2017 14:59
@lcawl
Copy link
Contributor

lcawl commented Nov 24, 2017

I added the following in elastic/elasticsearch/migration/migrate_7_0.asciidoc to address documentation build errors (commit af971b3 ):

include::migrate_7_0/analysis.asciidoc[]

@cbuescher
Copy link
Member

@lcawl thanks for fixing this and sorry I didn't catch this in the review.

@lcawl
Copy link
Contributor

lcawl commented Nov 24, 2017

No problem, it was a quick fix!

@clintongormley
Copy link

@jpountz maybe we can backport this to one of the coming 6.x versions? If we deprecate in, say 6.2., like in this PR, would you be okay to remove in 7.0 or should we leave this as is, wdyt?

I think we should deprecate in 6.x and remove in 7.0, but still allow the old form in 7.0 for indices created in 6.x.

Also, we should add a check for this to the x-pack migration assistant.

cbuescher pushed a commit to cbuescher/elasticsearch that referenced this pull request Nov 27, 2017
)

The `delimited_payload_filter` is renamed to `delimited_payload`, the old name is
deprecated and should be replaced by `delimited_payload`.

Closes elastic#21978
cbuescher pushed a commit that referenced this pull request Dec 4, 2017
The `delimited_payload_filter` is renamed to `delimited_payload`, the old name is
deprecated and should be replaced by `delimited_payload`.

Closes #21978
@cbuescher
Copy link
Member

@clintongormley I opened #27704 for the final removal in 7.0 and adding checks to the migration assistant.

cbuescher pushed a commit that referenced this pull request Apr 5, 2018
From 7.0 on, using `delimited_payload_filter` should throw an error. 
It was deprecated in 6.2 in favour of `delimited_payload` (#26625).

Relates to #27704
romseygeek added a commit that referenced this pull request Jun 27, 2019
…r is used (#43684)

#26625 deprecated delimited_payload_filter and added tests to check
that warnings would be emitted when both a normal and pre-configured
filter were used. Unfortunately, due to a bug in the Analyze API, the pre-
configured filter check was never actually triggered, and it turns out that
the deprecation warning was not in fact being emitted in this case.

#43568 fixed the Analyze API bug, which then surfaced this on backport.

This commit ensures that the preconfigured filter also emits the warnings
and triggers an error if a new index tries to use a preconfigured
delimited_payload_filter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants