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

Allow ILM's Shrink Action to progress successfully on indices with 1 shard #33275

Closed
bmcconaghy opened this issue Aug 30, 2018 · 4 comments
Closed
Assignees
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management

Comments

@bmcconaghy
Copy link

When a user specifies the shrink action and the index it is supposed to shrink already has only 1 shard, this error crops up:

    "failed_step": "shrink",
    "phase": "warm",
    "action_time": "1535643967009",
    "rollover_alias": "thing-alias",
    "phase_time": "1535643367314",
    "step_info": "{\"type\":\"illegal_argument_exception\",\"reason\":\"can't shrink an index with only one shard\"}",

ILM should just noop this (or shrink should).

@colings86 colings86 added the :Data Management/ILM+SLM Index and Snapshot lifecycle management label Aug 30, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@talevy talevy changed the title issue with shrink action in index lifecycle management Allow ILM's Shrink Action to progress successfully on indices with 1 shard Oct 26, 2018
@talevy
Copy link
Contributor

talevy commented Dec 7, 2018

I do not like the idea of a noop because then the semantics of shrink would not be the same. The shrink should only succeed if it successfully made a new shrunken index. That would mean allowing shrink to operate on an index with one shard, and simply copy without reducing the number of shards (since it cannot).

I've added team-discuss to discuss whether we want to do anything about this. I see there
being three options

  1. leave as is. expect an error to occur and be OK with it.
  2. make ILM do some roundabout work so that it is as if a shrink occurred (resulting in a shrink-<original_index> index)
  3. make the Shrink API allow n-to-n shrinks, where n is the number of shards.

@jakelandis jakelandis added :Data Management/ILM+SLM Index and Snapshot lifecycle management and removed :Data Management/ILM+SLM Index and Snapshot lifecycle management labels Dec 17, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

@talevy
Copy link
Contributor

talevy commented Jan 10, 2019

from discussion with the team on Zoom:

We decided it would make sense for ILM shrink
steps to conditionally check whether they should
execute on indices with one shard. If index has
only one shard, the steps will be no-ops and the
policy will continue to run the following actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/ILM+SLM Index and Snapshot lifecycle management
Projects
None yet
Development

No branches or pull requests

5 participants