Skip to content

Commit

Permalink
[fix](cluster key) support fuzzy random_add_cluster_keys_for_mow conf…
Browse files Browse the repository at this point in the history
…ig (#44485)

support fuzzy set fe config for `random_add_cluster_keys_for_mow` by
add:
```
use_fuzzy_conf=true
fuzzy_test_type=daily or rqg
```
  • Loading branch information
mymeiyi authored Nov 22, 2024
1 parent 6a31e0c commit 2753b70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,7 @@ public class Config extends ConfigBase {
* only for certain test type. E.g. only settting batch_size to small
* value for p0.
*/
@ConfField(mutable = true, masterOnly = false, options = {"p0"})
@ConfField(mutable = true, masterOnly = false, options = {"p0", "daily", "rqg"})
public static String fuzzy_test_type = "";

/**
Expand All @@ -2189,6 +2189,12 @@ public class Config extends ConfigBase {
@ConfField(mutable = true, masterOnly = false)
public static boolean use_fuzzy_session_variable = false;

/**
* Set config variables randomly to check more issues in github workflow
*/
@ConfField(mutable = true, masterOnly = false)
public static boolean use_fuzzy_conf = false;

/**
* Max num of same name meta informatntion in catalog recycle bin.
* Default is 3.
Expand Down
13 changes: 13 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/DorisFE.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.nio.file.StandardOpenOption;
import java.time.LocalDate;
import java.util.concurrent.TimeUnit;

public class DorisFE {
Expand Down Expand Up @@ -162,6 +163,8 @@ public static void start(String dorisHomeDir, String pidDir, String[] args, Star
System.exit(-1);
}

fuzzyConfigs();

LOG.info("Doris FE starting...");

FrontendOptions.init();
Expand Down Expand Up @@ -529,6 +532,16 @@ public static void overwriteConfigs() {
}
}

private static void fuzzyConfigs() {
if (!Config.use_fuzzy_conf) {
return;
}
if (Config.fuzzy_test_type.equalsIgnoreCase("daily") || Config.fuzzy_test_type.equalsIgnoreCase("rqg")) {
Config.random_add_cluster_keys_for_mow = (LocalDate.now().getDayOfMonth() % 2 == 0);
LOG.info("fuzzy set random_add_cluster_keys_for_mow={}", Config.random_add_cluster_keys_for_mow);
}
}

public static class StartupOptions {
public boolean enableHttpServer = true;
public boolean enableQeService = true;
Expand Down

0 comments on commit 2753b70

Please sign in to comment.