Skip to content

Commit

Permalink
Mute version assertions
Browse files Browse the repository at this point in the history
Tracking elastic#38556
  • Loading branch information
alpar-t committed Feb 7, 2019
1 parent ea1822e commit 6b87785
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public Translog.Operation[] getOperations() {

@Override
public void readFrom(final StreamInput in) throws IOException {
assert Version.CURRENT.major <= 7;
// TODO: https://github.com/elastic/elasticsearch/issues/38556
//assert Version.CURRENT.major <= 7;
if (in.getVersion().equals(Version.V_6_0_0)) {
/*
* Resync replication request serialization was broken in 6.0.0 due to the elements of the stream not being prefixed with a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,8 @@ public ClusterState execute(ClusterState currentState) throws Exception {

static int getNumberOfShards(final Settings.Builder indexSettingsBuilder) {
// TODO: this logic can be removed when the current major version is 8
assert Version.CURRENT.major == 7;
// TODO: https://github.com/elastic/elasticsearch/issues/38556
// assert Version.CURRENT.major == 7;
final int numberOfShards;
final Version indexVersionCreated =
Version.fromId(Integer.parseInt(indexSettingsBuilder.get(IndexMetaData.SETTING_INDEX_VERSION_CREATED.getKey())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private Tuple<Manifest, MetaData> loadFullStateBWC() throws IOException {

if (globalMetaData != null) {
metaDataBuilder = MetaData.builder(globalMetaData);
// assert Version.CURRENT.major < 8 : "failed to find manifest file, which is mandatory staring with Elasticsearch version 8.0";
// TODO https://github.com/elastic/elasticsearch/issues/38556
// assert Version.CURRENT.major < 8 : "failed to find manifest file, which is mandatory staring with Elasticsearch version 8.0";
} else {
metaDataBuilder = MetaData.builder();
}
Expand All @@ -126,7 +127,8 @@ private Tuple<Manifest, MetaData> loadFullStateBWC() throws IOException {
Tuple<IndexMetaData, Long> indexMetaDataAndGeneration =
INDEX_META_DATA_FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry,
nodeEnv.resolveIndexFolder(indexFolderName));
// assert Version.CURRENT.major < 8 : "failed to find manifest file, which is mandatory staring with Elasticsearch version 8.0";
// TODO https://github.com/elastic/elasticsearch/issues/38556
// assert Version.CURRENT.major < 8 : "failed to find manifest file, which is mandatory staring with Elasticsearch version 8.0";
IndexMetaData indexMetaData = indexMetaDataAndGeneration.v1();
long generation = indexMetaDataAndGeneration.v2();
if (indexMetaData != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public abstract class RemoteClusterAware {

static {
// remove search.remote.* settings in 8.0.0
assert Version.CURRENT.major < 8;
// TODO https://github.com/elastic/elasticsearch/issues/38556
// assert Version.CURRENT.major < 8;
}

public static final Setting.AffixSetting<List<String>> SEARCH_REMOTE_CLUSTERS_SEEDS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public final class RemoteClusterService extends RemoteClusterAware implements Cl

static {
// remove search.remote.* settings in 8.0.0
assert Version.CURRENT.major < 8;
// TODO
// assert Version.CURRENT.major < 8;
}

public static final Setting<Integer> SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER =
Expand Down

0 comments on commit 6b87785

Please sign in to comment.