diff --git a/conf/nebula-graphd.conf.default b/conf/nebula-graphd.conf.default index 8ec1e6129da..919f94d7f5c 100644 --- a/conf/nebula-graphd.conf.default +++ b/conf/nebula-graphd.conf.default @@ -90,3 +90,9 @@ ########## experimental feature ########## # if use experimental features --enable_experimental_feature=false + +# if use toss feature, only work if enable_experimental_feature is true +--enable_toss=false + +# if use balance data feature, only work if enable_experimental_feature is true +--enable_data_balance=true diff --git a/conf/nebula-graphd.conf.production b/conf/nebula-graphd.conf.production index 538231bd679..b79c9d4dba4 100644 --- a/conf/nebula-graphd.conf.production +++ b/conf/nebula-graphd.conf.production @@ -90,6 +90,12 @@ # if use experimental features --enable_experimental_feature=false +# if use toss feature, only work if enable_experimental_feature is true +--enable_toss=false + +# if use balance data feature, only work if enable_experimental_feature is true +--enable_data_balance=true + ########## session ########## # Maximum number of sessions that can be created per IP and per user --max_sessions_per_ip_per_user=300 diff --git a/conf/nebula-standalone.conf.default b/conf/nebula-standalone.conf.default index a735ab3cf3a..8e7b9ad7702 100644 --- a/conf/nebula-standalone.conf.default +++ b/conf/nebula-standalone.conf.default @@ -92,6 +92,12 @@ # if use experimental features --enable_experimental_feature=false +# if use toss feature, only work if enable_experimental_feature is true +--enable_toss=false + +# if use balance data feature, only work if enable_experimental_feature is true +--enable_data_balance=true + ######### Raft ######### # Raft election timeout --raft_heartbeat_interval_secs=30 diff --git a/src/graph/executor/mutate/DeleteExecutor.cpp b/src/graph/executor/mutate/DeleteExecutor.cpp index b3df2670e68..4377b95b2b0 100644 --- a/src/graph/executor/mutate/DeleteExecutor.cpp +++ b/src/graph/executor/mutate/DeleteExecutor.cpp @@ -200,7 +200,7 @@ folly::Future DeleteEdgesExecutor::deleteEdges() { auto plan = qctx()->plan(); StorageClient::CommonRequestParam param( spaceId, qctx()->rctx()->session()->id(), plan->id(), plan->isProfileEnabled()); - param.useExperimentalFeature = FLAGS_enable_experimental_feature; + param.useExperimentalFeature = FLAGS_enable_experimental_feature && FLAGS_enable_toss; return qctx() ->getStorageClient() ->deleteEdges(param, std::move(edgeKeys)) diff --git a/src/graph/executor/mutate/InsertExecutor.cpp b/src/graph/executor/mutate/InsertExecutor.cpp index 2b082c35d97..2375d5e35c5 100644 --- a/src/graph/executor/mutate/InsertExecutor.cpp +++ b/src/graph/executor/mutate/InsertExecutor.cpp @@ -54,7 +54,7 @@ folly::Future InsertEdgesExecutor::insertEdges() { auto plan = qctx()->plan(); StorageClient::CommonRequestParam param( ieNode->getSpace(), qctx()->rctx()->session()->id(), plan->id(), plan->isProfileEnabled()); - param.useExperimentalFeature = FLAGS_enable_experimental_feature; + param.useExperimentalFeature = FLAGS_enable_experimental_feature && FLAGS_enable_toss; return qctx() ->getStorageClient() ->addEdges(param, diff --git a/src/graph/executor/mutate/UpdateExecutor.cpp b/src/graph/executor/mutate/UpdateExecutor.cpp index 63e774b22d0..ac331b10375 100644 --- a/src/graph/executor/mutate/UpdateExecutor.cpp +++ b/src/graph/executor/mutate/UpdateExecutor.cpp @@ -98,7 +98,7 @@ folly::Future UpdateEdgeExecutor::execute() { auto plan = qctx()->plan(); StorageClient::CommonRequestParam param( ueNode->getSpaceId(), qctx()->rctx()->session()->id(), plan->id(), plan->isProfileEnabled()); - param.useExperimentalFeature = FLAGS_enable_experimental_feature; + param.useExperimentalFeature = FLAGS_enable_experimental_feature && FLAGS_enable_toss; return qctx() ->getStorageClient() ->updateEdge(param, diff --git a/src/graph/service/GraphFlags.cpp b/src/graph/service/GraphFlags.cpp index 5ea5fbc1ad3..f34cc55a857 100644 --- a/src/graph/service/GraphFlags.cpp +++ b/src/graph/service/GraphFlags.cpp @@ -70,6 +70,8 @@ DEFINE_bool(disable_octal_escape_char, " in next version to ensure compatibility with cypher."); DEFINE_bool(enable_experimental_feature, false, "Whether to enable experimental feature"); +DEFINE_bool(enable_toss, false, "Whether to enable toss feature"); +DEFINE_bool(enable_data_balance, true, "Whether to enable data balance feature"); DEFINE_int32(num_rows_to_check_memory, 1024, "number rows to check memory"); DEFINE_int32(max_sessions_per_ip_per_user, diff --git a/src/graph/service/GraphFlags.h b/src/graph/service/GraphFlags.h index f2c7ecf9c75..0160df6c996 100644 --- a/src/graph/service/GraphFlags.h +++ b/src/graph/service/GraphFlags.h @@ -54,6 +54,8 @@ DECLARE_bool(optimize_appendvertice); DECLARE_int64(max_allowed_connections); DECLARE_bool(enable_experimental_feature); +DECLARE_bool(enable_toss); +DECLARE_bool(enable_data_balance); DECLARE_bool(enable_client_white_list); DECLARE_string(client_white_list); diff --git a/src/graph/validator/AdminJobValidator.cpp b/src/graph/validator/AdminJobValidator.cpp index c1b8ae2fad6..5e7d6b635d5 100644 --- a/src/graph/validator/AdminJobValidator.cpp +++ b/src/graph/validator/AdminJobValidator.cpp @@ -6,6 +6,7 @@ #include "graph/validator/AdminJobValidator.h" #include "graph/planner/plan/Admin.h" +#include "graph/service/GraphFlags.h" namespace nebula { namespace graph { @@ -13,7 +14,7 @@ namespace graph { Status AdminJobValidator::validateImpl() { if (sentence_->getJobType() == meta::cpp2::JobType::DATA_BALANCE || sentence_->getJobType() == meta::cpp2::JobType::ZONE_BALANCE) { - if (!FLAGS_enable_experimental_feature) { + if (!(FLAGS_enable_experimental_feature && FLAGS_enable_data_balance)) { return Status::SemanticError("Data balance not support"); } } diff --git a/src/graph/validator/MutateValidator.cpp b/src/graph/validator/MutateValidator.cpp index 41f1f6fb14f..d97323f239e 100644 --- a/src/graph/validator/MutateValidator.cpp +++ b/src/graph/validator/MutateValidator.cpp @@ -206,7 +206,8 @@ Status InsertEdgesValidator::check() { // Check validity of vertices data. // Check edge key type, check properties value, fill to NewEdge structure. Status InsertEdgesValidator::prepareEdges() { - auto size = FLAGS_enable_experimental_feature ? rows_.size() : rows_.size() * 2; + auto size = + FLAGS_enable_experimental_feature && FLAGS_enable_toss ? rows_.size() : rows_.size() * 2; edges_.reserve(size); size_t fieldNum = schema_->getNumFields(); @@ -291,7 +292,7 @@ Status InsertEdgesValidator::prepareEdges() { edge.key_ref() = key; edge.props_ref() = std::move(entirePropValues); edges_.emplace_back(edge); - if (!FLAGS_enable_experimental_feature) { + if (!(FLAGS_enable_experimental_feature && FLAGS_enable_toss)) { // inbound key.src_ref() = dstId; key.dst_ref() = srcId; @@ -826,7 +827,7 @@ Status UpdateEdgeValidator::toPlan() { {}, condition_, {}); - if (FLAGS_enable_experimental_feature) { + if ((FLAGS_enable_experimental_feature && FLAGS_enable_toss)) { root_ = outNode; tail_ = root_; } else {