Avoid serializing empty _source fields in mappings. (#122606)

This commit is contained in:
Martijn van Groningen 2025-03-06 12:20:07 +01:00 committed by GitHub
parent 387eef070c
commit ea8283e9c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 157 additions and 73 deletions

View file

@ -19,13 +19,23 @@ import org.junit.ClassRule;
public class MixedClusterDownsampleRestIT extends ESClientYamlSuiteTestCase {
@ClassRule
public static ElasticsearchCluster cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.withNode(node -> node.version(getOldVersion()))
.withNode(node -> node.version(Version.CURRENT))
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial")
.build();
public static ElasticsearchCluster cluster = buildCluster();
private static ElasticsearchCluster buildCluster() {
Version oldVersion = getOldVersion();
var cluster = ElasticsearchCluster.local()
.distribution(DistributionType.DEFAULT)
.withNode(node -> node.version(getOldVersion()))
.withNode(node -> node.version(Version.CURRENT))
.setting("xpack.security.enabled", "false")
.setting("xpack.license.self_generated.type", "trial");
if (oldVersion.before(Version.fromString("9.1.0"))) {
cluster.jvmArg("-da:org.elasticsearch.index.mapper.DocumentMapper");
cluster.jvmArg("-da:org.elasticsearch.index.mapper.MapperService");
}
return cluster.build();
}
static Version getOldVersion() {
return Version.fromString(System.getProperty("tests.old_cluster_version"));