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

Skip Shrink when numberOfShards not changed #37953

Merged
merged 5 commits into from
Jan 30, 2019
Merged

Conversation

talevy
Copy link
Contributor

@talevy talevy commented Jan 29, 2019

Previously, ShrinkAction would fail if
it was executed on an index that had
the same number of shards as the target
shrunken number.

This PR introduced a new BranchingStep that
is used inside of ShrinkAction to branch which
step to move to next, depending on the
shard values. So no shrink will occur if the
shard count is unchanged.

Fixes #33275.

@talevy talevy added >enhancement :Data Management/ILM+SLM Index and Snapshot lifecycle management labels Jan 29, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features

Previously, ShrinkAction would fail if
it was executed on an index that had
the same number of shards as the target
shrunken number.

This PR introduced a new BranchingStep that
is used inside of ShrinkAction to branch which
step to move to next, depending on the
shard values. So no shrink will occur if the
shard count is unchanged.
Copy link
Member

@dakrone dakrone 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 some comments, I still feel a little uneasy about the brittleness of this, but we can improve it in the future too.

logger.trace("[{}] performing cluster state action ({}) [{}], next: [{}]",
index.getName(), currentStep.getClass().getSimpleName(), currentStep.getKey(), currentStep.getNextStepKey());
logger.trace("[{}] performing cluster state action ({}) [{}]",
index.getName(), currentStep.getClass().getSimpleName(), currentStep.getKey());
try {
state = ((ClusterStateActionStep) currentStep).performAction(index, state);
Copy link
Member

Choose a reason for hiding this comment

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

In the future perhaps we will want to return Tuple<ClusterState, Step.SteyKey> from this. The disconnect in terms of the ordering of how things have to be called feels a little weird to me, I'd prefer it to be completely functional.

What do you think?

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 think that would be a reasonable direction to go, yes.

@talevy
Copy link
Contributor Author

talevy commented Jan 30, 2019

I left some comments, I still feel a little uneasy about the brittleness of this, but we can improve it in the future too.

thanks for the review Lee!

I, too, feel uneasy about the brittleness of this. Should we have a path forward in place for
fixing this tech-debt in following releases before accepting to merge this?

@talevy talevy requested a review from dakrone January 30, 2019 00:58
@jakelandis
Copy link
Contributor

Should we have a path forward in place for fixing this tech-debt in following releases before accepting to merge this?

@talevy - Can you log a refactoring issue with some thoughts on why this is brittle and a potential way to address ? I am putting together a list of the next round changes for ILM and this will likely be on that list.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

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

LGTM assuming CI is happy; I agree with @jakelandis for next steps on the brittleness. Open an issue and link this one, we can prioritize the tech debt for the next release.

@talevy
Copy link
Contributor Author

talevy commented Jan 30, 2019

opened #38047 as a reference for future discussion

@talevy
Copy link
Contributor Author

talevy commented Jan 30, 2019

run elasticsearch-ci/1

@talevy talevy merged commit 7c738fd into elastic:master Jan 30, 2019
@talevy talevy deleted the skip-step-ilm branch January 30, 2019 23:09
talevy added a commit that referenced this pull request Jan 31, 2019
Previously, ShrinkAction would fail if
it was executed on an index that had
the same number of shards as the target
shrunken number.

This PR introduced a new BranchingStep that
is used inside of ShrinkAction to branch which
step to move to next, depending on the
shard values. So no shrink will occur if the
shard count is unchanged.
jasontedor added a commit to dnhatn/elasticsearch that referenced this pull request Jan 31, 2019
* elastic/master:
  ILM setPriority corrections for a 0 value (elastic#38001)
  Temporarily disable BWC for retention lease stats (elastic#38049)
  Skip Shrink when numberOfShards not changed (elastic#37953)
  Add dispatching to `HandledTransportAction` (elastic#38050)
  Update httpclient for JDK 11 TLS engine (elastic#37994)
  Reduce flaxiness of ccr recovery timeouts test (elastic#38035)
  Fix ILM status to allow unknown fields (elastic#38043)
  Fix ILM Lifecycle Policy to allow unknown fields (elastic#38041)
  Update verify repository to allow unknown fields (elastic#37619)
  [ML] Datafeed deprecation checks (elastic#38026)
  Deprecate minimum_master_nodes (elastic#37868)
  Remove types from watcher docs (elastic#38002)
  Add test coverage for Painless general casting of boolean and Boolean (elastic#37780)
  Fixed test bug, lastFollowTime is null if there are no follower indices.
  Add ECS schema for user-agent ingest processor (elastic#37727) (elastic#37984)
  Extract TransportRequestDeduplication from ShardStateAction (elastic#37870)
jasontedor added a commit to jasontedor/elasticsearch that referenced this pull request Jan 31, 2019
…r-primary-term

* elastic/master:
  Mute failing date index name processor test
  Reenable BWC testing after retention lease stats (elastic#38062)
  Move watcher to use seq# and primary term for concurrency control (elastic#37977)
  ILM setPriority corrections for a 0 value (elastic#38001)
  Temporarily disable BWC for retention lease stats (elastic#38049)
  Skip Shrink when numberOfShards not changed (elastic#37953)
  Add dispatching to `HandledTransportAction` (elastic#38050)
  Update httpclient for JDK 11 TLS engine (elastic#37994)
  Reduce flaxiness of ccr recovery timeouts test (elastic#38035)
  Fix ILM status to allow unknown fields (elastic#38043)
  Fix ILM Lifecycle Policy to allow unknown fields (elastic#38041)
  Update verify repository to allow unknown fields (elastic#37619)
  [ML] Datafeed deprecation checks (elastic#38026)
  Deprecate minimum_master_nodes (elastic#37868)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants