mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
Core: try again to upgrade to Lucene 4.10.1-snapshot
This commit is contained in:
parent
ab3be76644
commit
5e9e2cf50c
@ -67,6 +67,8 @@ PLUGINS = [('bigdesk', 'lukas-vlcek/bigdesk'),
|
||||
('head', 'mobz/elasticsearch-head')]
|
||||
|
||||
LOG = env.get('ES_RELEASE_LOG', '/tmp/elasticsearch_release.log')
|
||||
if os.path.exists(LOG):
|
||||
raise RuntimeError('please remove old release log %s first' % LOG)
|
||||
|
||||
def log(msg):
|
||||
log_plain('\n%s' % msg)
|
||||
@ -306,6 +308,24 @@ def wait_for_node_startup(host='127.0.0.1', port=9200,timeout=15):
|
||||
|
||||
return False
|
||||
|
||||
# Ensures we are using a true Lucene release, not a snapshot build:
|
||||
def verify_lucene_version():
|
||||
s = open('pom.xml', encoding='utf-8').read()
|
||||
if s.find('download.elasticsearch.org/lucenesnapshots') != -1:
|
||||
raise RuntimeError('pom.xml contains download.elasticsearch.org/lucenesnapshots repository: remove that before releasing')
|
||||
|
||||
m = re.search(r'<lucene.version>(.*?)</lucene.version>', s)
|
||||
if m is None:
|
||||
raise RuntimeError('unable to locate lucene.version in pom.xml')
|
||||
lucene_version = m.group(1)
|
||||
|
||||
m = re.search(r'<lucene.maven.version>(.*?)</lucene.maven.version>', s)
|
||||
if m is None:
|
||||
raise RuntimeError('unable to locate lucene.maven.version in pom.xml')
|
||||
lucene_maven_version = m.group(1)
|
||||
if lucene_version != lucene_maven_version:
|
||||
raise RuntimeError('pom.xml is still using a snapshot release of lucene (%s): cutover to a real lucene release before releasing' % lucene_maven_version)
|
||||
|
||||
# Checks the pom.xml for the release version.
|
||||
# This method fails if the pom file has no SNAPSHOT version set ie.
|
||||
# if the version is already on a release version we fail.
|
||||
@ -564,6 +584,7 @@ if __name__ == '__main__':
|
||||
print(' JAVA_HOME is [%s]' % JAVA_HOME)
|
||||
print(' Running with maven command: [%s] ' % (MVN))
|
||||
if build:
|
||||
verify_lucene_version()
|
||||
release_version = find_release_version(src_branch)
|
||||
ensure_no_open_tickets(release_version)
|
||||
if not dry_run:
|
||||
|
29
pom.xml
29
pom.xml
@ -31,7 +31,8 @@
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<lucene.version>4.10.0</lucene.version>
|
||||
<lucene.version>4.10.1</lucene.version>
|
||||
<lucene.maven.version>4.10.1-snapshot-1627368</lucene.maven.version>
|
||||
<tests.jvms>auto</tests.jvms>
|
||||
<tests.shuffle>true</tests.shuffle>
|
||||
<tests.output>onerror</tests.output>
|
||||
@ -45,6 +46,10 @@
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Lucene snapshots</id>
|
||||
<url>https://download.elasticsearch.org/lucenesnapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>Codehaus Snapshots</id>
|
||||
<url>http://repository.codehaus.org/</url>
|
||||
@ -67,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-test-framework</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -80,19 +85,19 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-core</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-analyzers-common</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-queries</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -104,19 +109,19 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-memory</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-highlighter</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-queryparser</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
@ -128,26 +133,26 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-suggest</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-join</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- Lucene spatial, make sure when upgrading to work with latest version of jts/spatial4j dependencies -->
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-spatial</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-expressions</artifactId>
|
||||
<version>${lucene.version}</version>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
@ -205,7 +205,7 @@ public class Version implements Serializable {
|
||||
public static final int V_1_5_0_ID = /*00*/1050099;
|
||||
public static final Version V_1_5_0 = new Version(V_1_5_0_ID, false, org.apache.lucene.util.Version.LUCENE_4_10_0);
|
||||
public static final int V_2_0_0_ID = /*00*/2000099;
|
||||
public static final Version V_2_0_0 = new Version(V_2_0_0_ID, true, org.apache.lucene.util.Version.LUCENE_4_10_0);
|
||||
public static final Version V_2_0_0 = new Version(V_2_0_0_ID, true, org.apache.lucene.util.Version.LUCENE_4_10_1);
|
||||
|
||||
public static final Version CURRENT = V_2_0_0;
|
||||
|
||||
|
@ -237,7 +237,7 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
||||
if (logger.isDebugEnabled()) {
|
||||
if (t != null) {
|
||||
if (!TransportActions.isShardNotAvailableException(t)) {
|
||||
logger.debug("{}: failed to executed [{}]", t, shard != null ? shard.shortSummary() : shardIt.shardId(), request);
|
||||
logger.debug("{}: failed to execute [{}]", t, shard != null ? shard.shortSummary() : shardIt.shardId(), request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,6 +43,7 @@ import org.elasticsearch.index.analysis.NamedAnalyzer;
|
||||
import org.elasticsearch.index.fielddata.IndexFieldData;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
|
||||
import static org.elasticsearch.common.lucene.search.NoopCollector.NOOP_COLLECTOR;
|
||||
|
||||
@ -70,7 +71,7 @@ public class Lucene {
|
||||
}
|
||||
try {
|
||||
return Version.parse(version);
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (ParseException e) {
|
||||
logger.warn("no version match {}, default to {}", version, defaultVersion, e);
|
||||
return defaultVersion;
|
||||
}
|
||||
@ -562,7 +563,7 @@ public class Lucene {
|
||||
if (Strings.hasLength(toParse)) {
|
||||
try {
|
||||
return Version.parseLeniently(toParse);
|
||||
} catch (IllegalArgumentException e) {
|
||||
} catch (ParseException e) {
|
||||
// pass to default
|
||||
}
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ public final class DistributorDirectory extends BaseDirectory {
|
||||
Directory directory = getDirectory(from);
|
||||
if (nameDirMapping.putIfAbsent(to, directory) != null) {
|
||||
throw new IOException("Can't rename file from " + from
|
||||
+ " to: " + to + "target file already exists");
|
||||
+ " to: " + to + ": target file already exists");
|
||||
}
|
||||
boolean success = false;
|
||||
try {
|
||||
|
@ -24,6 +24,7 @@ import java.io.IOException;
|
||||
import org.apache.lucene.store.BaseDirectoryTestCase;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.IOContext;
|
||||
import org.apache.lucene.store.MockDirectoryWrapper;
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
import org.apache.lucene.util.TimeUnits;
|
||||
import org.elasticsearch.index.store.distributor.Distributor;
|
||||
@ -46,6 +47,10 @@ public class DistributorDirectoryTest extends BaseDirectoryTestCase {
|
||||
Directory[] directories = new Directory[1 + random().nextInt(5)];
|
||||
for (int i = 0; i < directories.length; i++) {
|
||||
directories[i] = newDirectory();
|
||||
if (directories[i] instanceof MockDirectoryWrapper) {
|
||||
// TODO: fix this test to handle virus checker
|
||||
((MockDirectoryWrapper) directories[i]).setEnableVirusScanner(false);
|
||||
}
|
||||
}
|
||||
return new DistributorDirectory(directories);
|
||||
}
|
||||
|
@ -514,6 +514,8 @@ public class StoreTest extends ElasticsearchLuceneTestCase {
|
||||
dirs[i] = newDirectory(random);
|
||||
if (dirs[i] instanceof MockDirectoryWrapper) {
|
||||
((MockDirectoryWrapper)dirs[i]).setPreventDoubleWrite(preventDoubleWrite);
|
||||
// TODO: fix this test to handle virus checker
|
||||
((MockDirectoryWrapper)dirs[i]).setEnableVirusScanner(false);
|
||||
}
|
||||
}
|
||||
this.random = random;
|
||||
|
@ -85,6 +85,8 @@ public class MockDirectoryHelper {
|
||||
w.setThrottling(throttle);
|
||||
w.setCheckIndexOnClose(false); // we do this on the index level
|
||||
w.setPreventDoubleWrite(preventDoubleWrite);
|
||||
// TODO: make this test robust to virus scanner
|
||||
w.setEnableVirusScanner(false);
|
||||
w.setNoDeleteOpenFile(noDeleteOpenFile);
|
||||
wrappers.add(w);
|
||||
return w;
|
||||
|
Loading…
x
Reference in New Issue
Block a user