Skip to content

Commit

Permalink
Relax cluster metadata version check (#37834)
Browse files Browse the repository at this point in the history
If the in_sync_allocations of index-1 or index-2 is changed, the
metadata version will be increased. This leads to the failure in
the metadata version checks. We need to relax them.

Closes #37820
  • Loading branch information
dnhatn authored Jan 25, 2019
1 parent 455f223 commit 5cd4dfb
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,19 @@ public void testMetadata() throws Exception {
assertThat(clusterStateResponse.getState().metaData().indices().size(), is(0));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/37820")
public void testMetadataVersion() {
createIndex("index-1");
createIndex("index-2");
long metadataVersion = client().admin().cluster().prepareState().get().getState().metaData().version();
assertThat(metadataVersion, greaterThan(0L));
long baselineVersion = client().admin().cluster().prepareState().get().getState().metaData().version();
assertThat(baselineVersion, greaterThan(0L));
assertThat(client().admin().cluster().prepareState().setIndices("index-1").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("index-2").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("*").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().setIndices("not-found").get().getState().metaData().version(),
equalTo(metadataVersion));
greaterThanOrEqualTo(baselineVersion));
assertThat(client().admin().cluster().prepareState().clear().setMetaData(false).get().getState().metaData().version(),
equalTo(0L));
}
Expand Down

0 comments on commit 5cd4dfb

Please sign in to comment.