From 05c562344416cf874915b44c8b30c3194beeba1d Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Thu, 26 Sep 2024 13:32:43 +0200 Subject: [PATCH 1/4] Prepare issue branch. --- pom.xml | 2 +- spring-data-mongodb-benchmarks/pom.xml | 2 +- spring-data-mongodb-distribution/pom.xml | 2 +- spring-data-mongodb/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 3fa54424af..0ac7ed44eb 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 4.4.0-SNAPSHOT + 4.4.x-4785-SNAPSHOT pom Spring Data MongoDB diff --git a/spring-data-mongodb-benchmarks/pom.xml b/spring-data-mongodb-benchmarks/pom.xml index a3dc49f892..a4eb76d5ae 100644 --- a/spring-data-mongodb-benchmarks/pom.xml +++ b/spring-data-mongodb-benchmarks/pom.xml @@ -7,7 +7,7 @@ org.springframework.data spring-data-mongodb-parent - 4.4.0-SNAPSHOT + 4.4.x-4785-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb-distribution/pom.xml b/spring-data-mongodb-distribution/pom.xml index acdc13437d..7075d8eb4a 100644 --- a/spring-data-mongodb-distribution/pom.xml +++ b/spring-data-mongodb-distribution/pom.xml @@ -15,7 +15,7 @@ org.springframework.data spring-data-mongodb-parent - 4.4.0-SNAPSHOT + 4.4.x-4785-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index fafe9c8793..2f9dcb40c2 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -13,7 +13,7 @@ org.springframework.data spring-data-mongodb-parent - 4.4.0-SNAPSHOT + 4.4.x-4785-SNAPSHOT ../pom.xml From 225015d2b37c655a5cdce31baddcb794b009f03d Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Thu, 26 Sep 2024 14:02:29 +0200 Subject: [PATCH 2/4] Update MongoDB Server compatibility matrix. --- .../antora/modules/ROOT/pages/preface.adoc | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/main/antora/modules/ROOT/pages/preface.adoc b/src/main/antora/modules/ROOT/pages/preface.adoc index a597ef1569..c73bd29dbc 100644 --- a/src/main/antora/modules/ROOT/pages/preface.adoc +++ b/src/main/antora/modules/ROOT/pages/preface.adoc @@ -9,74 +9,77 @@ In terms of database and driver, you need at least version 4.x of https://www.mo == Compatibility Matrix The following compatibility matrix summarizes Spring Data versions to MongoDB driver/database versions. -Database versions show the highest supported server version that pass the Spring Data test suite. +Database versions show server generations that pass the Spring Data test suite. You can use newer server versions unless your application uses functionality that is affected by xref:preface.adoc#compatibility.changes[changes in the MongoDB server]. See also the https://www.mongodb.com/docs/drivers/java/sync/current/compatibility/[official MongoDB driver compatibility matrix] for driver- and server version compatibility. +==== [cols="h,m,m,m", options="header"] |=== |Spring Data Release Train |Spring Data MongoDB |Driver Version -|Server Version +|Database Versions |2024.0 |4.3.x |4.11.x & 5.x -|6.x +|4.4.x, 5.x, 6.x, 7.x |2023.1 -|4.1.x +|4.2.x |4.9.x -|7.0.x +|4.4.x, 5.x, 6.x, 7.x -|2023.0 +|2023.0 (*) |4.1.x |4.9.x -|6.0.x +|4.4.x, 5.x, 6.x -|2022.0 +|2022.0 (*) |4.0.x |4.7.x -|6.0.x +|4.4.x, 5.x, 6.x -|2021.2 +|2021.2 (*) |3.4.x |4.6.x -|5.0.x +|4.4.x, 5.0.x -|2021.1 +|2021.1 (*) |3.3.x |4.4.x -|5.0.x +|4.4.x, 5.0.x -|2021.0 +|2021.0 (*) |3.2.x |4.1.x |4.4.x -|2020.0 +|2020.0 (*) |3.1.x |4.1.x |4.4.x -|Neumann +|Neumann (*) |3.0.x |4.0.x |4.4.x -|Moore +|Moore (*) |2.2.x |3.11.x/Reactive Streams 1.12.x |4.2.x -|Lovelace +|Lovelace (*) |2.1.x |3.8.x/Reactive Streams 1.9.x |4.0.x |=== +(*) End of OSS Support +==== [[compatibility.changes]] [[compatibility.changes-4.4]] From 1aa8f9d01b62f249573d969397dd5cfd4d1cfd6e Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Thu, 26 Sep 2024 14:12:31 +0200 Subject: [PATCH 3/4] Update CI build to test against MongoDB Server 8.0 Tabs vs Spaces who's gonna win? --- Jenkinsfile | 45 +++++++++++++++++++ ci/openjdk17-mongodb-8.0/Dockerfile | 25 +++++++++++ ci/pipeline.properties | 1 + .../antora/modules/ROOT/pages/preface.adoc | 5 +++ 4 files changed, 76 insertions(+) create mode 100644 ci/openjdk17-mongodb-8.0/Dockerfile diff --git a/Jenkinsfile b/Jenkinsfile index 3d1f276a55..edcafb9fd7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -134,6 +134,25 @@ pipeline { } } } + stage('Publish JDK (Java 17) + MongoDB 8.0') { + when { + anyOf { + changeset "ci/openjdk17-mongodb-8.0/**" + changeset "ci/pipeline.properties" + } + } + agent { label 'data' } + options { timeout(time: 30, unit: 'MINUTES') } + + steps { + script { + def image = docker.build("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}", "--build-arg BASE=${p['docker.java.main.image']} --build-arg MONGODB=${p['docker.mongodb.8.0.version']} ci/openjdk17-mongodb-8.0/") + docker.withRegistry(p['docker.registry'], p['docker.credentials']) { + image.push() + } + } + } + } } } @@ -308,6 +327,32 @@ pipeline { } } } + + stage("test: MongoDB 8.0 (main)") { + agent { + label 'data' + } + options { timeout(time: 30, unit: 'MINUTES') } + environment { + ARTIFACTORY = credentials("${p['artifactory.credentials']}") + DEVELOCITY_ACCESS_KEY = credentials("${p['develocity.access-key']}") + } + steps { + script { + docker.withRegistry(p['docker.proxy.registry'], p['docker.proxy.credentials']) { + docker.image("springci/spring-data-with-mongodb-8.0:${p['java.main.tag']}").inside(p['docker.java.inside.basic']) { + sh 'mkdir -p /tmp/mongodb/db /tmp/mongodb/log' + sh 'mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log &' + sh 'sleep 10' + sh 'mongosh --eval "rs.initiate({_id: \'rs0\', members:[{_id: 0, host: \'127.0.0.1:27017\'}]});"' + sh 'sleep 15' + sh 'MAVEN_OPTS="-Duser.name=' + "${p['jenkins.user.name']}" + ' -Duser.home=/tmp/jenkins-home" ' + + "./mvnw -s settings.xml clean dependency:list test -Dsort -U -B" + } + } + } + } + } } } diff --git a/ci/openjdk17-mongodb-8.0/Dockerfile b/ci/openjdk17-mongodb-8.0/Dockerfile new file mode 100644 index 0000000000..81b9c23a5b --- /dev/null +++ b/ci/openjdk17-mongodb-8.0/Dockerfile @@ -0,0 +1,25 @@ +ARG BASE +FROM ${BASE} +# Any ARG statements before FROM are cleared. +ARG MONGODB + +ENV TZ=Etc/UTC +ENV DEBIAN_FRONTEND=noninteractive +ENV MONGO_VERSION=${MONGODB} + +RUN set -eux; \ + sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \ + sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \ + sed -i -e 's/ports.ubuntu.com/mirrors.ocf.berkeley.edu/g' /etc/apt/sources.list && \ + sed -i -e 's/http/https/g' /etc/apt/sources.list && \ + apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 wget && \ + # MongoDB 8.0 release signing key + wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | apt-key add - && \ + # Needed when MongoDB creates a 8.0 folder. + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list && \ + echo ${TZ} > /etc/timezone + +RUN apt-get update && \ + apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* diff --git a/ci/pipeline.properties b/ci/pipeline.properties index 40bb349196..c342f49a24 100644 --- a/ci/pipeline.properties +++ b/ci/pipeline.properties @@ -11,6 +11,7 @@ docker.mongodb.4.4.version=4.4.25 docker.mongodb.5.0.version=5.0.21 docker.mongodb.6.0.version=6.0.10 docker.mongodb.7.0.version=7.0.2 +docker.mongodb.8.0.version=8.0.0 # Supported versions of Redis docker.redis.6.version=6.2.13 diff --git a/src/main/antora/modules/ROOT/pages/preface.adoc b/src/main/antora/modules/ROOT/pages/preface.adoc index c73bd29dbc..fc4cf89111 100644 --- a/src/main/antora/modules/ROOT/pages/preface.adoc +++ b/src/main/antora/modules/ROOT/pages/preface.adoc @@ -22,6 +22,11 @@ See also the https://www.mongodb.com/docs/drivers/java/sync/current/compatibilit |Driver Version |Database Versions +|2024.1 +|4.4.x +|5.x +|4.4.x, 5.x, 6.x, 7.x, 8.x + |2024.0 |4.3.x |4.11.x & 5.x From 6093a9a547f397c5e40de1eee625016c1686917f Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Thu, 26 Sep 2024 14:55:42 +0200 Subject: [PATCH 4/4] Give the server a little think time to complete operations during reactive tx tests. --- .../data/mongodb/ReactiveTransactionIntegrationTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java index 545def16c4..f4d918f31e 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/ReactiveTransactionIntegrationTests.java @@ -108,7 +108,7 @@ public void setUp() { Flux.merge( // MongoTestUtils.createOrReplaceCollection(DATABASE, operations.getCollectionName(Person.class), client), MongoTestUtils.createOrReplaceCollection(DATABASE, operations.getCollectionName(EventLog.class), client) // - ).then().as(StepVerifier::create).verifyComplete(); + ).then().as(StepVerifier::create).thenAwait(Duration.ofMillis(100)).verifyComplete(); } } @@ -143,6 +143,7 @@ public void commitShouldPersistTxEntries() { personService.savePerson(new Person(null, "Walter", "White")) // .as(StepVerifier::create) // + .thenAwait(Duration.ofMillis(100)) .expectNextCount(1) // .verifyComplete();