未验证 提交 2f7e99b1 编写于 作者: X Xiangpeng Hu 提交者: GitHub

[IOTDB-6139] Refine Ratis Properties (#11047)

上级 66206461
......@@ -220,8 +220,6 @@ public class ConfigNodeConfig {
/** RatisConsensus protocol, allow flushing Raft Log asynchronously. */
private boolean dataRegionRatisLogUnsafeFlushEnable = false;
private int dataRegionRatisLogForceSyncNum = 128;
private boolean configNodeRatisLogUnsafeFlushEnable = false;
private boolean schemaRegionRatisLogUnsafeFlushEnable = false;
......@@ -235,8 +233,14 @@ public class ConfigNodeConfig {
/** RatisConsensus protocol, flow control window for ratis grpc log appender. */
private long dataRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
private int configNodeRatisGrpcLeaderOutstandingAppendsMax = 128;
private int schemaRegionRatisGrpcLeaderOutstandingAppendsMax = 128;
private int dataRegionRatisGrpcLeaderOutstandingAppendsMax = 128;
private int configNodeRatisLogForceSyncNum = 128;
private int schemaRegionRatisLogForceSyncNum = 128;
private int dataRegionRatisLogForceSyncNum = 128;
private long configNodeRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
private long schemaRegionRatisGrpcFlowControlWindow = 4 * 1024 * 1024L;
......@@ -753,6 +757,22 @@ public class ConfigNodeConfig {
this.dataRegionRatisLogUnsafeFlushEnable = dataRegionRatisLogUnsafeFlushEnable;
}
public int getConfigNodeRatisLogForceSyncNum() {
return configNodeRatisLogForceSyncNum;
}
public void setConfigNodeRatisLogForceSyncNum(int configNodeRatisLogForceSyncNum) {
this.configNodeRatisLogForceSyncNum = configNodeRatisLogForceSyncNum;
}
public int getSchemaRegionRatisLogForceSyncNum() {
return schemaRegionRatisLogForceSyncNum;
}
public void setSchemaRegionRatisLogForceSyncNum(int schemaRegionRatisLogForceSyncNum) {
this.schemaRegionRatisLogForceSyncNum = schemaRegionRatisLogForceSyncNum;
}
public int getDataRegionRatisLogForceSyncNum() {
return dataRegionRatisLogForceSyncNum;
}
......@@ -777,6 +797,26 @@ public class ConfigNodeConfig {
this.dataRegionRatisGrpcFlowControlWindow = dataRegionRatisGrpcFlowControlWindow;
}
public int getConfigNodeRatisGrpcLeaderOutstandingAppendsMax() {
return configNodeRatisGrpcLeaderOutstandingAppendsMax;
}
public void setConfigNodeRatisGrpcLeaderOutstandingAppendsMax(
int configNodeRatisGrpcLeaderOutstandingAppendsMax) {
this.configNodeRatisGrpcLeaderOutstandingAppendsMax =
configNodeRatisGrpcLeaderOutstandingAppendsMax;
}
public int getSchemaRegionRatisGrpcLeaderOutstandingAppendsMax() {
return schemaRegionRatisGrpcLeaderOutstandingAppendsMax;
}
public void setSchemaRegionRatisGrpcLeaderOutstandingAppendsMax(
int schemaRegionRatisGrpcLeaderOutstandingAppendsMax) {
this.schemaRegionRatisGrpcLeaderOutstandingAppendsMax =
schemaRegionRatisGrpcLeaderOutstandingAppendsMax;
}
public int getDataRegionRatisGrpcLeaderOutstandingAppendsMax() {
return dataRegionRatisGrpcLeaderOutstandingAppendsMax;
}
......
......@@ -479,14 +479,6 @@ public class ConfigNodeDescriptor {
String.valueOf(conf.isDataRegionRatisLogUnsafeFlushEnable()))
.trim()));
conf.setDataRegionRatisLogForceSyncNum(
Integer.parseInt(
properties
.getProperty(
"data_region_ratis_log_force_sync_num",
String.valueOf(conf.getDataRegionRatisLogForceSyncNum()))
.trim()));
conf.setConfigNodeRatisLogUnsafeFlushEnable(
Boolean.parseBoolean(
properties
......@@ -567,6 +559,46 @@ public class ConfigNodeDescriptor {
String.valueOf(conf.getDataRegionRatisGrpcLeaderOutstandingAppendsMax()))
.trim()));
conf.setConfigNodeRatisGrpcLeaderOutstandingAppendsMax(
Integer.parseInt(
properties
.getProperty(
"config_node_ratis_grpc_leader_outstanding_appends_max",
String.valueOf(conf.getConfigNodeRatisGrpcLeaderOutstandingAppendsMax()))
.trim()));
conf.setSchemaRegionRatisGrpcLeaderOutstandingAppendsMax(
Integer.parseInt(
properties
.getProperty(
"schema_region_ratis_grpc_leader_outstanding_appends_max",
String.valueOf(conf.getSchemaRegionRatisGrpcLeaderOutstandingAppendsMax()))
.trim()));
conf.setDataRegionRatisLogForceSyncNum(
Integer.parseInt(
properties
.getProperty(
"data_region_ratis_log_force_sync_num",
String.valueOf(conf.getDataRegionRatisLogForceSyncNum()))
.trim()));
conf.setConfigNodeRatisLogForceSyncNum(
Integer.parseInt(
properties
.getProperty(
"config_node_ratis_log_force_sync_num",
String.valueOf(conf.getConfigNodeRatisLogForceSyncNum()))
.trim()));
conf.setSchemaRegionRatisLogForceSyncNum(
Integer.parseInt(
properties
.getProperty(
"schema_region_ratis_log_force_sync_num",
String.valueOf(conf.getSchemaRegionRatisLogForceSyncNum()))
.trim()));
conf.setDataRegionRatisRpcLeaderElectionTimeoutMinMs(
Long.parseLong(
properties
......
......@@ -128,6 +128,7 @@ public class ConsensusManager {
RatisConfig.Log.newBuilder()
.setUnsafeFlushEnabled(
CONF.isConfigNodeRatisLogUnsafeFlushEnable())
.setForceSyncNum(CONF.getConfigNodeRatisLogForceSyncNum())
.setSegmentCacheSizeMax(
SizeInBytes.valueOf(
CONF.getConfigNodeRatisLogSegmentSizeMax()))
......@@ -139,6 +140,8 @@ public class ConsensusManager {
.setFlowControlWindow(
SizeInBytes.valueOf(
CONF.getConfigNodeRatisGrpcFlowControlWindow()))
.setLeaderOutstandingAppendsMax(
CONF.getConfigNodeRatisGrpcLeaderOutstandingAppendsMax())
.build())
.setRpc(
RatisConfig.Rpc.newBuilder()
......
......@@ -165,7 +165,6 @@ public class NodeManager {
ratisConfig.setDataLogUnsafeFlushEnable(conf.isDataRegionRatisLogUnsafeFlushEnable());
ratisConfig.setSchemaLogUnsafeFlushEnable(conf.isSchemaRegionRatisLogUnsafeFlushEnable());
ratisConfig.setDataRegionLogForceSyncNum(conf.getDataRegionRatisLogForceSyncNum());
ratisConfig.setDataLogSegmentSizeMax(conf.getDataRegionRatisLogSegmentSizeMax());
ratisConfig.setSchemaLogSegmentSizeMax(conf.getSchemaRegionRatisLogSegmentSizeMax());
......@@ -174,6 +173,11 @@ public class NodeManager {
ratisConfig.setSchemaGrpcFlowControlWindow(conf.getSchemaRegionRatisGrpcFlowControlWindow());
ratisConfig.setDataRegionGrpcLeaderOutstandingAppendsMax(
conf.getDataRegionRatisGrpcLeaderOutstandingAppendsMax());
ratisConfig.setSchemaRegionGrpcLeaderOutstandingAppendsMax(
conf.getSchemaRegionRatisGrpcLeaderOutstandingAppendsMax());
ratisConfig.setDataRegionLogForceSyncNum(conf.getDataRegionRatisLogForceSyncNum());
ratisConfig.setSchemaRegionLogForceSyncNum(conf.getSchemaRegionRatisLogForceSyncNum());
ratisConfig.setDataLeaderElectionTimeoutMin(
conf.getDataRegionRatisRpcLeaderElectionTimeoutMinMs());
......
......@@ -1008,6 +1008,7 @@ public class IoTDBConfig {
private boolean schemaRatisConsensusLogUnsafeFlushEnable = false;
private int dataRatisConsensusLogForceSyncNum = 128;
private int schemaRatisConsensusLogForceSyncNum = 128;
private long dataRatisConsensusLogSegmentSizeMax = 24 * 1024 * 1024L;
private long schemaRatisConsensusLogSegmentSizeMax = 24 * 1024 * 1024L;
......@@ -1017,6 +1018,8 @@ public class IoTDBConfig {
private int dataRatisConsensusGrpcLeaderOutstandingAppendsMax = 128;
private int schemaRatisConsensusGrpcLeaderOutstandingAppendsMax = 128;
private long dataRatisConsensusLeaderElectionTimeoutMinMs = 2000L;
private long schemaRatisConsensusLeaderElectionTimeoutMinMs = 2000L;
......@@ -3375,6 +3378,14 @@ public class IoTDBConfig {
this.dataRatisConsensusLogForceSyncNum = dataRatisConsensusLogForceSyncNum;
}
public int getSchemaRatisConsensusLogForceSyncNum() {
return schemaRatisConsensusLogForceSyncNum;
}
public void setSchemaRatisConsensusLogForceSyncNum(int schemaRatisConsensusLogForceSyncNum) {
this.schemaRatisConsensusLogForceSyncNum = schemaRatisConsensusLogForceSyncNum;
}
public long getDataRatisConsensusLogSegmentSizeMax() {
return dataRatisConsensusLogSegmentSizeMax;
}
......@@ -3402,6 +3413,16 @@ public class IoTDBConfig {
dataRatisConsensusGrpcLeaderOutstandingAppendsMax;
}
public int getSchemaRatisConsensusGrpcLeaderOutstandingAppendsMax() {
return schemaRatisConsensusGrpcLeaderOutstandingAppendsMax;
}
public void setSchemaRatisConsensusGrpcLeaderOutstandingAppendsMax(
int schemaRatisConsensusGrpcLeaderOutstandingAppendsMax) {
this.schemaRatisConsensusGrpcLeaderOutstandingAppendsMax =
schemaRatisConsensusGrpcLeaderOutstandingAppendsMax;
}
public long getDataRatisConsensusLeaderElectionTimeoutMinMs() {
return dataRatisConsensusLeaderElectionTimeoutMinMs;
}
......
......@@ -2109,15 +2109,20 @@ public class IoTDBDescriptor {
conf.setDataRatisConsensusLogUnsafeFlushEnable(ratisConfig.isDataLogUnsafeFlushEnable());
conf.setSchemaRatisConsensusLogUnsafeFlushEnable(ratisConfig.isSchemaLogUnsafeFlushEnable());
conf.setDataRatisConsensusLogForceSyncNum(ratisConfig.getDataRegionLogForceSyncNum());
conf.setSchemaRatisConsensusLogForceSyncNum(ratisConfig.getSchemaRegionLogForceSyncNum());
conf.setDataRatisConsensusLogSegmentSizeMax(ratisConfig.getDataLogSegmentSizeMax());
conf.setSchemaRatisConsensusLogSegmentSizeMax(ratisConfig.getSchemaLogSegmentSizeMax());
conf.setDataRatisConsensusGrpcFlowControlWindow(ratisConfig.getDataGrpcFlowControlWindow());
conf.setSchemaRatisConsensusGrpcFlowControlWindow(ratisConfig.getSchemaGrpcFlowControlWindow());
conf.setDataRatisConsensusGrpcLeaderOutstandingAppendsMax(
ratisConfig.getDataRegionGrpcLeaderOutstandingAppendsMax());
conf.setSchemaRatisConsensusGrpcLeaderOutstandingAppendsMax(
ratisConfig.getSchemaRegionGrpcLeaderOutstandingAppendsMax());
conf.setDataRatisConsensusLeaderElectionTimeoutMinMs(
ratisConfig.getDataLeaderElectionTimeoutMin());
......
......@@ -73,6 +73,7 @@ public class SchemaRegionConsensusImpl {
RatisConfig.Log.newBuilder()
.setUnsafeFlushEnabled(
CONF.isSchemaRatisConsensusLogUnsafeFlushEnable())
.setForceSyncNum(CONF.getSchemaRatisConsensusLogForceSyncNum())
.setSegmentSizeMax(
SizeInBytes.valueOf(
CONF.getSchemaRatisConsensusLogSegmentSizeMax()))
......@@ -84,6 +85,9 @@ public class SchemaRegionConsensusImpl {
.setFlowControlWindow(
SizeInBytes.valueOf(
CONF.getSchemaRatisConsensusGrpcFlowControlWindow()))
.setLeaderOutstandingAppendsMax(
CONF
.getSchemaRatisConsensusGrpcLeaderOutstandingAppendsMax())
.build())
.setRpc(
RatisConfig.Rpc.newBuilder()
......
......@@ -984,7 +984,11 @@ cluster_name=defaultCluster
# config_node_ratis_grpc_flow_control_window=4194304
# schema_region_ratis_grpc_flow_control_window=4194304
# data_region_ratis_grpc_flow_control_window=4194304
# config_node_ratis_grpc_leader_outstanding_appends_max=128
# schema_region_ratis_grpc_leader_outstanding_appends_max=128
# data_region_ratis_grpc_leader_outstanding_appends_max=128
# config_node_ratis_log_force_sync_num=128
# schema_region_ratis_log_force_sync_num=128
# data_region_ratis_log_force_sync_num=128
# min election timeout for leader election
......
......@@ -85,6 +85,9 @@ struct TRatisConfig {
29: required i32 dataRegionGrpcLeaderOutstandingAppendsMax
30: required i32 dataRegionLogForceSyncNum
31: required i32 schemaRegionGrpcLeaderOutstandingAppendsMax
32: required i32 schemaRegionLogForceSyncNum
}
struct TCQConfig {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册