Enforce DB 7.0 and remove 5.0 references (#23578)

* enforce DB 7.0 and remove 5.0 references

* bump mongo version for datanode

* add links to Mongo upgrade docs

* more upgrade guidance

---------

Co-authored-by: Anton Ebel <anton.ebel@graylog.com>
This commit is contained in:
Patrick Mann
2025-09-19 18:33:00 +02:00
committed by GitHub
parent d6d7dffdba
commit 8ff1300a42
9 changed files with 23 additions and 34 deletions

View File

@@ -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

View File

@@ -0,0 +1,5 @@
type = "c"
message = "Minimum required version of MongoDB is now raised to 7.0."
issues = ["23448"]
pulls = [""]

View File

@@ -8,7 +8,7 @@ version: "3.8"
services:
mongodb:
hostname: "mongodb"
image: "mongo:5.0"
image: "mongo:7.0"
ports:
- "27017:27017"
volumes:

View File

@@ -8,7 +8,7 @@ version: "3.8"
services:
mongodb:
hostname: "mongodb"
image: "mongo:5.0"
image: "mongo:7.0"
ports:
- "27017:27017"
volumes:

View File

@@ -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");

View File

@@ -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;

View File

@@ -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 {};

View File

@@ -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
* <http://www.mongodb.com/licensing/server-side-public-license>.
*/
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);
}

View File

@@ -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");
}
}