Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update to Apache Lucene 10 for 3.0.0 #16366

Draft
wants to merge 84 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
fb9623b
Update to Apache Lucene 10 for 3.0.0
reta Oct 17, 2024
1afb95a
More Lucene 10 build fixes
msfroh Nov 12, 2024
e6ad633
Merge remote-tracking branch 'origin/main' into issue-11415
reta Nov 12, 2024
b284053
Fix more compilation failures
reta Nov 12, 2024
213f9c0
Fix more compilation failures
reta Nov 13, 2024
560116c
Merge remote-tracking branch 'origin/main' into issue-11415
reta Nov 13, 2024
06e90f0
Fix more compilation failures
reta Nov 13, 2024
1ab1a5f
Fix more compilation failures
andrross Nov 13, 2024
0fafd24
Replace DocValuesFieldExistsQuery with FieldExistsQuery
andrross Nov 13, 2024
ce3af73
Fix signature changes in o.a.l.search.BooleanQuery
andrross Nov 13, 2024
77dbc74
Fix more compilation failures, update shadow Gradle plugin and fix lo…
reta Nov 14, 2024
39749bf
Fix more compilation failures
reta Nov 18, 2024
52fddbb
Fix analysis-common compilation issues
reta Nov 18, 2024
965a4ad
Fix more compilation failures
reta Nov 18, 2024
90dbe1a
Merge remote-tracking branch 'upstream/main' into issue-11415
andrross Nov 19, 2024
7af891d
Fix more compilation failures
reta Nov 19, 2024
111029d
More compilation fixes
andrross Nov 19, 2024
8064d06
More compilation fixes
andrross Nov 20, 2024
d09cb90
Fix assemble tasks
reta Nov 20, 2024
cfba336
Fix more compilation failures
reta Nov 20, 2024
e167a0d
Fix more compilation failures, add CHANGELOG.md
reta Nov 20, 2024
d263774
Fix more compilation failures
reta Nov 20, 2024
19c2956
Fixed Lucene latest codec name
reta Nov 20, 2024
ae12a81
Refactor preload tests in FsDirectoryFactoryTests
andrross Nov 20, 2024
3bb74c1
Fix more compilation failures
andrross Nov 20, 2024
b0a89a4
Fix precommit failures
andrross Nov 20, 2024
f971515
Fix analysis test cases
reta Nov 21, 2024
66c0616
Fix FieldData & ParentJoinAggregator ordinal traversal
reta Nov 21, 2024
5b9e939
Fix IpFieldMapper & CollapsingDocValuesSource ordinal traversal
reta Nov 21, 2024
28a18b2
Fix MultiValueMode, GlobalOrdinalValuesSource, BinaryRangeAggregator,…
reta Nov 21, 2024
f9ac2bb
Fix MultiValueModeTests, BinaryRangeAggregatorTests, IncludeExcludeTe…
reta Nov 21, 2024
9fea439
Fix ICUCollationKeywordFieldMapper & VectorFieldTests tests
reta Nov 21, 2024
9cc86b1
Merge remote-tracking branch 'origin/main' into issue-11415
reta Nov 26, 2024
d0a4727
Merge remote-tracking branch 'origin/main' into issue-11415
reta Nov 29, 2024
a265dc0
Fix org.opensearch.common.xcontent.support.XContentMapValuesTests tes…
reta Dec 2, 2024
2bf22a1
Fix FunctionScoreQuery::CustomBoostFactorWeight::scorerSupplier that …
reta Dec 2, 2024
8b51a8d
Fix CodecTests and non-concurrent ContextIndexSearcher::search implem…
reta Dec 3, 2024
8ef5ce1
Fixed GlobalOrdinalMapping ordinals iteration and SortedWiderNumericS…
reta Dec 3, 2024
9074f26
Merge remote-tracking branch 'origin/main' into issue-11415
reta Dec 3, 2024
d6a9ea3
Fix FieldData and SortedSetDocValuesWriterWrapperTests
reta Dec 3, 2024
6550715
Fix org.opensearch.repositories.azure.AzureBlobStoreRepositoryTests t…
reta Dec 3, 2024
e14df71
Fix org.opensearch.search.aggregations.bucket.composite.CompositeAggr…
reta Dec 4, 2024
61ee1b4
Fix MultiValueMode ordinal traversal
reta Dec 4, 2024
d44b0d8
Fix GlobalOrdinalMapping and GlobalOrdinalsStringTermsAggregator ordi…
reta Dec 4, 2024
84818f8
Fix QueryStringQueryBuilderTests and QueryStringQueryBuilder fuzzy qu…
reta Dec 5, 2024
e26e7db
Fix StarTree*DocValueFormatTests
msfroh Dec 13, 2024
040e121
Fix various MultiTermQuery-related tests
msfroh Dec 13, 2024
ea509df
Fix Spotless
msfroh Dec 13, 2024
0fb9e04
Fix RegEx automaton processing using Operations.determinize(...)
reta Dec 16, 2024
660a3ff
Merge remote-tracking branch 'origin/main' into issue-11415
reta Dec 16, 2024
1c25393
Fix compilation issues (post merge)
reta Dec 16, 2024
6c154d5
Fix UnsignedLongComparator::sortableBytesToLong encoding
reta Dec 16, 2024
2500fce
Merge remote-tracking branch 'origin/main' into issue-11415
reta Dec 17, 2024
510f765
Fix HalfFloatComparator::sortableBytesToLong and HalfFloatComparator:…
reta Dec 17, 2024
67d17c1
Fix infinite recursion in CollapsingTopDocsCollectorTests
msfroh Dec 17, 2024
15dd0e8
Fix SingleDimensionValuesSourceTests
msfroh Dec 17, 2024
92e2e54
Fix a few more MultiTermQuery-related test failures
msfroh Dec 17, 2024
bae0338
Merge branch 'main' into issue-11415
reta Dec 18, 2024
b633132
Fixed QueryPhaseTests#minScoreOptimisation by not delegating setWeigh…
expani Dec 18, 2024
b2ac498
Merge pull request #201 from expani/issue-11415-clone
reta Dec 18, 2024
59e7d03
Fix DerivedFieldMapperQueryTests
msfroh Dec 18, 2024
8861111
Fix SortedNumericDocValuesWriterWrapperTests
msfroh Dec 18, 2024
7ca821a
Fix IpRangeAggregatorTests
msfroh Dec 19, 2024
df31192
Fix IpFieldMapperTests
msfroh Dec 19, 2024
b780ac5
Fix MissingValues ordinal traversal and MultiOrdinalsTests tests
reta Dec 19, 2024
fd14e80
Prevent cascading test failures in SearchServiceTests
msfroh Dec 19, 2024
ea0549b
Fix DerivedFieldTypeTests
msfroh Dec 19, 2024
3d0b52d
Fix TransferManagerRemoteDirectoryReaderTests
msfroh Dec 19, 2024
fda70e4
Add missing javadoc
reta Dec 19, 2024
17ecd4c
Merge remote-tracking branch 'origin/main' into issue-11415
reta Dec 19, 2024
2ae505b
Uploaded Index generated from Lucene 8.x ( OpenSearch 1.3.0 ) to be u…
expani Dec 19, 2024
737ab3a
Moved path to a constant
expani Dec 19, 2024
0874389
Merge pull request #202 from expani/issue-11415-2
reta Dec 20, 2024
3549c2d
Update Apache Lucene to 10.1.0
reta Dec 20, 2024
60b781b
Fixed unit tests for lucene 10 upgrade
expani Dec 21, 2024
5871134
Merge pull request #203 from expani/issue-11415-3
reta Dec 21, 2024
2c35bfc
Fix posting format for CompletionFieldMapper
reta Dec 23, 2024
72cff6d
Fix org.opensearch.search.SearchServiceTests test cases
reta Dec 23, 2024
e3973eb
Removed extra iteration of DISI and added stored field option to bypa…
expani Dec 23, 2024
9e13d1e
Changed to use advance and init to use docId() instead of nextDoc()
expani Dec 23, 2024
a74e65e
Merge pull request #204 from expani/issue-11415-4
reta Dec 23, 2024
b5ae870
Increased number of indexed docs to match segment count
expani Dec 24, 2024
285dd26
Reduced segment count to match assertion instead of increasing docs
expani Dec 24, 2024
2ce5cfb
Merge pull request #205 from expani/issue-11415-5
reta Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 3 additions & 14 deletions .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ 11, 17, 21 ]
java: [ 21, 23 ]
os: [ubuntu-latest, windows-latest, macos-13]
steps:
- uses: actions/checkout@v4
Expand All @@ -16,17 +16,6 @@ jobs:
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Set up JDK 17
# See please https://docs.gradle.org/8.10/userguide/upgrading_version_8.html#minimum_daemon_jvm_version
if: matrix.java == 11
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set JAVA${{ matrix.java }}_HOME
shell: bash
run: |
echo "JAVA${{ matrix.java }}_HOME=$JAVA_HOME_${{ matrix.java }}_${{ runner.arch }}" >> $GITHUB_ENV
- name: Setup docker (missing on MacOS)
id: setup_docker
if: runner.os == 'macos'
Expand All @@ -47,8 +36,8 @@ jobs:
shell: bash
if: runner.os != 'macos'
run: |
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE -Druntime.java=${{ matrix.java }}
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE
- name: Run Gradle (assemble)
if: runner.os == 'macos' && steps.setup_docker.outcome == 'success'
run: |
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE -Druntime.java=${{ matrix.java }}
./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE
15 changes: 2 additions & 13 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ 11, 17, 21, 23 ]
java: [ 21, 23 ]
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
steps:
- uses: actions/checkout@v4
Expand All @@ -17,18 +17,7 @@ jobs:
java-version: ${{ matrix.java }}
distribution: temurin
cache: gradle
- name: Set up JDK 17
# See please https://docs.gradle.org/8.10/userguide/upgrading_version_8.html#minimum_daemon_jvm_version
if: matrix.java == 11
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set JAVA${{ matrix.java }}_HOME
shell: bash
run: |
echo "JAVA${{ matrix.java }}_HOME=$JAVA_HOME_${{ matrix.java }}_${{ runner.arch }}" >> $GITHUB_ENV
- name: Run Gradle (precommit)
shell: bash
run: |
./gradlew javadoc precommit --parallel -Druntime.java=${{ matrix.java }}
./gradlew javadoc precommit --parallel
1 change: 1 addition & 0 deletions CHANGELOG-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Views, simplify data access and manipulation by providing a virtual layer over one or more indices ([#11957](https://github.com/opensearch-project/OpenSearch/pull/11957))

### Dependencies
- Update Apache Lucene to 10.1.0 ([#16366](https://github.com/opensearch-project/OpenSearch/pull/16366))

### Changed
- Changed locale provider from COMPAT to CLDR ([#14345](https://github.com/opensearch-project/OpenSearch/pull/14345))
Expand Down
43 changes: 2 additions & 41 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,44 +85,5 @@ spotless {
}
}

if (BuildParams.runtimeJavaVersion >= JavaVersion.VERSION_20) {
// Add support for incubator modules on supported Java versions.
run.jvmArgs += ['--add-modules=jdk.incubator.vector']
run.classpath += files(jar.archiveFile)
run.classpath -= sourceSets.main.output
evaluationDependsOn(':libs:opensearch-common')

sourceSets {
java20 {
java {
srcDirs = ['src/main/java20']
}
}
}

configurations {
java20Implementation.extendsFrom(implementation)
}

dependencies {
java20Implementation sourceSets.main.output
java20Implementation project(':libs:opensearch-common').sourceSets.java20.output
java20AnnotationProcessor "org.openjdk.jmh:jmh-generator-annprocess:$versions.jmh"
}

compileJava20Java {
targetCompatibility = JavaVersion.VERSION_20
options.compilerArgs.addAll(["-processor", "org.openjdk.jmh.generators.BenchmarkProcessor"])
}

jar {
metaInf {
into 'versions/20'
from sourceSets.java20.output
}
manifest.attributes('Multi-Release': 'true')
}

// classes generated by JMH can use all sorts of forbidden APIs but we have no influence at all and cannot exclude these classes
disableTasks('forbiddenApisJava20')
}
// Add support for incubator modules on supported Java versions.
run.jvmArgs += ['--add-modules=jdk.incubator.vector']
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class RoundableSupplier implements Supplier<Roundable> {
private final Supplier<Roundable> delegate;

RoundableSupplier(String type, long[] values, int size) throws ClassNotFoundException {
RoundableSupplier(String type, long[] values, int size) {
switch (type) {
case "binary":
delegate = () -> new BinarySearcher(values, size);
Expand All @@ -22,7 +22,8 @@ public class RoundableSupplier implements Supplier<Roundable> {
delegate = () -> new BidirectionalLinearSearcher(values, size);
break;
case "btree":
throw new ClassNotFoundException("BtreeSearcher is not supported below JDK 20");
delegate = () -> new BtreeSearcher(values, size);
break;
default:
throw new IllegalArgumentException("invalid type: " + type);
}
Expand Down
10 changes: 5 additions & 5 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ processResources {
* Java version *
*****************************************************************************/

if (JavaVersion.current() < JavaVersion.VERSION_11) {
throw new GradleException('At least Java 11 is required to build opensearch gradle tools')
if (JavaVersion.current() < JavaVersion.VERSION_21) {
throw new GradleException('At least Java 21 is required to build opensearch gradle tools')
}

sourceSets {
Expand Down Expand Up @@ -111,7 +111,7 @@ dependencies {
api 'org.apache.rat:apache-rat:0.15'
api "commons-io:commons-io:${props.getProperty('commonsio')}"
api "net.java.dev.jna:jna:5.14.0"
api 'com.github.johnrengelman:shadow:8.1.1'
api 'com.gradleup.shadow:shadow-gradle-plugin:8.3.5'
api 'org.jdom:jdom2:2.0.6.1'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${props.getProperty('kotlin')}"
api 'de.thetaphi:forbiddenapis:3.8'
Expand Down Expand Up @@ -171,8 +171,8 @@ if (project != rootProject) {

allprojects {
java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/reaper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
apply plugin: 'java'

java {
targetCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_21
sourceCompatibility = JavaVersion.VERSION_21
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
# specific language governing permissions and limitations
# under the License.
#
OPENSEARCH_BUILD_JAVA=openjdk11
OPENSEARCH_RUNTIME_JAVA=java11
OPENSEARCH_BUILD_JAVA=openjdk21
OPENSEARCH_RUNTIME_JAVA=java21
GRADLE_TASK=build
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ java.nio.channels.FileChannel#read(java.nio.ByteBuffer, long)
@defaultMessage Use Lucene.parseLenient instead it strips off minor version
org.apache.lucene.util.Version#parseLeniently(java.lang.String)

@defaultMessage Spawns a new thread which is solely under lucenes control use ThreadPool#relativeTimeInMillis instead
org.apache.lucene.search.TimeLimitingCollector#getGlobalTimerThread()
org.apache.lucene.search.TimeLimitingCollector#getGlobalCounter()

@defaultMessage Don't interrupt threads use FutureUtils#cancel(Future<T>) instead
java.util.concurrent.Future#cancel(boolean)

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/minimumCompilerVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17
21
2 changes: 1 addition & 1 deletion buildSrc/src/main/resources/minimumRuntimeVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
11
21
4 changes: 2 additions & 2 deletions buildSrc/src/testKit/thirdPartyAudit/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ dependencies {
}

tasks.register("empty", ThirdPartyAuditTask) {
targetCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_21
signatureFile = file('third-party-audit-empty.txt')
}

tasks.register("absurd", ThirdPartyAuditTask) {
targetCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_21
signatureFile = file('third-party-audit-absurd.txt')
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void testCompressesResponseIfRequested() throws IOException {
SearchResponse searchResponse = execute(searchRequest, highLevelClient()::search, highLevelClient()::searchAsync, requestOptions);

assertThat(searchResponse.status().getStatus(), equalTo(200));
assertEquals(1L, searchResponse.getHits().getTotalHits().value);
assertEquals(1L, searchResponse.getHits().getTotalHits().value());
assertEquals(SAMPLE_DOCUMENT, searchResponse.getHits().getHits()[0].getSourceAsString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public void testDeleteByQuery() throws Exception {
assertEquals(0, bulkResponse.getSearchFailures().size());
assertEquals(
2,
highLevelClient().search(new SearchRequest(sourceIndex), RequestOptions.DEFAULT).getHits().getTotalHits().value
highLevelClient().search(new SearchRequest(sourceIndex), RequestOptions.DEFAULT).getHits().getTotalHits().value()
);
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public void testSearchScroll() throws IOException {
RequestOptions.DEFAULT
);
assertEquals(mockSearchResponse.getScrollId(), searchResponse.getScrollId());
assertEquals(0, searchResponse.getHits().getTotalHits().value);
assertEquals(0, searchResponse.getHits().getTotalHits().value());
assertEquals(5, searchResponse.getTotalShards());
assertEquals(5, searchResponse.getSuccessfulShards());
assertEquals(100, searchResponse.getTook().getMillis());
Expand Down
Loading
Loading