[fuzztest](fe session variable) add fuzzy test config for fe session variables. (#14272)

Many feature in fe session variable is disabled by default. So that these features do not pass github workflow test actually. I add a fuzzy test config in fe.conf. If it is set to true, then we will use fuzzy session variables for every connection so that every feature developer could set fuzzy values for its config.



Co-authored-by: yiguolei <yiguolei@gmail.com>
This commit is contained in:
yiguolei
2022-11-15 15:43:21 +08:00
committed by GitHub
parent f86886f8f5
commit 87544a017f
3 changed files with 21 additions and 0 deletions

View File

@ -1894,5 +1894,11 @@ public class Config extends ConfigBase {
*/
@ConfField(mutable = false, masterOnly = false)
public static long external_cache_expire_time_minutes_after_access = 24 * 60; // 1 day
/**
* Set session variables randomly to check more issues in github workflow
*/
@ConfField(mutable = true, masterOnly = false)
public static boolean use_fuzzy_session_variable = false;
}

View File

@ -21,6 +21,7 @@ import org.apache.doris.analysis.UserIdentity;
import org.apache.doris.catalog.DatabaseIf;
import org.apache.doris.catalog.Env;
import org.apache.doris.cluster.ClusterNamespace;
import org.apache.doris.common.Config;
import org.apache.doris.common.UserException;
import org.apache.doris.common.telemetry.Telemetry;
import org.apache.doris.common.util.DebugUtil;
@ -213,6 +214,9 @@ public class ConnectContext {
remoteIP = mysqlChannel.getRemoteIp();
}
queryDetail = null;
if (Config.use_fuzzy_session_variable) {
sessionVariable.initFuzzyModeVariables();
}
}
public boolean isTxnModel() {

View File

@ -38,6 +38,7 @@ import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
/**
* System variable.
@ -588,6 +589,16 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = INTERNAL_SESSION)
public boolean internalSession = false;
// If this fe is in fuzzy mode, then will use initFuzzyModeVariables to generate some variables,
// not the default value set in the code.
public void initFuzzyModeVariables() {
Random random = new Random();
this.parallelExecInstanceNum = random.nextInt(8) + 1;
this.enableLocalExchange = random.nextBoolean();
this.disableJoinReorder = random.nextBoolean();
this.disableStreamPreaggregations = random.nextBoolean();
}
public String getBlockEncryptionMode() {
return blockEncryptionMode;
}