Skip to content

Commit

Permalink
Mappings: Validate dynamic mappings updates on the master node.
Browse files Browse the repository at this point in the history
This commit changes dynamic mappings updates so that they are synchronous on the
entire cluster and their validity is checked by the master node. There are some
important consequences of this commit:
 - a failing index request on a non-existing type does not implicitely create
   the type anymore
 - dynamic mappings updates cannot create inconsistent mappings on different
   shards
 - indexing requests that introduce new fields might induce latency spikes
   because of the overhead to update the mappings on the master node

Close #8688
  • Loading branch information
jpountz committed Apr 21, 2015
1 parent ca03e40 commit 1adf232
Show file tree
Hide file tree
Showing 55 changed files with 1,114 additions and 1,052 deletions.
4 changes: 2 additions & 2 deletions rest-api-spec/test/indices.create/10_basic.yaml
Expand Up @@ -12,7 +12,7 @@
indices.get_mapping:
index: test_index

- match: { test_index.mappings.type_1.properties: {}}
- match: { test_index.mappings.type_1: {}}

---
"Create index with settings":
Expand Down Expand Up @@ -106,7 +106,7 @@
indices.get_mapping:
index: test_index

- match: { test_index.mappings.type_1.properties: {}}
- match: { test_index.mappings.type_1: {}}

- do:
indices.get_settings:
Expand Down
46 changes: 23 additions & 23 deletions rest-api-spec/test/indices.get_mapping/10_basic.yaml
Expand Up @@ -21,10 +21,10 @@ setup:
- do:
indices.get_mapping: {}

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_3.properties: {}}
- match: { test_1.mappings.type_1: {}}
- match: { test_1.mappings.type_2: {}}
- match: { test_2.mappings.type_2: {}}
- match: { test_2.mappings.type_3: {}}

---
"Get /{index}/_mapping":
Expand All @@ -33,8 +33,8 @@ setup:
indices.get_mapping:
index: test_1

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_1: {}}
- match: { test_1.mappings.type_2: {}}
- is_false: test_2


Expand All @@ -46,8 +46,8 @@ setup:
index: test_1
type: _all

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_1: {}}
- match: { test_1.mappings.type_2: {}}
- is_false: test_2

---
Expand All @@ -58,8 +58,8 @@ setup:
index: test_1
type: '*'

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_1: {}}
- match: { test_1.mappings.type_2: {}}
- is_false: test_2

---
Expand All @@ -70,7 +70,7 @@ setup:
index: test_1
type: type_1

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_1: {}}
- is_false: test_1.mappings.type_2
- is_false: test_2

Expand All @@ -82,8 +82,8 @@ setup:
index: test_1
type: type_1,type_2

- match: { test_1.mappings.type_1.properties: {}}
- match: { test_1.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_1: {}}
- match: { test_1.mappings.type_2: {}}
- is_false: test_2

---
Expand All @@ -94,7 +94,7 @@ setup:
index: test_1
type: '*2'

- match: { test_1.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_2: {}}
- is_false: test_1.mappings.type_1
- is_false: test_2

Expand All @@ -105,8 +105,8 @@ setup:
indices.get_mapping:
type: type_2

- match: { test_1.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_2: {}}
- match: { test_2.mappings.type_2: {}}
- is_false: test_1.mappings.type_1
- is_false: test_2.mappings.type_3

Expand All @@ -118,8 +118,8 @@ setup:
index: _all
type: type_2

- match: { test_1.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_2: {}}
- match: { test_2.mappings.type_2: {}}
- is_false: test_1.mappings.type_1
- is_false: test_2.mappings.type_3

Expand All @@ -131,8 +131,8 @@ setup:
index: '*'
type: type_2

- match: { test_1.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_2: {}}
- match: { test_2.mappings.type_2: {}}
- is_false: test_1.mappings.type_1
- is_false: test_2.mappings.type_3

Expand All @@ -144,8 +144,8 @@ setup:
index: test_1,test_2
type: type_2

- match: { test_1.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2.properties: {}}
- match: { test_1.mappings.type_2: {}}
- match: { test_2.mappings.type_2: {}}
- is_false: test_2.mappings.type_3

---
Expand All @@ -156,6 +156,6 @@ setup:
index: '*2'
type: type_2

- match: { test_2.mappings.type_2.properties: {}}
- match: { test_2.mappings.type_2: {}}
- is_false: test_1
- is_false: test_2.mappings.type_3
22 changes: 11 additions & 11 deletions rest-api-spec/test/indices.get_mapping/50_wildcard_expansion.yaml
Expand Up @@ -56,8 +56,8 @@ setup:
indices.get_mapping:
index: test-x*

- match: { test-xxx.mappings.type_1.properties: {}}
- match: { test-xxy.mappings.type_2.properties: {}}
- match: { test-xxx.mappings.type_1: {}}
- match: { test-xxy.mappings.type_2: {}}

---
"Get test-* with wildcard_expansion=all":
Expand All @@ -67,9 +67,9 @@ setup:
index: test-x*
expand_wildcards: all

- match: { test-xxx.mappings.type_1.properties: {}}
- match: { test-xxy.mappings.type_2.properties: {}}
- match: { test-xyy.mappings.type_3.properties: {}}
- match: { test-xxx.mappings.type_1: {}}
- match: { test-xxy.mappings.type_2: {}}
- match: { test-xyy.mappings.type_3: {}}

---
"Get test-* with wildcard_expansion=open":
Expand All @@ -79,8 +79,8 @@ setup:
index: test-x*
expand_wildcards: open

- match: { test-xxx.mappings.type_1.properties: {}}
- match: { test-xxy.mappings.type_2.properties: {}}
- match: { test-xxx.mappings.type_1: {}}
- match: { test-xxy.mappings.type_2: {}}

---
"Get test-* with wildcard_expansion=closed":
Expand All @@ -90,7 +90,7 @@ setup:
index: test-x*
expand_wildcards: closed

- match: { test-xyy.mappings.type_3.properties: {}}
- match: { test-xyy.mappings.type_3: {}}

---
"Get test-* with wildcard_expansion=none":
Expand All @@ -110,8 +110,8 @@ setup:
index: test-x*
expand_wildcards: open,closed

- match: { test-xxx.mappings.type_1.properties: {}}
- match: { test-xxy.mappings.type_2.properties: {}}
- match: { test-xyy.mappings.type_3.properties: {}}
- match: { test-xxx.mappings.type_1: {}}
- match: { test-xxy.mappings.type_2: {}}
- match: { test-xyy.mappings.type_3: {}}


40 changes: 0 additions & 40 deletions src/main/java/org/elasticsearch/action/WriteFailureException.java

This file was deleted.

0 comments on commit 1adf232

Please sign in to comment.