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 delete mapping API #10231

Merged
merged 1 commit into from Mar 24, 2015
Merged

Remove delete mapping API #10231

merged 1 commit into from Mar 24, 2015

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Mar 24, 2015

Deleting a type from an index is inherently dangerous because
the type can be recreated with new mappings which may conflict
with existing segments still using the old mappings. This
removes the ability to delete a type (similar to how deleting
fields within a type is not allowed, for the same reason).

closes #8877

@rjernst rjernst added >breaking v2.0.0-beta1 review :Search/Mapping Index mappings, including merging and defining field types labels Mar 24, 2015
@martijnvg
Copy link
Member

Can you add an entry to the migrate_2_0.asciidoc about the fact that this api has been deleted? Other than that LGTM.

@rjernst
Copy link
Member Author

rjernst commented Mar 24, 2015

@martijnvg Sure, added a short message to the docs.

@martijnvg
Copy link
Member

LGTM

1 similar comment
@jpountz
Copy link
Contributor

jpountz commented Mar 24, 2015

LGTM

// all is well, the _river index was deleted
} catch (Exception e) {
logger.warn("unexpected failure when trying to verify river [{}] deleted", e, riverName.name());
}
Copy link
Member

Choose a reason for hiding this comment

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

I wonder what effect this change has on rivers... not sure...maybe next step would be to remove rivers code from master too? :)

Copy link
Member

Choose a reason for hiding this comment

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

@kimchy WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @javanna here. River plugins can't be used anymore as you can not remove a _river instance.

To remove a _river, we were doing:

DELETE _river/rivername

What can we do now?

FYI: this PR is the reason why we have all river plugins failing in Jenkins now.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dadoonet I have a PR up adding back deletion, but without deleting the type. See #10251

Copy link
Member

Choose a reason for hiding this comment

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

I was wrong. To remove a _river we should run:

   DELETE _river/rivername/_meta

@javanna
Copy link
Member

javanna commented Mar 24, 2015

ping @spalger when this gets pushed you'll have to regenerate the api for the js client otherwise the references to the non existing docs page might break docs publish process. Thanks!

@s1monw
Copy link
Contributor

s1monw commented Mar 24, 2015

LGTM too

Deleting a type from an index is inherently dangerous because
the type can be recreated with new mappings which may conflict
with existing segments still using the old mappings. This
removes the ability to delete a type (similar to how deleting
fields within a type is not allowed, for the same reason).

closes elastic#8877
closes elastic#10231
@rjernst rjernst merged commit 693d91e into elastic:master Mar 24, 2015
@rjernst rjernst removed the review label Mar 24, 2015
rjernst added a commit that referenced this pull request Mar 24, 2015
@rjernst rjernst deleted the fix/8877 branch April 4, 2015 04:55
@aparo
Copy link

aparo commented May 11, 2015

How to manage if an existing mapping is wrong?
Usually people deletes it and recreate it.
He can force deleting the documents with a scan first. Optimize the index removing deleted docs and then remove the mapping.
Otherwise people must recreate/reindex indices every time they are a broken mapping!
How we manage generic optimization of deleting empty mappings in indices?

@clintongormley
Copy link

@aparo There are a number of reasons why reindexing is a better approach:

  • Even after an optimize, old fields can still exist in the fields info which can lead to corrupt data.
  • Fields are going to be stored at index level (with some per-type settings, eg copy_to), so you'd have to be sure that fields aren't being used across multiple types.
  • Doing an optimize could involve rewriting all of your segments anyway, and stopping indexing while you do it.
  • We plan on supporting reindexing directly in Elasticsearch, which will make it easier to just rewrite the index then switch aliases when it is ready.

@clintongormley clintongormley changed the title Mappings: Remove delete mapping API Remove delete mapping API Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search/Mapping Index mappings, including merging and defining field types v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the ability to delete mappings
8 participants