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

Remove _timestamp and _ttl on 5.x indices. #18980

Merged
merged 1 commit into from
Jun 21, 2016

Conversation

jpountz
Copy link
Contributor

@jpountz jpountz commented Jun 20, 2016

This removes the ability to use _timestamp and _ttl on indices created on
or after 5.0.

Closes #18280

@clintongormley clintongormley added >breaking review :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jun 20, 2016
@nik9000 nik9000 self-assigned this Jun 20, 2016
@@ -100,6 +101,9 @@ public TTLFieldMapper build(BuilderContext context) {
public static class TypeParser implements MetadataFieldMapper.TypeParser {
@Override
public MetadataFieldMapper.Builder parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException {
if (parserContext.indexVersionCreated().onOrAfter(Version.V_5_0_0_alpha4)) {
throw new IllegalArgumentException("[_ttl] is removed in 5.0. As a replacement, you can delete by range query on a timestamp field.");
Copy link
Member

Choose a reason for hiding this comment

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

Maybe "you should use time based indexes or cron a delete-by-query with a range query on a timestamp field"? Or something that mentions time based indexes....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1

@nik9000
Copy link
Member

nik9000 commented Jun 20, 2016

I wonder if we should still keep some of those REST tests? I thought we could set the created version. While we still support the behavior we should try.

Should we yank the reindex module's support for timestamp and ttl? There is some basic scripting support in there. We could do it as another PR.

All of the test looks good to me though.

@jpountz
Copy link
Contributor Author

jpountz commented Jun 21, 2016

Apparently we cannot set the version in the REST tests. I am not sure what exactly to do for reindex, would it be easy today already to move the value of the _timestamp to a regular field? It looks so using a script given that we put the _timestamp into the context of the script?

@nik9000
Copy link
Member

nik9000 commented Jun 21, 2016

It looks so using a script given that we put the _timestamp into the context of the script?

Yeah, I think it'd be easy to do.

Maybe we don't do anything to reindex now and wait for 6.0 or something. That way reindex can still deal with timestamp, including moving it to a field.

@jpountz
Copy link
Contributor Author

jpountz commented Jun 21, 2016

This plan sounds good to me.

@nik9000
Copy link
Member

nik9000 commented Jun 21, 2016

LGTM.

I can add a use case example to the docs for reindex that shows moving _timestamp to a field.

@jpountz
Copy link
Contributor Author

jpountz commented Jun 21, 2016

I think it would be great to have it in the migration notes!

This removes the ability to use `_timestamp` and `_ttl` on indices created on
or after 5.0.

Closes elastic#18280
@jpountz jpountz force-pushed the remove/timestamp_ttl branch from a3fa093 to 969e953 Compare June 21, 2016 16:05
@jpountz jpountz merged commit 969e953 into elastic:master Jun 21, 2016
jpountz added a commit that referenced this pull request Jun 21, 2016
This reverts commit 969e953.
Docs are failing because of the removed functionality. I will
fix the docs before pushing it again.
jpountz added a commit that referenced this pull request Jun 22, 2016
This removes the ability to use `_timestamp` and `_ttl` on indices created on
or after 5.0.

Closes #18280
nik9000 added a commit to nik9000/elasticsearch that referenced this pull request Jun 22, 2016
We aren't able to actually create an index with _timestamp enabled
to test the migration, or, at least, we won't be able to after elastic#18980
is re-merged. But the docs are still ok.

Closes elastic#19007
Mpdreamz added a commit to elastic/elasticsearch-net that referenced this pull request Sep 27, 2016
…ic/elasticsearch#18980 so that migrated 2.x indices do not have their code altered (just yet)
Mpdreamz added a commit to elastic/elasticsearch-net that referenced this pull request Sep 27, 2016
deprecate _ttl/_timestamp and remove them from our tests as per elastic/elasticsearch#18980 so that migrated 2.x indices do not have their code altered (just yet)

explicit 5.x spec generation

fix failing nodes test because  is removed as per elastic/elasticsearch#19218

fixed failing integration tests due to lang no longer defaulting to groovy elastic/elasticsearch#19960

fields => stored fields, updated failing cathelp tests due to endpoint changing

suggest response is now generic and gets _source returned in accordance with elastic/elasticsearch#19536

histogram key double not long

source filtering include and exclude are now plural

script fields tests did not explicitly specify groovy

search's StoredFields still sent

get task api tests wreaked havoc on the readonly tests

scripted metric did not specify lang

set script.max_compilations_per_minute on node

fix top hits not setting groovy explicitly

multi search now response 404 properly

multitermvector tests making sure it took more then 0 is no longer reliable beta1 is too fast :)

foreach put pipeline processors is no longer an array as per elastic/elasticsearch#19402

revert field=>stored_fields rename on update request

remove propery name with dot failure assertion integration test, no longer valid since elastic/elasticsearch#19899

use existing elasticsearch node in test framework could still spawn a new java process

revert field=>stored_fields rename on update request

get pipeline api is now dictionary based as per elastic/elasticsearch#19685

xpack beta1 related fixes

reindex tests not setting all waithandles and taking 3 minutes for no good reason

missing fieldsecurity class

fix post integration test failures unit test failures

add back run as tests now that we send the right header in the beta1 world
Mpdreamz added a commit to elastic/elasticsearch-net that referenced this pull request Oct 10, 2016
* removed deleted file from csproj

deprecate _ttl/_timestamp and remove them from our tests as per elastic/elasticsearch#18980 so that migrated 2.x indices do not have their code altered (just yet)

explicit 5.x spec generation

fix failing nodes test because  is removed as per elastic/elasticsearch#19218

fixed failing integration tests due to lang no longer defaulting to groovy elastic/elasticsearch#19960

fields => stored fields, updated failing cathelp tests due to endpoint changing

suggest response is now generic and gets _source returned in accordance with elastic/elasticsearch#19536

histogram key double not long

source filtering include and exclude are now plural

script fields tests did not explicitly specify groovy

search's StoredFields still sent

get task api tests wreaked havoc on the readonly tests

scripted metric did not specify lang

set script.max_compilations_per_minute on node

fix top hits not setting groovy explicitly

multi search now response 404 properly

multitermvector tests making sure it took more then 0 is no longer reliable beta1 is too fast :)

foreach put pipeline processors is no longer an array as per elastic/elasticsearch#19402

revert field=>stored_fields rename on update request

remove propery name with dot failure assertion integration test, no longer valid since elastic/elasticsearch#19899

use existing elasticsearch node in test framework could still spawn a new java process

revert field=>stored_fields rename on update request

get pipeline api is now dictionary based as per elastic/elasticsearch#19685

xpack beta1 related fixes

reindex tests not setting all waithandles and taking 3 minutes for no good reason

missing fieldsecurity class

fix post integration test failures unit test failures

add back run as tests now that we send the right header in the beta1 world

* make sure code is generated of master after mass picking commits of 5.x branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search Foundations/Mapping Index mappings, including merging and defining field types v5.0.0-alpha4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants