You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/11/27 02:01:22 UTC

[iotdb] branch master updated: Change default consensus (#8194)

This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 93b875c98e Change default consensus (#8194)
93b875c98e is described below

commit 93b875c98e76cfa680895cb665868d99f117427a
Author: Jialin Qiao <qj...@mails.tsinghua.edu.cn>
AuthorDate: Sun Nov 27 10:01:16 2022 +0800

    Change default consensus (#8194)
---
 .../iotdb/confignode/conf/ConfigNodeConfig.java    |  8 ++++----
 docs/UserGuide/Monitor-Alert/Metric-Tool.md        | 24 +++++++++++-----------
 docs/UserGuide/Reference/Common-Config-Manual.md   | 12 +++++------
 docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md     | 22 ++++++++++----------
 .../zh/UserGuide/Reference/Common-Config-Manual.md |  6 +++---
 .../Apache IoTDB DataNode Dashboard v0.14.0.json   | 18 ++++++++--------
 .../resources/conf/iotdb-common.properties         |  8 ++++----
 7 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index 243f7a86b1..98d37ba2e4 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -53,14 +53,14 @@ public class ConfigNodeConfig {
   /** ConfigNodeGroup consensus protocol */
   private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
 
-  /** DataNode schema region consensus protocol */
-  private String schemaRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
+  /** Schema region consensus protocol */
+  private String schemaRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
 
   /** The maximum number of SchemaRegion expected to be managed by each DataNode. */
   private double schemaRegionPerDataNode = 1.0;
 
-  /** DataNode data region consensus protocol */
-  private String dataRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
+  /** Data region consensus protocol */
+  private String dataRegionConsensusProtocolClass = ConsensusFactory.IOT_CONSENSUS;
 
   /** The maximum number of DataRegion expected to be managed by each DataNode. */
   private double dataRegionPerProcessor = 0.5;
diff --git a/docs/UserGuide/Monitor-Alert/Metric-Tool.md b/docs/UserGuide/Monitor-Alert/Metric-Tool.md
index f35ce9d50d..3a8a676ad6 100644
--- a/docs/UserGuide/Monitor-Alert/Metric-Tool.md
+++ b/docs/UserGuide/Monitor-Alert/Metric-Tool.md
@@ -127,13 +127,13 @@ Core-level metrics are enabled by default during system operation. The addition
 | region   | name="{{ip}}:{{port}}",type="SchemaRegion" | Gauge     | The number of SchemaRegion in PartitionTable of specific node |
 | region   | name="{{ip}}:{{port}}",type="DataRegion"   | Gauge     | The number of DataRegion in PartitionTable of specific node   |
 
-### 4.2.3. MultiLeader
+### 4.2.3. IoTConsensus
 | Metric       | Tags                                                                                         | Type      | Description                                                           |
 | ------------ | -------------------------------------------------------------------------------------------- | --------- | --------------------------------------------------------------------- |
 | mutli_leader | name="logDispatcher-{{IP}}:{{Port}}", region="{{region}}", type="currentSyncIndex"           | AutoGauge | The sync index of synchronization thread in replica group             |
 | mutli_leader | name="logDispatcher-{{IP}}:{{Port}}", region="{{region}}", type="cachedRequestInMemoryQueue" | AutoGauge | The size of cache requests of synchronization thread in replica group |
-| mutli_leader | name="multiLeaderServerImpl", region="{{region}}", type="searchIndex"                        | AutoGauge | The write process of main process in replica group                    |
-| mutli_leader | name="multiLeaderServerImpl", region="{{region}}", type="safeIndex"                          | AutoGauge | The sync index of replica group                                       |
+| mutli_leader | name="IoTConsensusServerImpl", region="{{region}}", type="searchIndex"                        | AutoGauge | The write process of main process in replica group                    |
+| mutli_leader | name="IoTConsensusServerImpl", region="{{region}}", type="safeIndex"                          | AutoGauge | The sync index of replica group                                       |
 | stage        | name="multi_leader", region="{{region}}", type="getStateMachineLock"                         | Histogram | The time consumed to get statemachine lock in main process            |
 | stage        | name="multi_leader", region="{{region}}", type="checkingBeforeWrite"                         | Histogram | The time consumed to precheck before write in main process            |
 | stage        | name="multi_leader", region="{{region}}", type="writeStateMachine"                           | Histogram | The time consumed to write statemachine in main process               |
@@ -175,7 +175,7 @@ Core-level metrics are enabled by default during system operation. The addition
 | ------ | ----------------------------- | --------- | ------------------------------------------------------------------ |
 | mem    | name="database_{{name}}"      | AutoGauge | The memory usage of DataRegion in DataNode, Unit: byte             |
 | mem    | name="chunkMetaData_{{name}}" | AutoGauge | The memory usage of chunkMetaData when writting TsFile, Unit: byte |
-| mem    | name="MultiLeaderConsensus"   | AutoGauge | The memory usage of MultiLeader consensus, Unit: byte              |
+| mem    | name="IoTConsensus"   | AutoGauge | The memory usage of IoTConsensus, Unit: byte              |
 
 ### 4.2.7. Task
 | Metric    | Tags                                              | Type      | Description                           |
@@ -453,18 +453,18 @@ When creating Grafana, you can select the json file you just downloaded to `Impo
 3. `Engine`:
    1. `Task number (pending and active)`: The number of tasks in different states in the system
    2. `The time consumed of tasking (pending and active)`: The time consumption of tasks in different states in the system
-4. `MultiLeader`:
-   1. `MultiLeader Used Memory`:The size of the memory used by multiLeader consensus
-   2. `MultiLeader Sync Index`:the searchIndex and safeIndex of region
-   3. `MultiLeader Overview`:The total sync lag and total size of buffered requests of node
+4. `IoTConsensus`:
+   1. `IoTConsensus Used Memory`:The size of the memory used by IoTConsensus consensus
+   2. `IoTConsensus Sync Index`:the searchIndex and safeIndex of region
+   3. `IoTConsensus Overview`:The total sync lag and total size of buffered requests of node
    4. `The time consumed of different stages(50%)`:The median  of the time consumed of different stages
    5. `The time consumed of different stages(75%)`:The upper quartile of the time consumed of different stages
    6. `The time consumed of different stages(100%)`:The max of the time consumed of different stages
-   7. `MultiLeader Search Index Rate`:The increasing rate of searchIndex of region
-   8. `MultiLeader Safe Index Rate`:The increasing rate of safeIndex of region
-   9. `MultiLeader LogDispatcher Request Size`:The number of requests buffered in logDispatcher
+   7. `IoTConsensus Search Index Rate`:The increasing rate of searchIndex of region
+   8. `IoTConsensus Safe Index Rate`:The increasing rate of safeIndex of region
+   9. `IoTConsensus LogDispatcher Request Size`:The number of requests buffered in logDispatcher
    10. `Sync Lag`:The sync lag of region
-   11. `Min Peer Sync Lag`:The sync lag between the searchIndex of multiLeaderServerImpl and the max currentSyncIndex of LogDispatcher
+   11. `Min Peer Sync Lag`:The sync lag between the searchIndex of IoTConsensusServerImpl and the max currentSyncIndex of LogDispatcher
    12. `Sync speed diff of Peers`:The sync lag between the max currentSyncIndex of LogDispatcher and the min currentSyncIndex of LogDispatcher
 5. `CPU`:
    1. `CPU Load`:The load of CPU
diff --git a/docs/UserGuide/Reference/Common-Config-Manual.md b/docs/UserGuide/Reference/Common-Config-Manual.md
index d8ead0c7cf..7ece1a4ac3 100644
--- a/docs/UserGuide/Reference/Common-Config-Manual.md
+++ b/docs/UserGuide/Reference/Common-Config-Manual.md
@@ -57,12 +57,12 @@ Trigger way: The client sends the command(sql) `load configuration` to the IoTDB
 
 * schema\_region\_consensus\_protocol\_class
 
-|    Name     | schema\_region\_consensus\_protocol\_class                                                                                                   |
-| :---------: | :------------------------------------------------------------------------------------------------------------------------------------------- |
+|    Name     | schema\_region\_consensus\_protocol\_class             |
+| :---------: | :--------------------------------------: |
 | Description | Consensus protocol of schema replicas, SimpleConsensus could only be used in 1 replica,larger than 1 replicas could only use RatisConsensus |  |
-|    Type     | String                                                                                                                                       |
-|   Default   | org.apache.iotdb.consensus.simple.SimpleConsensus                                                                                            |
-|  Effective  | Only allowed to be modified in first start up                                                                                                |
+|    Type     | String                                                 |
+|   Default   | org.apache.iotdb.consensus.ratis.RatisConsensus      |
+|  Effective  | Only allowed to be modified in first start up         |
 
 * data\_replication\_factor
 
@@ -77,7 +77,7 @@ Trigger way: The client sends the command(sql) `load configuration` to the IoTDB
 
 |    Name     | data\_region\_consensus\_protocol\_class                                                                                                                      |
 | :---------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| Description | Consensus protocol of data replicas, SimpleConsensus could only be used in 1 replica,larger than 1 replicas could use MultiLeaderConsensus or RatisConsensus |
+| Description | Consensus protocol of data replicas, SimpleConsensus could only be used in 1 replica,larger than 1 replicas could use IoTConsensus or RatisConsensus |
 |    Type     | String                                                                                                                                                        |
 |   Default   | org.apache.iotdb.consensus.simple.SimpleConsensus                                                                                                             |
 |  Effective  | Only allowed to be modified in first start up                                                                                                                 |
diff --git a/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md b/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
index 2daec75224..8fcffba986 100644
--- a/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
+++ b/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
@@ -130,13 +130,13 @@ Core 级别的监控指标在系统运行中默认开启,每一个 Core 级别
 | region   | name="{{ip}}:{{port}}",type="SchemaRegion" | Gauge     | 分区表中对应节点上 DataRegion 总数量 |
 | region   | name="{{ip}}:{{port}}",type="DataRegion"   | Gauge     | 分区表中对应节点上 DataRegion 总数量 |
 
-### 4.2.3. 弱一致性共识协议统计
+### 4.2.3. IoT共识协议统计
 | Metric       | Tags                                                                                         | Type      | Description                      |
 | ------------ | -------------------------------------------------------------------------------------------- | --------- | -------------------------------- |
 | mutli_leader | name="logDispatcher-{{IP}}:{{Port}}", region="{{region}}", type="currentSyncIndex"           | AutoGauge | 副本组同步线程的当前同步进度     |
 | mutli_leader | name="logDispatcher-{{IP}}:{{Port}}", region="{{region}}", type="cachedRequestInMemoryQueue" | AutoGauge | 副本组同步线程缓存队列请求总大小 |
-| mutli_leader | name="multiLeaderServerImpl", region="{{region}}", type="searchIndex"                        | AutoGauge | 副本组主流程写入进度             |
-| mutli_leader | name="multiLeaderServerImpl", region="{{region}}", type="safeIndex"                          | AutoGauge | 副本组同步进度                   |
+| mutli_leader | name="IoTConsensusServerImpl", region="{{region}}", type="searchIndex"                        | AutoGauge | 副本组主流程写入进度             |
+| mutli_leader | name="IoTConsensusServerImpl", region="{{region}}", type="safeIndex"                          | AutoGauge | 副本组同步进度                   |
 | stage        | name="multi_leader", region="{{region}}", type="getStateMachineLock"                         | Histogram | 主流程获取状态机锁耗时           |
 | stage        | name="multi_leader", region="{{region}}", type="checkingBeforeWrite"                         | Histogram | 主流程写入状态机检查耗时         |
 | stage        | name="multi_leader", region="{{region}}", type="writeStateMachine"                           | Histogram | 主流程写入状态机耗时             |
@@ -178,7 +178,7 @@ Core 级别的监控指标在系统运行中默认开启,每一个 Core 级别
 | ------ | ----------------------------- | --------- | ------------------------------------------------- |
 | mem    | name="database_{{name}}"      | AutoGauge | DataNode内对应DataRegion的内存占用,单位为byte    |
 | mem    | name="chunkMetaData_{{name}}" | AutoGauge | 写入TsFile时的ChunkMetaData的内存占用,单位为byte |
-| mem    | name="MultiLeaderConsensus"   | AutoGauge | 弱一致性共识协议的内存占用,单位为byte            |
+| mem    | name="IoTConsensus"   | AutoGauge | IoT共识协议的内存占用,单位为byte            |
 
 ### 4.2.7. 任务统计
 | Metric    | Tags                                              | Type      | Description        |
@@ -448,16 +448,16 @@ static_configs:
 - `Engine`:引擎
   - `Task number(pending and active)`:系统中不同状态的任务个数
   - `The time consumed of tasking(pending and active)`:系统中不同状态的任务的耗时
-- `MultiLeader`:弱一致性共识协议
-  - `MultiLeader Used Memory`:弱一致性共识层使用的内存大小
-  - `MultiLeader Sync Index`:不同的Region的写入Index和同步Index
-  - `MultiLeader Overview`:不同节点的同步总差距、总缓存的请求个数
+- `IoTConsensus`:IoT共识协议
+  - `IoTConsensus Used Memory`:IoT共识层使用的内存大小
+  - `IoTConsensus Sync Index`:不同的Region的写入Index和同步Index
+  - `IoTConsensus Overview`:不同节点的同步总差距、总缓存的请求个数
   - `The time consumed of different stages(50%)`:不同阶段耗时的中位数
   - `The time consumed of different stages(75%)`:不同阶段耗时的上四分位数
   - `The time consumed of different stages(100%)`:不同阶段耗时的最大值
-  - `MultiLeader Search Index Rate`:不同region的写入Index的增长速度
-  - `MultiLeader Safe Index Rate`:不同region的同步Index的增长速度
-  - `MultiLeader LogDispatcher Request Size`:不同的LogDispatcherThread缓存的请求个数
+  - `IoTConsensus Search Index Rate`:不同region的写入Index的增长速度
+  - `IoTConsensus Safe Index Rate`:不同region的同步Index的增长速度
+  - `IoTConsensus LogDispatcher Request Size`:不同的LogDispatcherThread缓存的请求个数
   - `Sync Lag`:每个region的同步index差距
   - `Min Peer Sync Lag`:每个region的写入index和同步最快的LogDispatcherThread的同步index之间的差距
   - `Sync speed diff of Peers`:每个region中同步最快的LogDispatcherThread与同步最慢的LogDispatcherThread之间的同步index差距
diff --git a/docs/zh/UserGuide/Reference/Common-Config-Manual.md b/docs/zh/UserGuide/Reference/Common-Config-Manual.md
index 37cf77ffe1..a2a5830ba9 100644
--- a/docs/zh/UserGuide/Reference/Common-Config-Manual.md
+++ b/docs/zh/UserGuide/Reference/Common-Config-Manual.md
@@ -62,7 +62,7 @@ IoTDB ConfigNode 和 DataNode 的通用配置参数位于 `conf` 目录下。
 | :----------: | :------------------------------------------------------------------------------------------- |
 |     描述     | 元数据副本的共识协议,1 副本时可以使用 SimpleConsensus 协议,多副本时只能使用 RatisConsensus |
 |     类型     | String                                                                                       |
-|    默认值    | org.apache.iotdb.consensus.simple.SimpleConsensus                                            |
+|    默认值    | org.apache.iotdb.consensus.ratis.RatisConsensus                                            |
 | 改后生效方式 | 仅允许在第一次启动服务前修改                                                                 |
 
 * data\_replication\_factor
@@ -78,9 +78,9 @@ IoTDB ConfigNode 和 DataNode 的通用配置参数位于 `conf` 目录下。
 
 |     名字     | data\_region\_consensus\_protocol\_class                                                                           |
 | :----------: | :----------------------------------------------------------------------------------------------------------------- |
-|     描述     | 数据副本的共识协议,1 副本时可以使用 SimpleConsensus 协议,多副本时可以使用 MultiLeaderConsensus 或 RatisConsensus |
+|     描述     | 数据副本的共识协议,1 副本时可以使用 SimpleConsensus 协议,多副本时可以使用 IoTConsensus 或 RatisConsensus |
 |     类型     | String                                                                                                             |
-|    默认值    | org.apache.iotdb.consensus.simple.SimpleConsensus                                                                  |
+|    默认值    | org.apache.iotdb.consensus.iot.IoTConsensus                                                                  |
 | 改后生效方式 | 仅允许在第一次启动服务前修改                                                                                       |
 
 ### 分区(负载均衡)配置
diff --git a/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json
index 4f5b44b4d0..c6842e3da5 100644
--- a/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json	
+++ b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json	
@@ -334,7 +334,7 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "mem{instance=~\"$instance\", name!=\"MultiLeaderConsensus\"}",
+          "expr": "mem{instance=~\"$instance\", name!=\"IoTConsensus\"}",
           "interval": "",
           "legendFormat": "{{name}}",
           "range": true,
@@ -975,7 +975,7 @@
           "refId": "A"
         }
       ],
-      "title": "MultiLeader",
+      "title": "IoTConsensus",
       "type": "row"
     },
     {
@@ -1057,14 +1057,14 @@
           },
           "editorMode": "code",
           "exemplar": true,
-          "expr": "mem{name=\"MultiLeaderConsensus\"}",
+          "expr": "mem{name=\"IoTConsensus\"}",
           "interval": "",
           "legendFormat": "{{instance}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "MultiLeader Used Memory",
+      "title": "IoTConsensus Used Memory",
       "type": "timeseries"
     },
     {
@@ -1167,7 +1167,7 @@
           "refId": "B"
         }
       ],
-      "title": "MultiLeader Sync Index",
+      "title": "IoTConsensus Sync Index",
       "type": "timeseries"
     },
     {
@@ -1272,7 +1272,7 @@
           "refId": "B"
         }
       ],
-      "title": "MultiLeader Overview",
+      "title": "IoTConsensus Overview",
       "type": "timeseries"
     },
     {
@@ -1633,7 +1633,7 @@
           "refId": "A"
         }
       ],
-      "title": "MultiLeader Search Index Rate",
+      "title": "IoTConsensus Search Index Rate",
       "type": "timeseries"
     },
     {
@@ -1726,7 +1726,7 @@
           "refId": "A"
         }
       ],
-      "title": "MultiLeader Safe Index Rate",
+      "title": "IoTConsensus Safe Index Rate",
       "type": "timeseries"
     },
     {
@@ -1813,7 +1813,7 @@
           "refId": "A"
         }
       ],
-      "title": "MultiLeader LogDispatcher Request Size",
+      "title": "IoTConsensus LogDispatcher Request Size",
       "type": "timeseries"
     },
     {
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 68a68e9e1f..4bcb805431 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -36,10 +36,10 @@
 # SchemaRegion consensus protocol type.
 # This parameter is unmodifiable after ConfigNode starts for the first time.
 # These consensus protocols are currently supported:
-# 1. org.apache.iotdb.consensus.simple.SimpleConsensus
-# 2. org.apache.iotdb.consensus.ratis.RatisConsensus
+# 1. org.apache.iotdb.consensus.ratis.RatisConsensus
+# 2. org.apache.iotdb.consensus.simple.SimpleConsensus
 # Datatype: string
-# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus
+# schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
 
 # Default number of data replicas
 # Can not be changed after the first start
@@ -53,7 +53,7 @@
 # 2. org.apache.iotdb.consensus.iot.IoTConsensus
 # 3. org.apache.iotdb.consensus.ratis.RatisConsensus
 # Datatype: string
-# data_region_consensus_protocol_class=org.apache.iotdb.consensus.simple.SimpleConsensus
+# data_region_consensus_protocol_class=org.apache.iotdb.consensus.iot.IoTConsensus
 
 ####################
 ### Partition (Load balancing) configuration