Skip to content

Commit

Permalink
Always use one shard in vector REST tests. (#51643)
Browse files Browse the repository at this point in the history
This PR tries to address the intermittent vector test failures on 7.x by making
sure we create indices with one shard.

The fix is based on this theory as to what's happening:
* On 7.x, the default number of shards is 1, but in REST tests we randomly use
2 in order to cover the multiple shards case. In the failing test run, we use 2
shards and all documents end up on only one shard.
* During a search, the response from the empty shard doesn't produce
deprecation warnings because  we never try to execute the script. If not all
shard responses contain the warning headers, then certain deprecation warnings
can be lost (due to the bug described in #33936).

Addresses #50716.
Relates to #50061.
  • Loading branch information
jtibshirani committed Jan 29, 2020
1 parent 9d7b8d8 commit c9679c0
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setup:
index: test-index
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setup:
index: test-index
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ setup:
index: test-index
body:
settings:
number_of_replicas: 0
# we need to have 1 shard to get request failure in test "Dense vectors should error with sparse vector functions"
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
my_dense_vector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setup:
index: test-index
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ setup:
index: test-index
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ setup:
index: test-index
body:
settings:
number_of_replicas: 0
# we need to have 1 shard to get request failure in test "Sparse vectors should error with dense vector functions"
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
my_sparse_vector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ setup:
indices.create:
index: test-index1
body:
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
my_dense_vector1:
Expand Down

0 comments on commit c9679c0

Please sign in to comment.