@@ -151,6 +151,7 @@ qa_task: | |||
QA_CATEGORY: License | |||
QA_CATEGORY: Branch | |||
QA_CATEGORY: Upgrade | |||
QA_CATEGORY: HA | |||
gradle_cache: | |||
folder: ~/.gradle/caches | |||
script: |
@@ -160,6 +160,7 @@ subprojects { | |||
dependency 'junit:junit:4.12' | |||
dependency 'mysql:mysql-connector-java:5.1.46' | |||
dependency 'net.jpountz.lz4:lz4:1.3.0' | |||
dependency 'org.awaitility:awaitility:3.1.6' | |||
dependency 'org.apache.commons:commons-csv:1.4' | |||
dependency 'org.apache.commons:commons-email:1.5' | |||
dependency 'org.apache.commons:commons-dbcp2:2.5.0' |
@@ -45,6 +45,7 @@ public class EsSettings { | |||
private static final Logger LOGGER = LoggerFactory.getLogger(EsSettings.class); | |||
private static final String STANDALONE_NODE_NAME = "sonarqube"; | |||
private static final String SECCOMP_PROPERTY = "bootstrap.system_call_filter"; | |||
private static final String ALLOW_MMAP = "node.store.allow_mmapfs"; | |||
private final Props props; | |||
private final EsInstallation fileSystem; | |||
@@ -151,5 +152,10 @@ public class EsSettings { | |||
if (props.value("sonar.search.javaAdditionalOpts", "").contains("-D" + SECCOMP_PROPERTY + "=false")) { | |||
builder.put(SECCOMP_PROPERTY, "false"); | |||
} | |||
// to be used with HA QA, where we can't easily set mmap size when running with docker. | |||
if (props.value("sonar.search.javaAdditionalOpts", "").contains("-D" + ALLOW_MMAP + "=false")) { | |||
builder.put(ALLOW_MMAP, "false"); | |||
} | |||
} | |||
} |
@@ -330,6 +330,15 @@ public class EsSettingsTest { | |||
assertThat(settings.get("bootstrap.system_call_filter")).isEqualTo("false"); | |||
} | |||
@Test | |||
public void disable_mmap_if_configured_in_search_additional_props() throws Exception { | |||
Props props = minProps(CLUSTER_DISABLED); | |||
props.set("sonar.search.javaAdditionalOpts", "-Dnode.store.allow_mmapfs=false"); | |||
Map<String, String> settings = new EsSettings(props, new EsInstallation(props), System2.INSTANCE).build(); | |||
assertThat(settings.get("node.store.allow_mmapfs")).isEqualTo("false"); | |||
} | |||
private Props minProps(boolean cluster) throws IOException { | |||
File homeDir = temp.newFolder(); | |||
Props props = new Props(new Properties()); |