Skip to content

Commit

Permalink
Add a dummy_index to upgrade tests to ensure we recover fine with rep…
Browse files Browse the repository at this point in the history
…licas (#24937)

We default to 0 replicas in the rolling restart scenario already to ensure
we test against worst case. Yet, this adds a dummy index to ensure we also
recover and index with replicas just fine.
  • Loading branch information
s1monw authored May 29, 2017
1 parent bc4df47 commit 4d423bf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

- match: { hits.total: 5 } # no new indexed data, so expect the original 5 documents from the old cluster

- do:
search:
index: index_with_replicas

- match: { hits.total: 5 } # just check we recovered fine

- do:
bulk:
refresh: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,56 @@
index:
number_of_replicas: 0

- do:
indices.create:
index: index_with_replicas # dummy index to ensure we can recover indices with replicas just fine

- do:
bulk:
refresh: true
body:
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
- '{"index": {"_index": "test_index", "_type": "doc"}}'
- '{"f1": "v1_old", "f2": 0}'
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
- '{"index": {"_index": "test_index", "_type": "doc"}}'
- '{"f1": "v2_old", "f2": 1}'
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
- '{"index": {"_index": "test_index", "_type": "doc"}}'
- '{"f1": "v3_old", "f2": 2}'
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
- '{"index": {"_index": "test_index", "_type": "doc"}}'
- '{"f1": "v4_old", "f2": 3}'
- '{"index": {"_index": "test_index", "_type": "test_type"}}'
- '{"index": {"_index": "test_index", "_type": "doc"}}'
- '{"f1": "v5_old", "f2": 4}'

- do:
bulk:
refresh: true
body:
- '{"index": {"_index": "index_with_replicas", "_type": "doc"}}'
- '{"f1": "d_old"}'
- '{"index": {"_index": "index_with_replicas", "_type": "doc"}}'
- '{"f1": "d_old"}'
- '{"index": {"_index": "index_with_replicas", "_type": "doc"}}'
- '{"f1": "d_old"}'
- '{"index": {"_index": "index_with_replicas", "_type": "doc"}}'
- '{"f1": "d_old"}'
- '{"index": {"_index": "index_with_replicas", "_type": "doc"}}'
- '{"f1": "d_old"}'

- do:
indices.flush:
index: test_index
index: test_index,index_with_replicas

- do:
search:
index: test_index

- match: { hits.total: 5 }

- do:
search:
index: index_with_replicas

- match: { hits.total: 5 }

- do:
snapshot.create_repository:
repository: my_repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

- match: { hits.total: 10 } # no new indexed data, so expect the original 10 documents from the old and mixed clusters

- do:
search:
index: index_with_replicas

- match: { hits.total: 5 } # just check we recovered fine

- do:
bulk:
refresh: true
Expand Down

0 comments on commit 4d423bf

Please sign in to comment.