Skip to content

Commit 437459d

Browse files
committed
Merge branch 'master' into ccr
* master: Trim down usages of `ShardOperationFailedException` interface (#28312) Do not return all indices if a specific alias is requested via get aliases api. [Test] Lower bwc version for rank-eval rest tests CountedBitSet doesn't need to extend BitSet. (#28239) Calculate sum in Kahan summation algorithm in aggregations (#27807) (#27848) Remove the `update_all_types` option. (#28288) Add information when master node left to DiscoveryNodes' shortSummary() (#28197) Provide explanation of dangling indices, fixes #26008 (#26999)
2 parents 2f17f91 + 0c83ee2 commit 437459d

File tree

179 files changed

+1097
-881
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+1097
-881
lines changed

client/rest-high-level/src/main/java/org/elasticsearch/client/Request.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ static Request createIndex(CreateIndexRequest createIndexRequest) throws IOExcep
173173
parameters.withTimeout(createIndexRequest.timeout());
174174
parameters.withMasterTimeout(createIndexRequest.masterNodeTimeout());
175175
parameters.withWaitForActiveShards(createIndexRequest.waitForActiveShards());
176-
parameters.withUpdateAllTypes(createIndexRequest.updateAllTypes());
177176

178177
HttpEntity entity = createEntity(createIndexRequest, REQUEST_BODY_CONTENT_TYPE);
179178
return new Request(HttpPut.METHOD_NAME, endpoint, parameters.getParams(), entity);
@@ -585,13 +584,6 @@ Params withTimeout(TimeValue timeout) {
585584
return putParam("timeout", timeout);
586585
}
587586

588-
Params withUpdateAllTypes(boolean updateAllTypes) {
589-
if (updateAllTypes) {
590-
return putParam("update_all_types", Boolean.TRUE.toString());
591-
}
592-
return this;
593-
}
594-
595587
Params withVersion(long version) {
596588
if (version != Versions.MATCH_ANY) {
597589
return putParam("version", Long.toString(version));

client/rest-high-level/src/test/java/org/elasticsearch/client/RequestTests.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,6 @@ public void testCreateIndex() throws IOException {
310310
setRandomMasterTimeout(createIndexRequest, expectedParams);
311311
setRandomWaitForActiveShards(createIndexRequest::waitForActiveShards, expectedParams);
312312

313-
if (randomBoolean()) {
314-
boolean updateAllTypes = randomBoolean();
315-
createIndexRequest.updateAllTypes(updateAllTypes);
316-
if (updateAllTypes) {
317-
expectedParams.put("update_all_types", Boolean.TRUE.toString());
318-
}
319-
}
320-
321313
Request request = Request.createIndex(createIndexRequest);
322314
assertEquals("/" + indexName, request.getEndpoint());
323315
assertEquals(expectedParams, request.getParameters());

docs/reference/migration/migrate_7_0/mappings.asciidoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ The `index_options` field for numeric fields has been deprecated in 6 and has n
1313

1414
To safeguard against out of memory errors, the number of nested json objects within a single
1515
document across all fields has been limited to 10000. This default limit can be changed with
16-
the index setting `index.mapping.nested_objects.limit`.
16+
the index setting `index.mapping.nested_objects.limit`.
17+
18+
==== The `update_all_types` option has been removed
19+
20+
This option is useless now that all indices have at most one type.

docs/reference/modules/gateway.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,12 @@ as long as the following conditions are met:
4848
Recover as long as this many data nodes have joined the cluster.
4949

5050
NOTE: These settings only take effect on a full cluster restart.
51+
52+
=== Dangling indices
53+
54+
When a node joins the cluster, any shards stored in its local data directory
55+
directory which do not already exist in the cluster will be imported into the
56+
cluster. This functionality is intended as a best effort to help users who
57+
lose all master nodes. If a new master node is started which is unaware of
58+
the other indices in the cluster, adding the old nodes will cause the old
59+
indices to be imported, instead of being deleted.

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/ScaledFloatFieldMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ public String typeName() {
207207
}
208208

209209
@Override
210-
public void checkCompatibility(MappedFieldType other, List<String> conflicts, boolean strict) {
211-
super.checkCompatibility(other, conflicts, strict);
210+
public void checkCompatibility(MappedFieldType other, List<String> conflicts) {
211+
super.checkCompatibility(other, conflicts);
212212
if (scalingFactor != ((ScaledFloatFieldType) other).getScalingFactor()) {
213213
conflicts.add("mapper [" + name() + "] has different [scaling_factor] values");
214214
}
@@ -424,8 +424,8 @@ protected void parseCreateField(ParseContext context, List<IndexableField> field
424424
}
425425

426426
@Override
427-
protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
428-
super.doMerge(mergeWith, updateAllTypes);
427+
protected void doMerge(Mapper mergeWith) {
428+
super.doMerge(mergeWith);
429429
ScaledFloatFieldMapper other = (ScaledFloatFieldMapper) mergeWith;
430430
if (other.ignoreMalformed.explicit()) {
431431
this.ignoreMalformed = other.ignoreMalformed;

modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/TokenCountFieldMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ protected String contentType() {
202202
}
203203

204204
@Override
205-
protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
206-
super.doMerge(mergeWith, updateAllTypes);
205+
protected void doMerge(Mapper mergeWith) {
206+
super.doMerge(mergeWith);
207207
this.analyzer = ((TokenCountFieldMapper) mergeWith).analyzer;
208208
this.enablePositionIncrements = ((TokenCountFieldMapper) mergeWith).enablePositionIncrements;
209209
}

modules/mapper-extras/src/test/java/org/elasticsearch/index/mapper/TokenCountFieldMapperTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void testMerge() throws IOException {
6363
.endObject().endObject().string();
6464
MapperService mapperService = createIndex("test").mapperService();
6565
DocumentMapper stage1 = mapperService.merge("person",
66-
new CompressedXContent(stage1Mapping), MapperService.MergeReason.MAPPING_UPDATE, false);
66+
new CompressedXContent(stage1Mapping), MapperService.MergeReason.MAPPING_UPDATE);
6767

6868
String stage2Mapping = XContentFactory.jsonBuilder().startObject()
6969
.startObject("person")
@@ -75,7 +75,7 @@ public void testMerge() throws IOException {
7575
.endObject()
7676
.endObject().endObject().string();
7777
DocumentMapper stage2 = mapperService.merge("person",
78-
new CompressedXContent(stage2Mapping), MapperService.MergeReason.MAPPING_UPDATE, false);
78+
new CompressedXContent(stage2Mapping), MapperService.MergeReason.MAPPING_UPDATE);
7979

8080
// previous mapper has not been modified
8181
assertThat(((TokenCountFieldMapper) stage1.mappers().smartNameFieldMapper("tc")).analyzer(), equalTo("keyword"));

modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentIdFieldMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,8 @@ protected void parseCreateField(ParseContext context, List<IndexableField> field
194194

195195

196196
@Override
197-
protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
198-
super.doMerge(mergeWith, updateAllTypes);
197+
protected void doMerge(Mapper mergeWith) {
198+
super.doMerge(mergeWith);
199199
ParentIdFieldMapper parentMergeWith = (ParentIdFieldMapper) mergeWith;
200200
this.children = parentMergeWith.children;
201201
}

modules/parent-join/src/main/java/org/elasticsearch/join/mapper/ParentJoinFieldMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ public ParentIdFieldMapper getParentIdFieldMapper(String name, boolean isParent)
316316
}
317317

318318
@Override
319-
protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
320-
super.doMerge(mergeWith, updateAllTypes);
319+
protected void doMerge(Mapper mergeWith) {
320+
super.doMerge(mergeWith);
321321
ParentJoinFieldMapper joinMergeWith = (ParentJoinFieldMapper) mergeWith;
322322
List<String> conflicts = new ArrayList<>();
323323
for (ParentIdFieldMapper mapper : parentIdFields) {
@@ -347,7 +347,7 @@ protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
347347
conflicts.add("cannot remove child [" + child + "] in join field [" + name() + "]");
348348
}
349349
}
350-
ParentIdFieldMapper merged = (ParentIdFieldMapper) self.merge(mergeWithMapper, updateAllTypes);
350+
ParentIdFieldMapper merged = (ParentIdFieldMapper) self.merge(mergeWithMapper);
351351
newParentIdFields.add(merged);
352352
}
353353
}
@@ -356,7 +356,7 @@ protected void doMerge(Mapper mergeWith, boolean updateAllTypes) {
356356
}
357357
this.eagerGlobalOrdinals = joinMergeWith.eagerGlobalOrdinals;
358358
this.parentIdFields = Collections.unmodifiableList(newParentIdFields);
359-
this.uniqueFieldMapper = (MetaJoinFieldMapper) uniqueFieldMapper.merge(joinMergeWith.uniqueFieldMapper, updateAllTypes);
359+
this.uniqueFieldMapper = (MetaJoinFieldMapper) uniqueFieldMapper.merge(joinMergeWith.uniqueFieldMapper);
360360
uniqueFieldMapper.setFieldMapper(this);
361361
}
362362

modules/parent-join/src/test/java/org/elasticsearch/join/mapper/ParentJoinFieldMapperTests.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void testSingleLevel() throws Exception {
5757
.endObject().string();
5858
IndexService service = createIndex("test");
5959
DocumentMapper docMapper = service.mapperService().merge("type", new CompressedXContent(mapping),
60-
MapperService.MergeReason.MAPPING_UPDATE, false);
60+
MapperService.MergeReason.MAPPING_UPDATE);
6161
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(service.mapperService()));
6262

6363
// Doc without join
@@ -106,7 +106,7 @@ public void testParentIdSpecifiedAsNumber() throws Exception {
106106
.endObject().string();
107107
IndexService service = createIndex("test");
108108
DocumentMapper docMapper = service.mapperService().merge("type", new CompressedXContent(mapping),
109-
MapperService.MergeReason.MAPPING_UPDATE, false);
109+
MapperService.MergeReason.MAPPING_UPDATE);
110110
ParsedDocument doc = docMapper.parse(SourceToParse.source("test", "type", "2",
111111
XContentFactory.jsonBuilder().startObject()
112112
.startObject("join_field")
@@ -141,7 +141,7 @@ public void testMultipleLevels() throws Exception {
141141
.endObject().string();
142142
IndexService service = createIndex("test");
143143
DocumentMapper docMapper = service.mapperService().merge("type", new CompressedXContent(mapping),
144-
MapperService.MergeReason.MAPPING_UPDATE, false);
144+
MapperService.MergeReason.MAPPING_UPDATE);
145145
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(service.mapperService()));
146146

147147
// Doc without join
@@ -221,7 +221,7 @@ public void testUpdateRelations() throws Exception {
221221
.endObject().endObject().string();
222222
IndexService indexService = createIndex("test");
223223
DocumentMapper docMapper = indexService.mapperService().merge("type", new CompressedXContent(mapping),
224-
MapperService.MergeReason.MAPPING_UPDATE, false);
224+
MapperService.MergeReason.MAPPING_UPDATE);
225225
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(indexService.mapperService()));
226226

227227
{
@@ -235,7 +235,7 @@ public void testUpdateRelations() throws Exception {
235235
.endObject().endObject().string();
236236
IllegalStateException exc = expectThrows(IllegalStateException.class,
237237
() -> indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
238-
MapperService.MergeReason.MAPPING_UPDATE, false));
238+
MapperService.MergeReason.MAPPING_UPDATE));
239239
assertThat(exc.getMessage(), containsString("cannot remove parent [parent] in join field [join_field]"));
240240
}
241241

@@ -251,7 +251,7 @@ public void testUpdateRelations() throws Exception {
251251
.endObject().endObject().string();
252252
IllegalStateException exc = expectThrows(IllegalStateException.class,
253253
() -> indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
254-
MapperService.MergeReason.MAPPING_UPDATE, false));
254+
MapperService.MergeReason.MAPPING_UPDATE));
255255
assertThat(exc.getMessage(), containsString("cannot remove child [grand_child2] in join field [join_field]"));
256256
}
257257

@@ -268,7 +268,7 @@ public void testUpdateRelations() throws Exception {
268268
.endObject().endObject().string();
269269
IllegalStateException exc = expectThrows(IllegalStateException.class,
270270
() -> indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
271-
MapperService.MergeReason.MAPPING_UPDATE, false));
271+
MapperService.MergeReason.MAPPING_UPDATE));
272272
assertThat(exc.getMessage(), containsString("cannot create child [parent] from an existing parent"));
273273
}
274274

@@ -285,7 +285,7 @@ public void testUpdateRelations() throws Exception {
285285
.endObject().endObject().string();
286286
IllegalStateException exc = expectThrows(IllegalStateException.class,
287287
() -> indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
288-
MapperService.MergeReason.MAPPING_UPDATE, false));
288+
MapperService.MergeReason.MAPPING_UPDATE));
289289
assertThat(exc.getMessage(), containsString("cannot create parent [grand_child2] from an existing child]"));
290290
}
291291

@@ -300,7 +300,7 @@ public void testUpdateRelations() throws Exception {
300300
.endObject()
301301
.endObject().endObject().string();
302302
docMapper = indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
303-
MapperService.MergeReason.MAPPING_UPDATE, true);
303+
MapperService.MergeReason.MAPPING_UPDATE);
304304
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(indexService.mapperService()));
305305
ParentJoinFieldMapper mapper = ParentJoinFieldMapper.getMapper(indexService.mapperService());
306306
assertTrue(mapper.hasChild("child2"));
@@ -321,7 +321,7 @@ public void testUpdateRelations() throws Exception {
321321
.endObject()
322322
.endObject().endObject().string();
323323
docMapper = indexService.mapperService().merge("type", new CompressedXContent(updateMapping),
324-
MapperService.MergeReason.MAPPING_UPDATE, true);
324+
MapperService.MergeReason.MAPPING_UPDATE);
325325
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(indexService.mapperService()));
326326
ParentJoinFieldMapper mapper = ParentJoinFieldMapper.getMapper(indexService.mapperService());
327327
assertTrue(mapper.hasParent("other"));
@@ -349,7 +349,7 @@ public void testInvalidJoinFieldInsideObject() throws Exception {
349349
IndexService indexService = createIndex("test");
350350
MapperParsingException exc = expectThrows(MapperParsingException.class,
351351
() -> indexService.mapperService().merge("type", new CompressedXContent(mapping),
352-
MapperService.MergeReason.MAPPING_UPDATE, false));
352+
MapperService.MergeReason.MAPPING_UPDATE));
353353
assertThat(exc.getRootCause().getMessage(),
354354
containsString("join field [object.join_field] cannot be added inside an object or in a multi-field"));
355355
}
@@ -371,7 +371,7 @@ public void testInvalidJoinFieldInsideMultiFields() throws Exception {
371371
IndexService indexService = createIndex("test");
372372
MapperParsingException exc = expectThrows(MapperParsingException.class,
373373
() -> indexService.mapperService().merge("type", new CompressedXContent(mapping),
374-
MapperService.MergeReason.MAPPING_UPDATE, false));
374+
MapperService.MergeReason.MAPPING_UPDATE));
375375
assertThat(exc.getRootCause().getMessage(),
376376
containsString("join field [number.join_field] cannot be added inside an object or in a multi-field"));
377377
}
@@ -397,7 +397,7 @@ public void testMultipleJoinFields() throws Exception {
397397
.endObject()
398398
.endObject().string();
399399
IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> indexService.mapperService().merge("type",
400-
new CompressedXContent(mapping), MapperService.MergeReason.MAPPING_UPDATE, false));
400+
new CompressedXContent(mapping), MapperService.MergeReason.MAPPING_UPDATE));
401401
assertThat(exc.getMessage(), containsString("Field [_parent_join] is defined twice in [type]"));
402402
}
403403

@@ -414,7 +414,7 @@ public void testMultipleJoinFields() throws Exception {
414414
.endObject()
415415
.endObject().string();
416416
indexService.mapperService().merge("type",
417-
new CompressedXContent(mapping), MapperService.MergeReason.MAPPING_UPDATE, false);
417+
new CompressedXContent(mapping), MapperService.MergeReason.MAPPING_UPDATE);
418418
String updateMapping = XContentFactory.jsonBuilder().startObject()
419419
.startObject("properties")
420420
.startObject("another_join_field")
@@ -423,7 +423,7 @@ public void testMultipleJoinFields() throws Exception {
423423
.endObject()
424424
.endObject().string();
425425
IllegalArgumentException exc = expectThrows(IllegalArgumentException.class, () -> indexService.mapperService().merge("type",
426-
new CompressedXContent(updateMapping), MapperService.MergeReason.MAPPING_UPDATE, false));
426+
new CompressedXContent(updateMapping), MapperService.MergeReason.MAPPING_UPDATE));
427427
assertThat(exc.getMessage(), containsString("Field [_parent_join] is defined twice in [type]"));
428428
}
429429
}
@@ -442,7 +442,7 @@ public void testEagerGlobalOrdinals() throws Exception {
442442
.endObject().string();
443443
IndexService service = createIndex("test");
444444
DocumentMapper docMapper = service.mapperService().merge("type", new CompressedXContent(mapping),
445-
MapperService.MergeReason.MAPPING_UPDATE, false);
445+
MapperService.MergeReason.MAPPING_UPDATE);
446446
assertTrue(docMapper.mappers().getMapper("join_field") == ParentJoinFieldMapper.getMapper(service.mapperService()));
447447
assertFalse(service.mapperService().fullName("join_field").eagerGlobalOrdinals());
448448
assertNotNull(service.mapperService().fullName("join_field#parent"));
@@ -463,7 +463,7 @@ public void testEagerGlobalOrdinals() throws Exception {
463463
.endObject()
464464
.endObject().string();
465465
service.mapperService().merge("type", new CompressedXContent(mapping),
466-
MapperService.MergeReason.MAPPING_UPDATE, false);
466+
MapperService.MergeReason.MAPPING_UPDATE);
467467
assertFalse(service.mapperService().fullName("join_field").eagerGlobalOrdinals());
468468
assertNotNull(service.mapperService().fullName("join_field#parent"));
469469
assertFalse(service.mapperService().fullName("join_field#parent").eagerGlobalOrdinals());

modules/parent-join/src/test/java/org/elasticsearch/join/query/HasChildQueryBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
132132
.endObject().endObject().endObject();
133133

134134
mapperService.merge(TYPE,
135-
new CompressedXContent(mapping.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
135+
new CompressedXContent(mapping.string()), MapperService.MergeReason.MAPPING_UPDATE);
136136
}
137137

138138
/**

modules/parent-join/src/test/java/org/elasticsearch/join/query/HasParentQueryBuilderTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
112112
.endObject().endObject().endObject();
113113

114114
mapperService.merge(TYPE,
115-
new CompressedXContent(mapping.string()), MapperService.MergeReason.MAPPING_UPDATE, false);
115+
new CompressedXContent(mapping.string()), MapperService.MergeReason.MAPPING_UPDATE);
116116
}
117117

118118
/**

modules/parent-join/src/test/java/org/elasticsearch/join/query/LegacyHasChildQueryBuilderTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
9797
BOOLEAN_FIELD_NAME, "type=boolean",
9898
DATE_FIELD_NAME, "type=date",
9999
OBJECT_FIELD_NAME, "type=object"
100-
).string()), MapperService.MergeReason.MAPPING_UPDATE, false);
100+
).string()), MapperService.MergeReason.MAPPING_UPDATE);
101101
mapperService.merge(CHILD_TYPE, new CompressedXContent(PutMappingRequest.buildFromSimplifiedDef(CHILD_TYPE,
102102
"_parent", "type=" + PARENT_TYPE,
103103
STRING_FIELD_NAME, "type=text",
@@ -107,7 +107,7 @@ protected void initializeAdditionalMappings(MapperService mapperService) throws
107107
BOOLEAN_FIELD_NAME, "type=boolean",
108108
DATE_FIELD_NAME, "type=date",
109109
OBJECT_FIELD_NAME, "type=object"
110-
).string()), MapperService.MergeReason.MAPPING_UPDATE, false);
110+
).string()), MapperService.MergeReason.MAPPING_UPDATE);
111111
}
112112

113113
@Override

0 commit comments

Comments
 (0)