diff --git a/UPGRADING.md b/UPGRADING.md index 79ab724fdc..89e144d60b 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -10,6 +10,17 @@ Graylog now requires Java 21 to run. Earlier versions are no longer supported. Our operating system packages and container images are shipping with the correct Java version. +### Mongo DB 7.0 + +Graylog now requires at least Mongo DB version 7.0. Earlier versions are no longer supported. + +In general, MongoDB upgrades must be done from one minor release to the next, going to the latest bug fix version +in that release. Please refer to the Mongo DB upgrade documentation for details: +- [Upgrade tutorial](https://www.mongodb.com/docs/manual/tutorial/upgrade-revision/#std-label-upgrade-to-latest-revision/) +- [6.0](https://www.mongodb.com/docs/manual/release-notes/6.0-upgrade/) +- [7.0](https://www.mongodb.com/docs/manual/release-notes/7.0-upgrade/) +- [8.0](https://www.mongodb.com/docs/manual/release-notes/8.0-upgrade/) + ### Kafka Inputs The `kafka-clients` library was updated to 4.x which removes support for Kafka diff --git a/changelog/unreleased/issue-23448.toml b/changelog/unreleased/issue-23448.toml new file mode 100644 index 0000000000..f0125c3f73 --- /dev/null +++ b/changelog/unreleased/issue-23448.toml @@ -0,0 +1,5 @@ +type = "c" +message = "Minimum required version of MongoDB is now raised to 7.0." + +issues = ["23448"] +pulls = [""] diff --git a/data-node/migration/docker-compose.yml b/data-node/migration/docker-compose.yml index 8992cddbe4..d8d15b85ee 100644 --- a/data-node/migration/docker-compose.yml +++ b/data-node/migration/docker-compose.yml @@ -8,7 +8,7 @@ version: "3.8" services: mongodb: hostname: "mongodb" - image: "mongo:5.0" + image: "mongo:7.0" ports: - "27017:27017" volumes: diff --git a/data-node/migration/es710-docker-compose.yml b/data-node/migration/es710-docker-compose.yml index 05c8964424..979e467d63 100644 --- a/data-node/migration/es710-docker-compose.yml +++ b/data-node/migration/es710-docker-compose.yml @@ -8,7 +8,7 @@ version: "3.8" services: mongodb: hostname: "mongodb" - image: "mongo:5.0" + image: "mongo:7.0" ports: - "27017:27017" volumes: diff --git a/graylog2-server/src/main/java/org/graylog2/database/MongoDBVersionCheck.java b/graylog2-server/src/main/java/org/graylog2/database/MongoDBVersionCheck.java index 0738fb2362..df53c82e63 100644 --- a/graylog2-server/src/main/java/org/graylog2/database/MongoDBVersionCheck.java +++ b/graylog2-server/src/main/java/org/graylog2/database/MongoDBVersionCheck.java @@ -32,7 +32,7 @@ import java.util.ArrayList; public class MongoDBVersionCheck { private static final Logger LOG = LoggerFactory.getLogger(MongoDBVersionCheck.class); - private static final Version MINIMUM_MONGODB_VERSION = Version.of(5, 0); + private static final Version MINIMUM_MONGODB_VERSION = Version.of(7, 0); public static Version getVersion(MongoClient mongoClient) { final MongoDatabase adminDb = mongoClient.getDatabase("admin"); diff --git a/graylog2-server/src/test/java/org/graylog/testing/containermatrix/MongodbServer.java b/graylog2-server/src/test/java/org/graylog/testing/containermatrix/MongodbServer.java index 8948dd38d0..562d58c0b1 100644 --- a/graylog2-server/src/test/java/org/graylog/testing/containermatrix/MongodbServer.java +++ b/graylog2-server/src/test/java/org/graylog/testing/containermatrix/MongodbServer.java @@ -17,10 +17,9 @@ package org.graylog.testing.containermatrix; public enum MongodbServer { - MONGO5("5.0"), MONGO7("7.0"); - public static final MongodbServer DEFAULT_VERSION = MONGO5; + public static final MongodbServer DEFAULT_VERSION = MONGO7; private final String version; diff --git a/graylog2-server/src/test/java/org/graylog/testing/containermatrix/annotations/ContainerMatrixTestsConfiguration.java b/graylog2-server/src/test/java/org/graylog/testing/containermatrix/annotations/ContainerMatrixTestsConfiguration.java index 3884f4b56d..cfca900bb1 100644 --- a/graylog2-server/src/test/java/org/graylog/testing/containermatrix/annotations/ContainerMatrixTestsConfiguration.java +++ b/graylog2-server/src/test/java/org/graylog/testing/containermatrix/annotations/ContainerMatrixTestsConfiguration.java @@ -74,7 +74,7 @@ public @interface ContainerMatrixTestsConfiguration { * matrix rule * If no version is explicitly specified, then {@link MongodbServer#DEFAULT_VERSION will be used by the tests} */ - MongodbServer[] mongoVersions() default {MongodbServer.MONGO5}; + MongodbServer[] mongoVersions() default {MongodbServer.MONGO7}; // are run after the initialization of mongoDb, gets concatenated for all tests below the above rules String[] mongoDBFixtures() default {}; diff --git a/graylog2-server/src/test/java/org/graylog2/cluster/lock/MongoLockServiceTest5.java b/graylog2-server/src/test/java/org/graylog2/cluster/lock/MongoLockServiceTest5.java deleted file mode 100644 index d349984557..0000000000 --- a/graylog2-server/src/test/java/org/graylog2/cluster/lock/MongoLockServiceTest5.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2020 Graylog, Inc. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the Server Side Public License, version 1, - * as published by MongoDB, Inc. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * Server Side Public License for more details. - * - * You should have received a copy of the Server Side Public License - * along with this program. If not, see - * . - */ -package org.graylog2.cluster.lock; - -import org.graylog.testing.containermatrix.MongodbServer; -import org.graylog.testing.mongodb.MongoDBExtension; -import org.junit.jupiter.api.extension.RegisterExtension; - -public class MongoLockServiceTest5 extends MongoLockServiceTest { - @RegisterExtension - static MongoDBExtension mongodbExtension = MongoDBExtension.create(MongodbServer.MONGO5); -} diff --git a/graylog2-server/src/test/java/org/junit/jupiter/engine/descriptor/ContainerMatrixTestsDescriptorTest.java b/graylog2-server/src/test/java/org/junit/jupiter/engine/descriptor/ContainerMatrixTestsDescriptorTest.java index a5c1d05668..b4131e69d3 100644 --- a/graylog2-server/src/test/java/org/junit/jupiter/engine/descriptor/ContainerMatrixTestsDescriptorTest.java +++ b/graylog2-server/src/test/java/org/junit/jupiter/engine/descriptor/ContainerMatrixTestsDescriptorTest.java @@ -30,7 +30,7 @@ class ContainerMatrixTestsDescriptorTest { @Test void createKey() { - final String key = ContainerMatrixTestsDescriptor.createKey(Lifecycle.CLASS, "mavenDir", "jarDir", SearchVersion.create(SearchVersion.Distribution.OPENSEARCH, Version.valueOf("1.2.3")), MongodbServer.MONGO5, true, true, Map.of("p1", "v1"), List.of(), "datanodeJarDir"); - Assertions.assertThat(key).isEqualTo("Lifecycle: CLASS, MavenProjectDirProvider: mavenDir, PluginJarsProvider: jarDir, Search: OpenSearch:1.2.3, MongoDB: 5.0, DatanodePluginJarsProvider: datanodeJarDir, Mailserver: enabled, Webhookserver: enabled, p1: v1"); + final String key = ContainerMatrixTestsDescriptor.createKey(Lifecycle.CLASS, "mavenDir", "jarDir", SearchVersion.create(SearchVersion.Distribution.OPENSEARCH, Version.valueOf("1.2.3")), MongodbServer.MONGO7, true, true, Map.of("p1", "v1"), List.of(), "datanodeJarDir"); + Assertions.assertThat(key).isEqualTo("Lifecycle: CLASS, MavenProjectDirProvider: mavenDir, PluginJarsProvider: jarDir, Search: OpenSearch:1.2.3, MongoDB: 7.0, DatanodePluginJarsProvider: datanodeJarDir, Mailserver: enabled, Webhookserver: enabled, p1: v1"); } }