Protect shard splitting from illegal target shards#27468
Merged
s1monw merged 3 commits intoelastic:masterfrom Nov 21, 2017
Merged
Protect shard splitting from illegal target shards#27468s1monw merged 3 commits intoelastic:masterfrom
s1monw merged 3 commits intoelastic:masterfrom
Conversation
While we have an assertion that checks if the number of routing shards is a multiple of the number of shards we need a real hard exception that checks this way earlier. This change adds a check and test that is executed before we create the index. Relates to elastic#26931
jpountz
approved these changes
Nov 21, 2017
| // now we verify that the numRoutingShards is valid in the source index | ||
| int routingNumShards = sourceIndexMetadata.getRoutingNumShards(); | ||
| int factor = routingNumShards / numTargetShards; | ||
| if (factor * numTargetShards != routingNumShards) { |
Contributor
There was a problem hiding this comment.
the division then multiplication again looks like you actually want to check that routingNumShards % numTargetShards != 0?
bleskes
approved these changes
Nov 21, 2017
Contributor
bleskes
left a comment
There was a problem hiding this comment.
LGTM. I wonder what triggered this?
Contributor
Author
I ran BWC tests with this change #27451 and that went horribly wrong |
s1monw
added a commit
that referenced
this pull request
Nov 21, 2017
While we have an assertion that checks if the number of routing shards is a multiple of the number of shards we need a real hard exception that checks this way earlier. This change adds a check and test that is executed before we create the index. Relates to #26931
jasontedor
added a commit
to olcbean/elasticsearch
that referenced
this pull request
Nov 21, 2017
* master: (41 commits) [Test] Fix AggregationsTests#testFromXContentWithRandomFields [DOC] Fix mathematical representation on interval (range) (elastic#27450) Update version check for CCS optional remote clusters Bump BWC version to 6.1.0 for elastic#27469 Adapt rest test BWC version after backport Fix dynamic mapping update generation. (elastic#27467) Use the primary_term field to identify parent documents (elastic#27469) Move composite aggregation to core (elastic#27474) Fix test BWC version after backport Protect shard splitting from illegal target shards (elastic#27468) Cross Cluster Search: make remote clusters optional (elastic#27182) [Docs] Fix broken bulleted lists (elastic#27470) Move resync request serialization assertion Fix resync request serialization Fix issue where pages aren't released (elastic#27459) Add YAML REST tests for filters bucket agg (elastic#27128) Remove tcp profile from low level nio channel (elastic#27441) [TEST] Fix `GeoShapeQueryTests#testPointsOnly` failure Transition transport apis to use void listeners (elastic#27440) AwaitsFix GeoShapeQueryTests#testPointsOnly elastic#27454 ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While we have an assertion that checks if the number of routing shards is a multiple
of the number of shards we need a real hard exception that checks this way earlier.
This change adds a check and test that is executed before we create the index.
Relates to #26931