morningman commented on code in PR #61199:
URL: https://github.com/apache/doris/pull/61199#discussion_r2968297779
##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -3353,6 +3353,58 @@ public static int metaServiceRpcRetryTimes() {
@ConfField(mutable = true, masterOnly = true)
public static long mow_get_ms_lock_retry_backoff_interval = 80;
+ @ConfField(mutable = true, masterOnly = true, description = {
+ "是否启用TSO功能",
Review Comment:
We just removed all Chinese description this week.
Please remove also
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java:
##########
@@ -595,6 +597,9 @@ public class Env {
private final Map<String, Supplier<MasterDaemon>> configtoThreads =
ImmutableMap
.of("dynamic_partition_check_interval_seconds",
this::getDynamicPartitionScheduler);
+ private AtomicLong windowEndTSO = new AtomicLong(0);
Review Comment:
Can we move `windowEndTSO` into `TSOService`? To make Env clean
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/TableCommitInfo.java:
##########
@@ -39,6 +39,8 @@ public class TableCommitInfo {
private long version;
@SerializedName(value = "versionTime")
private long versionTime;
+ @SerializedName(value = "commitTSO")
Review Comment:
use abbr like `value = "ctso"`
##########
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java:
##########
@@ -1698,6 +1720,9 @@ protected void
unprotectedCommitTransaction2PC(TransactionState transactionState
transactionState);
continue;
}
+ if (Config.enable_feature_tso && table.enableTso()) {
Review Comment:
Can we first set `enable_feature_tso` to true,
And then disable it later? Will there be any problem?
##########
regression-test/suites/tso_p0/test_tso_api.groovy:
##########
@@ -0,0 +1,111 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.apache.doris.regression.util.Http
+import groovy.json.JsonSlurper
+
+suite("test_tso_api", "nonConcurrent") {
+ def ret = sql "SHOW FRONTEND CONFIG like
'%experimental_enable_feature_tso%';"
+ logger.info("${ret}")
+ try {
+ sql "ADMIN SET FRONTEND CONFIG ('experimental_enable_feature_tso' =
'true')"
+ sleep(1000)
+ def currentTime = System.currentTimeMillis()
+
+ // Test TSO API endpoint
+ def url = String.format("http://%s/api/tso",
context.config.feHttpAddress)
Review Comment:
Will this be forwarded to Master FE?
This case will also be run in Multi FE cluster.
##########
fe/fe-common/src/main/java/org/apache/doris/common/Config.java:
##########
@@ -3353,6 +3353,58 @@ public static int metaServiceRpcRetryTimes() {
@ConfField(mutable = true, masterOnly = true)
public static long mow_get_ms_lock_retry_backoff_interval = 80;
+ @ConfField(mutable = true, masterOnly = true, description = {
+ "是否启用TSO功能",
+ "Whether to enable TSO"}, varType =
VariableAnnotation.EXPERIMENTAL)
+ public static boolean enable_feature_tso = false;
+
+ @ConfField(mutable = false, masterOnly = true, description = {
+ "TSO服务的更新间隔,单位为毫秒。默认值为50,表示TSO服务每隔50毫秒执行一次时间戳更新检查。",
+ "TSO service update interval in milliseconds. Default is 50, which
means the TSO service "
+ + "will perform timestamp update checks every 50
milliseconds."})
+ public static int tso_service_update_interval_ms = 50;
+
+ @ConfField(mutable = true, masterOnly = true, description = {
+ "TSO服务最大重试次数,默认值为3,表示TSO服务最多重试3次更新全局时间戳。",
+ "TSO service max retry count. Default is 3, which means the TSO
service will retry 3 times"
+ + "to update the global timestamp."})
+ public static int max_update_tso_retry_count = 3;
+
+ @ConfField(mutable = true, masterOnly = true, description = {
+ "TSO获取最大重试次数,默认值为10,表示TSO服务最多重试10次生成TSO。",
+ "TSO get max retry count. Default is 10, which means the TSO
service will retry 10 times"
+ + "to generate TSO."})
+ public static int max_get_tso_retry_count = 10;
Review Comment:
I suggest all tso related config named as "tso_xxx"? except for
`enable_tso_xxx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]