You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by zy...@apache.org on 2023/03/20 06:39:17 UTC

[iotdb] branch rc/1.1.0 updated (aaa86ca461 -> 9493bbc15b)

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

zyk pushed a change to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git


    from aaa86ca461 allow submitting tasks when queue is full (#9305)
     new 7b77a4a797 [IOTDB-5676] Improve ConfigurationException description and analyzing of cluster parameters (#9334) (#9340)
     new 4a5b900419 [To rel/1.1] Fix dispatch result collection logic (#9323)
     new aadf1073e5 [IOTDB-5682] Fix the update of nodeId in Metrics (#9344) (#9346)
     new a8c4e7a649 [To rel/1.1][IOTDB-5675] Metric of Schema Template (#9349)
     new b82b9d9eed [To rel/1.1][IOTDB-5688] ShcemaFile mode lost template schema after reboot in SimpleConsensus (#9351)
     new 99d5b9e1fa [IOTDB-5684] Standardize log folder of ConfigNode's Simple consensus protocol (#9353)
     new 2a238150d7 [To rel/1.1][IOTDB-5685] Fix error msg of failing to create a timeseries on an existing path when ReadOnly state (#9354)
     new 63796d5faf [To rel/1.1][IOTDB-5651] Fix compaction UT
     new 38d7b3ee40 [IOTDB-5695] Ensures backward compatibility between 1.0 and 1.1 for ConfigNode when using SimpleConsensus (#9367)
     new a632bfb05e [To rel/1.1][IOTDB-5689] Close Isink when ISourceHandle is closed
     new 2bbba2fe55 [IOTDB-5368] add port check for confignode and datanode (#9270) (#9371)
     new f5ce7762e6 [To rel/1.1][IOTDB-5618] Add RatisConsensus metrics in dashboard (#9369)
     new 9493bbc15b [IOTDB-5681] Fix the creation of system database used by IoTDB Internal Reporter (#9339) (#9378)

The 13 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../confignode/conf/ConfigNodeDescriptor.java      |    2 +-
 .../confignode/conf/ConfigNodeStartupCheck.java    |   98 +-
 .../confignode/conf/SystemPropertiesUtils.java     |   32 +-
 .../statemachine/ConfigRegionStateMachine.java     |    3 +-
 .../manager/consensus/ConsensusManager.java        |   63 +-
 .../iotdb/confignode/service/ConfigNode.java       |   18 +-
 .../confignode/service/ConfigNodeCommandLine.java  |    7 +-
 .../iotdb/consensus/config/ConsensusConfig.java    |   15 -
 .../ratis/ApplicationStateMachineProxy.java        |   30 +-
 .../iotdb/consensus/ratis/RatisConsensus.java      |   31 +-
 .../org/apache/iotdb/consensus/ratis/Utils.java    |   15 +
 .../ratis/metrics/IoTDBMetricRegistry.java         |   65 +-
 .../ratis/metrics/MetricRegistryManager.java       |   13 +-
 .../consensus/ratis/metrics/RatisMetricSet.java    |   79 +-
 .../ratis/metrics/RatisMetricsManager.java         |   84 +
 .../apache/iotdb/consensus/iot/ReplicateTest.java  |    2 -
 .../apache/iotdb/consensus/iot/StabilityTest.java  |    2 -
 .../iotdb/consensus/ratis/RatisConsensusTest.java  |    2 -
 .../apache/iotdb/consensus/ratis/SnapshotTest.java |   11 +-
 .../iotdb/consensus/simple/RecoveryTest.java       |    2 -
 .../Apache-IoTDB-ConfigNode-Dashboard.json         | 3837 ++++++-----
 .../Apache-IoTDB-DataNode-Dashboard.json           | 6969 ++++++++++++--------
 docs/UserGuide/Monitor-Alert/Metric-Tool.md        |   98 +-
 docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md     |   79 +-
 .../it/cluster/IoTDBClusterNodeErrorStartUpIT.java |   47 +
 .../apache/iotdb/metrics/config/MetricConfig.java  |    7 +-
 .../resources/conf/iotdb-common.properties         |    6 +-
 .../commons/exception/ConfigurationException.java  |   27 +-
 .../iotdb/commons/service/StartupChecks.java       |   33 +-
 .../iotdb/commons/service/metric/enums/Metric.java |    2 +
 .../apache/iotdb/db/conf/DataNodeStartupCheck.java |   69 +
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  |   37 +-
 .../org/apache/iotdb/db/conf/IoTDBStartCheck.java  |    5 +-
 .../db/consensus/DataRegionConsensusImpl.java      |    2 -
 .../db/consensus/SchemaRegionConsensusImpl.java    |    2 -
 .../execute/task/CrossSpaceCompactionTask.java     |    7 +-
 .../execute/task/InnerSpaceCompactionTask.java     |  264 +-
 .../db/metadata/metric/SchemaEngineMemMetric.java  |   16 +-
 .../db/metadata/metric/SchemaRegionMemMetric.java  |   34 +
 .../db/metadata/mtree/MTreeBelowSGCachedImpl.java  |   67 +-
 .../db/metadata/mtree/MTreeBelowSGMemoryImpl.java  |   15 +-
 .../mtree/snapshot/MemMTreeSnapshotUtil.java       |   13 +-
 .../db/metadata/mtree/store/MemMTreeStore.java     |    4 +-
 .../metadata/rescon/ISchemaEngineStatistics.java   |    2 +
 .../metadata/rescon/ISchemaRegionStatistics.java   |    4 +
 .../metadata/rescon/MemSchemaEngineStatistics.java |   26 +-
 .../metadata/rescon/MemSchemaRegionStatistics.java |   36 +-
 .../schemaregion/SchemaRegionMemoryImpl.java       |    5 +
 .../schemaregion/SchemaRegionSchemaFileImpl.java   |   90 +
 .../metadata/template/ClusterTemplateManager.java  |    7 +
 .../iotdb/db/metadata/template/Template.java       |    4 +
 .../iotdb/db/mpp/execution/driver/Driver.java      |   13 +-
 .../execution/exchange/MPPDataExchangeManager.java |   67 +-
 .../mpp/execution/exchange/SharedTsBlockQueue.java |    6 +-
 .../db/mpp/execution/exchange/sink/ISink.java      |    4 +
 .../mpp/execution/exchange/sink/ISinkHandle.java   |    3 +
 .../execution/exchange/sink/LocalSinkChannel.java  |    7 +
 .../execution/exchange/sink/ShuffleSinkHandle.java |   24 +-
 .../mpp/execution/exchange/sink/SinkChannel.java   |   11 +-
 .../execution/exchange/source/SourceHandle.java    |   59 +-
 .../execution/executor/RegionWriteExecutor.java    |  164 +-
 .../iotdb/db/mpp/execution/operator/Operator.java  |   10 +-
 .../process/AbstractConsumeAllOperator.java        |    4 +-
 .../operator/process/AbstractIntoOperator.java     |    7 +-
 .../operator/process/AggregationOperator.java      |    6 +-
 .../operator/process/DeviceMergeOperator.java      |    6 +-
 .../operator/process/DeviceViewOperator.java       |   17 +-
 .../execution/operator/process/FillOperator.java   |    6 +-
 .../operator/process/FilterAndProjectOperator.java |    6 +-
 .../execution/operator/process/LimitOperator.java  |    6 +-
 .../operator/process/LinearFillOperator.java       |    8 +-
 .../operator/process/MergeSortOperator.java        |    8 +-
 .../execution/operator/process/OffsetOperator.java |    6 +-
 .../process/RawDataAggregationOperator.java        |    9 +-
 .../operator/process/SingleDeviceViewOperator.java |    6 +-
 .../process/SingleInputAggregationOperator.java    |    6 +-
 .../process/SlidingWindowAggregationOperator.java  |    4 +-
 .../execution/operator/process/SortOperator.java   |    6 +-
 .../operator/process/TagAggregationOperator.java   |    8 +-
 .../operator/process/TransformOperator.java        |   16 +-
 .../process/join/HorizontallyConcatOperator.java   |    8 +-
 .../process/join/RowBasedTimeJoinOperator.java     |   11 +-
 .../operator/process/join/TimeJoinOperator.java    |    9 +-
 .../last/AbstractUpdateLastCacheOperator.java      |    4 +-
 .../last/AlignedUpdateLastCacheOperator.java       |    2 +-
 .../process/last/LastQueryCollectOperator.java     |    6 +-
 .../process/last/LastQueryMergeOperator.java       |   12 +-
 .../operator/process/last/LastQueryOperator.java   |    7 +-
 .../process/last/LastQuerySortOperator.java        |    7 +-
 .../process/last/UpdateLastCacheOperator.java      |    2 +-
 .../schema/CountGroupByLevelMergeOperator.java     |    6 +-
 .../schema/CountGroupByLevelScanOperator.java      |    6 +-
 .../operator/schema/CountMergeOperator.java        |    7 +-
 .../schema/NodeManageMemoryMergeOperator.java      |    6 +-
 .../operator/schema/NodePathsConvertOperator.java  |    6 +-
 .../operator/schema/NodePathsCountOperator.java    |    6 +-
 .../operator/schema/SchemaCountOperator.java       |    6 +-
 .../operator/schema/SchemaFetchMergeOperator.java  |    6 +-
 .../operator/schema/SchemaFetchScanOperator.java   |    6 +-
 .../operator/schema/SchemaQueryMergeOperator.java  |    6 +-
 .../schema/SchemaQueryOrderByHeatOperator.java     |    6 +-
 .../operator/schema/SchemaQueryScanOperator.java   |    6 +-
 .../operator/sink/IdentitySinkOperator.java        |   34 +-
 .../operator/sink/ShuffleHelperOperator.java       |   39 +-
 .../AbstractSeriesAggregationScanOperator.java     |    6 +-
 .../operator/source/AlignedSeriesScanOperator.java |    6 +-
 .../operator/source/ExchangeOperator.java          |    6 +-
 .../operator/source/LastCacheScanOperator.java     |    6 +-
 .../operator/source/SeriesScanOperator.java        |    6 +-
 .../operator/source/ShowQueriesOperator.java       |    6 +-
 .../metedata/write/CreateMultiTimeSeriesNode.java  |    6 +-
 .../plan/node/metedata/write/MeasurementGroup.java |   36 +-
 .../db/mpp/plan/scheduler/AsyncPlanNodeSender.java |   34 +
 .../scheduler/FragmentInstanceDispatcherImpl.java  |   32 +-
 .../db/mpp/transformation/api/YieldableReader.java |    6 +-
 .../transformation/dag/input/IUDFInputDataSet.java |    2 +-
 .../dag/input/QueryDataSetInputLayer.java          |    4 +-
 .../dag/input/TsBlockInputDataSet.java             |    2 +-
 .../MultiInputColumnIntermediateLayer.java         |   10 +-
 ...InputColumnMultiReferenceIntermediateLayer.java |   12 +-
 ...nputColumnSingleReferenceIntermediateLayer.java |   10 +-
 .../dag/transformer/Transformer.java               |    4 +-
 .../dag/transformer/binary/BinaryTransformer.java  |    4 +-
 .../transformer/binary/LogicBinaryTransformer.java |    2 +-
 .../multi/MappableUDFQueryRowTransformer.java      |    2 +-
 .../transformer/multi/UDFQueryRowTransformer.java  |    2 +-
 .../multi/UDFQueryRowWindowTransformer.java        |    2 +-
 .../multi/UniversalUDFQueryTransformer.java        |    4 +-
 .../transformer/ternary/TernaryTransformer.java    |    4 +-
 .../transformer/unary/DiffFunctionTransformer.java |    2 +-
 .../dag/transformer/unary/IsNullTransformer.java   |    2 +-
 .../dag/transformer/unary/UnaryTransformer.java    |    2 +-
 .../transformation/dag/util/LayerCacheUtils.java   |   10 +-
 .../java/org/apache/iotdb/db/service/DataNode.java |   44 +-
 .../metrics/IoTDBInternalLocalReporter.java        |   37 +
 .../schemaRegion/SchemaStatisticsTest.java         |  106 +
 .../iotdb/db/mpp/execution/exchange/StubSink.java  |    5 +
 .../operator/AggregationOperatorTest.java          |   26 +-
 .../AlignedSeriesAggregationScanOperatorTest.java  |   38 +-
 .../operator/AlignedSeriesScanOperatorTest.java    |    6 +-
 .../operator/DeviceMergeOperatorTest.java          |  565 --
 .../execution/operator/DeviceViewOperatorTest.java |    3 +-
 .../mpp/execution/operator/FillOperatorTest.java   |   16 +-
 .../operator/HorizontallyConcatOperatorTest.java   |    2 +-
 .../operator/LastQueryMergeOperatorTest.java       |   38 +-
 .../execution/operator/LastQueryOperatorTest.java  |    4 +-
 .../operator/LastQuerySortOperatorTest.java        |    5 +-
 .../mpp/execution/operator/LimitOperatorTest.java  |    2 +-
 .../execution/operator/LinearFillOperatorTest.java |   56 +-
 .../execution/operator/MergeSortOperatorTest.java  |   38 +-
 .../mpp/execution/operator/OffsetOperatorTest.java |    6 +-
 .../operator/RawDataAggregationOperatorTest.java   |   54 +-
 .../SeriesAggregationScanOperatorTest.java         |   65 +-
 .../execution/operator/SeriesScanOperatorTest.java |    2 +-
 .../operator/SingleDeviceViewOperatorTest.java     |    3 +-
 .../SlidingWindowAggregationOperatorTest.java      |    3 +-
 .../execution/operator/TimeJoinOperatorTest.java   |    6 +-
 .../operator/UpdateLastCacheOperatorTest.java      |    6 +-
 .../operator/schema/SchemaCountOperatorTest.java   |    4 +-
 .../schema/SchemaQueryScanOperatorTest.java        |    4 +-
 thrift/src/main/thrift/datanode.thrift             |   12 +-
 161 files changed, 8548 insertions(+), 5943 deletions(-)
 create mode 100644 consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricsManager.java
 create mode 100644 server/src/main/java/org/apache/iotdb/db/conf/DataNodeStartupCheck.java
 delete mode 100644 server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceMergeOperatorTest.java


[iotdb] 06/13: [IOTDB-5684] Standardize log folder of ConfigNode's Simple consensus protocol (#9353)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 99d5b9e1fa1e30d56a6de5734291e833f0526601
Author: YongzaoDan <33...@users.noreply.github.com>
AuthorDate: Fri Mar 17 00:42:34 2023 +0800

    [IOTDB-5684] Standardize log folder of ConfigNode's Simple consensus protocol (#9353)
---
 .../org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
index e3b4f948e1..b49123c542 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
@@ -90,7 +90,7 @@ public class ConsensusManager {
                   ConsensusConfig.newBuilder()
                       .setThisNode(
                           new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))
-                      .setStorageDir("target" + java.io.File.separator + "simple")
+                      .setStorageDir(CONF.getConsensusDir())
                       .setConsensusGroupType(TConsensusGroupType.ConfigRegion)
                       .build(),
                   gid -> stateMachine)


[iotdb] 04/13: [To rel/1.1][IOTDB-5675] Metric of Schema Template (#9349)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a8c4e7a64979226161507edf7fa7b83eed02ee51
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Thu Mar 16 21:06:52 2023 +0800

    [To rel/1.1][IOTDB-5675] Metric of Schema Template (#9349)
---
 .../Apache-IoTDB-DataNode-Dashboard.json           | 920 +++++++++++++++------
 docs/UserGuide/Monitor-Alert/Metric-Tool.md        |  21 +-
 docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md     |  19 +-
 .../db/metadata/metric/SchemaEngineMemMetric.java  |  16 +-
 .../db/metadata/metric/SchemaRegionMemMetric.java  |  34 +
 .../db/metadata/mtree/MTreeBelowSGCachedImpl.java  |  26 +-
 .../db/metadata/mtree/MTreeBelowSGMemoryImpl.java  |  15 +-
 .../mtree/snapshot/MemMTreeSnapshotUtil.java       |  13 +-
 .../db/metadata/mtree/store/MemMTreeStore.java     |   4 +-
 .../metadata/rescon/ISchemaEngineStatistics.java   |   2 +
 .../metadata/rescon/ISchemaRegionStatistics.java   |   4 +
 .../metadata/rescon/MemSchemaEngineStatistics.java |  26 +-
 .../metadata/rescon/MemSchemaRegionStatistics.java |  36 +-
 .../schemaregion/SchemaRegionMemoryImpl.java       |   5 +
 .../schemaregion/SchemaRegionSchemaFileImpl.java   |   5 +
 .../metadata/template/ClusterTemplateManager.java  |   7 +
 .../iotdb/db/metadata/template/Template.java       |   4 +
 .../schemaRegion/SchemaStatisticsTest.java         | 106 +++
 18 files changed, 977 insertions(+), 286 deletions(-)

diff --git a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
index 2b5ac95dda..673e00ba31 100644
--- a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
+++ b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
@@ -11,12 +11,24 @@
   ],
   "__elements": {},
   "__requires": [
+    {
+      "type": "panel",
+      "id": "bargauge",
+      "name": "Bar gauge",
+      "version": ""
+    },
     {
       "type": "grafana",
       "id": "grafana",
       "name": "Grafana",
       "version": "9.3.1"
     },
+    {
+      "type": "panel",
+      "id": "piechart",
+      "name": "Pie chart",
+      "version": ""
+    },
     {
       "type": "datasource",
       "id": "prometheus",
@@ -66,6 +78,81 @@
   "links": [],
   "liveNow": false,
   "panels": [
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisCenteredZero": false,
+            "axisColorMode": "text",
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          }
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 8,
+        "w": 12,
+        "x": 0,
+        "y": 0
+      },
+      "id": 231,
+      "options": {
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true
+        },
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
+      },
+      "title": "Panel Title",
+      "type": "timeseries"
+    },
     {
       "collapsed": true,
       "datasource": {
@@ -76,7 +163,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 0
+        "y": 8
       },
       "id": 1,
       "panels": [
@@ -136,7 +223,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 41
+            "y": 49
           },
           "id": 2,
           "options": {
@@ -225,7 +312,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 41
+            "y": 49
           },
           "id": 3,
           "options": {
@@ -315,7 +402,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 41
+            "y": 49
           },
           "id": 4,
           "options": {
@@ -371,7 +458,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 1
+        "y": 9
       },
       "id": 5,
       "panels": [
@@ -432,7 +519,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 42
+            "y": 50
           },
           "id": 6,
           "options": {
@@ -521,7 +608,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 42
+            "y": 50
           },
           "id": 55,
           "options": {
@@ -610,7 +697,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 42
+            "y": 50
           },
           "id": 56,
           "options": {
@@ -699,7 +786,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 50
+            "y": 58
           },
           "id": 9,
           "options": {
@@ -789,7 +876,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 50
+            "y": 58
           },
           "id": 10,
           "options": {
@@ -881,7 +968,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 50
+            "y": 58
           },
           "id": 11,
           "options": {
@@ -981,7 +1068,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 58
+            "y": 66
           },
           "id": 12,
           "options": {
@@ -1069,7 +1156,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 58
+            "y": 66
           },
           "id": 13,
           "options": {
@@ -1125,7 +1212,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 2
+        "y": 10
       },
       "id": 14,
       "panels": [
@@ -1185,7 +1272,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 3
+            "y": 11
           },
           "id": 15,
           "options": {
@@ -1275,7 +1362,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 3
+            "y": 11
           },
           "id": 16,
           "options": {
@@ -1365,7 +1452,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 11
+            "y": 19
           },
           "id": 17,
           "options": {
@@ -1467,7 +1554,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 11
+            "y": 19
           },
           "id": 18,
           "options": {
@@ -1557,7 +1644,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 11
+            "y": 19
           },
           "id": 19,
           "options": {
@@ -1674,7 +1761,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 19
+            "y": 27
           },
           "id": 169,
           "options": {
@@ -1797,7 +1884,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 19
+            "y": 27
           },
           "id": 171,
           "options": {
@@ -1851,7 +1938,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 3
+        "y": 11
       },
       "id": 58,
       "panels": [
@@ -1912,7 +1999,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 4
+            "y": 12
           },
           "id": 80,
           "options": {
@@ -2000,7 +2087,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 4
+            "y": 12
           },
           "id": 60,
           "options": {
@@ -2088,7 +2175,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 4
+            "y": 12
           },
           "id": 61,
           "options": {
@@ -2176,7 +2263,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 4
+            "y": 12
           },
           "id": 62,
           "options": {
@@ -2264,7 +2351,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 12
+            "y": 20
           },
           "id": 63,
           "options": {
@@ -2352,7 +2439,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 12
+            "y": 20
           },
           "id": 81,
           "options": {
@@ -2440,7 +2527,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 12
+            "y": 20
           },
           "id": 64,
           "options": {
@@ -2528,7 +2615,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 12
+            "y": 20
           },
           "id": 65,
           "options": {
@@ -2616,7 +2703,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 20
+            "y": 28
           },
           "id": 83,
           "options": {
@@ -2704,7 +2791,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 20
+            "y": 28
           },
           "id": 66,
           "options": {
@@ -2792,7 +2879,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 20
+            "y": 28
           },
           "id": 67,
           "options": {
@@ -2880,7 +2967,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 20
+            "y": 28
           },
           "id": 68,
           "options": {
@@ -2968,7 +3055,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 28
+            "y": 36
           },
           "id": 82,
           "options": {
@@ -3056,7 +3143,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 28
+            "y": 36
           },
           "id": 69,
           "options": {
@@ -3144,7 +3231,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 28
+            "y": 36
           },
           "id": 70,
           "options": {
@@ -3232,7 +3319,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 28
+            "y": 36
           },
           "id": 71,
           "options": {
@@ -3320,7 +3407,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 36
+            "y": 44
           },
           "id": 72,
           "options": {
@@ -3408,7 +3495,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 36
+            "y": 44
           },
           "id": 84,
           "options": {
@@ -3496,7 +3583,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 36
+            "y": 44
           },
           "id": 73,
           "options": {
@@ -3584,7 +3671,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 36
+            "y": 44
           },
           "id": 74,
           "options": {
@@ -3672,7 +3759,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 44
+            "y": 52
           },
           "id": 131,
           "options": {
@@ -3761,7 +3848,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 44
+            "y": 52
           },
           "id": 132,
           "options": {
@@ -3850,7 +3937,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 44
+            "y": 52
           },
           "id": 133,
           "options": {
@@ -3940,7 +4027,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 44
+            "y": 52
           },
           "id": 134,
           "options": {
@@ -4029,7 +4116,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 52
+            "y": 60
           },
           "id": 76,
           "options": {
@@ -4117,7 +4204,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 52
+            "y": 60
           },
           "id": 128,
           "options": {
@@ -4205,7 +4292,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 52
+            "y": 60
           },
           "id": 129,
           "options": {
@@ -4293,7 +4380,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 52
+            "y": 60
           },
           "id": 130,
           "options": {
@@ -4381,7 +4468,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 60
+            "y": 68
           },
           "id": 135,
           "options": {
@@ -4469,7 +4556,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 60
+            "y": 68
           },
           "id": 136,
           "options": {
@@ -4557,7 +4644,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 60
+            "y": 68
           },
           "id": 137,
           "options": {
@@ -4645,7 +4732,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 60
+            "y": 68
           },
           "id": 138,
           "options": {
@@ -4733,7 +4820,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 68
+            "y": 76
           },
           "id": 139,
           "options": {
@@ -4821,7 +4908,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 68
+            "y": 76
           },
           "id": 140,
           "options": {
@@ -4909,7 +4996,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 68
+            "y": 76
           },
           "id": 167,
           "options": {
@@ -4998,7 +5085,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 76
+            "y": 84
           },
           "id": 163,
           "options": {
@@ -5087,7 +5174,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 76
+            "y": 84
           },
           "id": 164,
           "options": {
@@ -5176,7 +5263,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 76
+            "y": 84
           },
           "id": 165,
           "options": {
@@ -5265,7 +5352,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 76
+            "y": 84
           },
           "id": 166,
           "options": {
@@ -5320,7 +5407,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 4
+        "y": 12
       },
       "id": 100,
       "panels": [
@@ -5381,7 +5468,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 5
+            "y": 13
           },
           "id": 75,
           "options": {
@@ -5469,7 +5556,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 5
+            "y": 13
           },
           "id": 85,
           "options": {
@@ -5557,7 +5644,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 5
+            "y": 13
           },
           "id": 77,
           "options": {
@@ -5645,7 +5732,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 5
+            "y": 13
           },
           "id": 78,
           "options": {
@@ -5733,7 +5820,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 13
+            "y": 21
           },
           "id": 86,
           "options": {
@@ -5821,7 +5908,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 13
+            "y": 21
           },
           "id": 87,
           "options": {
@@ -5909,7 +5996,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 13
+            "y": 21
           },
           "id": 88,
           "options": {
@@ -5997,7 +6084,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 13
+            "y": 21
           },
           "id": 89,
           "options": {
@@ -6085,7 +6172,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 21
+            "y": 29
           },
           "id": 90,
           "options": {
@@ -6173,7 +6260,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 21
+            "y": 29
           },
           "id": 91,
           "options": {
@@ -6261,7 +6348,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 21
+            "y": 29
           },
           "id": 92,
           "options": {
@@ -6349,7 +6436,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 21
+            "y": 29
           },
           "id": 93,
           "options": {
@@ -6437,7 +6524,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 29
+            "y": 37
           },
           "id": 94,
           "options": {
@@ -6525,7 +6612,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 29
+            "y": 37
           },
           "id": 95,
           "options": {
@@ -6613,7 +6700,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 29
+            "y": 37
           },
           "id": 96,
           "options": {
@@ -6701,7 +6788,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 29
+            "y": 37
           },
           "id": 97,
           "options": {
@@ -6789,7 +6876,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 37
+            "y": 45
           },
           "id": 98,
           "options": {
@@ -6878,7 +6965,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 37
+            "y": 45
           },
           "id": 101,
           "options": {
@@ -6967,7 +7054,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 37
+            "y": 45
           },
           "id": 102,
           "options": {
@@ -7056,7 +7143,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 37
+            "y": 45
           },
           "id": 103,
           "options": {
@@ -7144,7 +7231,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 45
+            "y": 53
           },
           "id": 104,
           "options": {
@@ -7233,7 +7320,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 45
+            "y": 53
           },
           "id": 105,
           "options": {
@@ -7322,7 +7409,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 45
+            "y": 53
           },
           "id": 106,
           "options": {
@@ -7411,7 +7498,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 45
+            "y": 53
           },
           "id": 107,
           "options": {
@@ -7499,7 +7586,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 53
+            "y": 61
           },
           "id": 108,
           "options": {
@@ -7588,7 +7675,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 53
+            "y": 61
           },
           "id": 109,
           "options": {
@@ -7677,7 +7764,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 53
+            "y": 61
           },
           "id": 110,
           "options": {
@@ -7766,7 +7853,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 53
+            "y": 61
           },
           "id": 111,
           "options": {
@@ -7852,7 +7939,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 61
+            "y": 69
           },
           "id": 112,
           "options": {
@@ -7939,7 +8026,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 61
+            "y": 69
           },
           "id": 113,
           "options": {
@@ -8026,7 +8113,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 61
+            "y": 69
           },
           "id": 114,
           "options": {
@@ -8113,7 +8200,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 61
+            "y": 69
           },
           "id": 115,
           "options": {
@@ -8199,7 +8286,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 69
+            "y": 77
           },
           "id": 116,
           "options": {
@@ -8286,7 +8373,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 69
+            "y": 77
           },
           "id": 117,
           "options": {
@@ -8373,7 +8460,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 69
+            "y": 77
           },
           "id": 118,
           "options": {
@@ -8460,7 +8547,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 69
+            "y": 77
           },
           "id": 119,
           "options": {
@@ -8546,7 +8633,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 77
+            "y": 85
           },
           "id": 120,
           "options": {
@@ -8633,7 +8720,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 77
+            "y": 85
           },
           "id": 121,
           "options": {
@@ -8720,7 +8807,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 77
+            "y": 85
           },
           "id": 122,
           "options": {
@@ -8807,7 +8894,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 77
+            "y": 85
           },
           "id": 123,
           "options": {
@@ -8893,7 +8980,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 85
+            "y": 93
           },
           "id": 124,
           "options": {
@@ -8980,7 +9067,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 85
+            "y": 93
           },
           "id": 125,
           "options": {
@@ -9067,7 +9154,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 85
+            "y": 93
           },
           "id": 126,
           "options": {
@@ -9154,7 +9241,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 85
+            "y": 93
           },
           "id": 127,
           "options": {
@@ -9208,7 +9295,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 5
+        "y": 13
       },
       "id": 142,
       "panels": [
@@ -9269,7 +9356,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 6
+            "y": 14
           },
           "id": 143,
           "options": {
@@ -9357,7 +9444,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 6
+            "y": 14
           },
           "id": 144,
           "options": {
@@ -9445,7 +9532,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 6
+            "y": 14
           },
           "id": 145,
           "options": {
@@ -9533,7 +9620,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 6
+            "y": 14
           },
           "id": 146,
           "options": {
@@ -9621,7 +9708,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 14
+            "y": 22
           },
           "id": 147,
           "options": {
@@ -9709,7 +9796,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 14
+            "y": 22
           },
           "id": 148,
           "options": {
@@ -9797,7 +9884,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 14
+            "y": 22
           },
           "id": 149,
           "options": {
@@ -9885,7 +9972,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 14
+            "y": 22
           },
           "id": 150,
           "options": {
@@ -9973,7 +10060,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 22
+            "y": 30
           },
           "id": 151,
           "options": {
@@ -10061,7 +10148,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 22
+            "y": 30
           },
           "id": 152,
           "options": {
@@ -10149,7 +10236,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 22
+            "y": 30
           },
           "id": 153,
           "options": {
@@ -10237,7 +10324,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 22
+            "y": 30
           },
           "id": 154,
           "options": {
@@ -10325,7 +10412,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 30
+            "y": 38
           },
           "id": 155,
           "options": {
@@ -10413,7 +10500,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 30
+            "y": 38
           },
           "id": 156,
           "options": {
@@ -10501,7 +10588,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 30
+            "y": 38
           },
           "id": 157,
           "options": {
@@ -10589,7 +10676,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 30
+            "y": 38
           },
           "id": 158,
           "options": {
@@ -10677,7 +10764,7 @@
             "h": 8,
             "w": 6,
             "x": 0,
-            "y": 38
+            "y": 46
           },
           "id": 159,
           "options": {
@@ -10765,7 +10852,7 @@
             "h": 8,
             "w": 6,
             "x": 6,
-            "y": 38
+            "y": 46
           },
           "id": 160,
           "options": {
@@ -10853,7 +10940,7 @@
             "h": 8,
             "w": 6,
             "x": 12,
-            "y": 38
+            "y": 46
           },
           "id": 161,
           "options": {
@@ -10941,7 +11028,7 @@
             "h": 8,
             "w": 6,
             "x": 18,
-            "y": 38
+            "y": 46
           },
           "id": 162,
           "options": {
@@ -10995,7 +11082,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 6
+        "y": 14
       },
       "id": 20,
       "panels": [
@@ -11056,7 +11143,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 7
+            "y": 15
           },
           "id": 21,
           "options": {
@@ -11174,7 +11261,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 7
+            "y": 15
           },
           "id": 22,
           "options": {
@@ -11265,7 +11352,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 7
+            "y": 15
           },
           "id": 23,
           "options": {
@@ -11371,7 +11458,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 15
+            "y": 23
           },
           "id": 24,
           "options": {
@@ -11492,7 +11579,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 15
+            "y": 23
           },
           "id": 25,
           "options": {
@@ -11608,7 +11695,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 15
+            "y": 23
           },
           "id": 26,
           "options": {
@@ -11698,7 +11785,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 23
+            "y": 31
           },
           "id": 27,
           "options": {
@@ -11788,7 +11875,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 23
+            "y": 31
           },
           "id": 175,
           "options": {
@@ -11878,7 +11965,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 23
+            "y": 31
           },
           "id": 29,
           "options": {
@@ -11969,7 +12056,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 31
+            "y": 39
           },
           "id": 30,
           "options": {
@@ -12062,7 +12149,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 31
+            "y": 39
           },
           "id": 31,
           "options": {
@@ -12156,7 +12243,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 31
+            "y": 39
           },
           "id": 32,
           "options": {
@@ -12249,7 +12336,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 39
+            "y": 47
           },
           "id": 28,
           "options": {
@@ -12339,7 +12426,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 39
+            "y": 47
           },
           "id": 173,
           "options": {
@@ -12395,7 +12482,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 7
+        "y": 15
       },
       "id": 33,
       "panels": [
@@ -12426,7 +12513,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 16
+            "y": 24
           },
           "id": 34,
           "options": {
@@ -12521,7 +12608,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 16
+            "y": 24
           },
           "id": 35,
           "options": {
@@ -12625,7 +12712,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 16
+            "y": 24
           },
           "id": 40,
           "options": {
@@ -12717,7 +12804,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 24
+            "y": 32
           },
           "id": 41,
           "options": {
@@ -12833,7 +12920,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 24
+            "y": 32
           },
           "id": 42,
           "options": {
@@ -12937,7 +13024,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 24
+            "y": 32
           },
           "id": 43,
           "options": {
@@ -13051,7 +13138,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 32
+            "y": 40
           },
           "id": 44,
           "options": {
@@ -13175,7 +13262,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 32
+            "y": 40
           },
           "id": 45,
           "options": {
@@ -13276,7 +13363,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 32
+            "y": 40
           },
           "id": 46,
           "options": {
@@ -13379,7 +13466,7 @@
             "h": 7,
             "w": 8,
             "x": 0,
-            "y": 40
+            "y": 48
           },
           "id": 47,
           "options": {
@@ -13481,7 +13568,7 @@
             "h": 7,
             "w": 8,
             "x": 8,
-            "y": 40
+            "y": 48
           },
           "id": 48,
           "options": {
@@ -13580,7 +13667,7 @@
             "h": 7,
             "w": 8,
             "x": 16,
-            "y": 40
+            "y": 48
           },
           "id": 49,
           "options": {
@@ -13680,7 +13767,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 47
+            "y": 55
           },
           "id": 50,
           "options": {
@@ -13816,7 +13903,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 47
+            "y": 55
           },
           "id": 51,
           "options": {
@@ -13950,7 +14037,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 47
+            "y": 55
           },
           "id": 52,
           "options": {
@@ -14041,7 +14128,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 55
+            "y": 63
           },
           "id": 53,
           "options": {
@@ -14132,7 +14219,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 55
+            "y": 63
           },
           "id": 54,
           "options": {
@@ -14200,7 +14287,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 8
+        "y": 16
       },
       "id": 177,
       "panels": [
@@ -14271,7 +14358,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 87
+            "y": 95
           },
           "id": 179,
           "options": {
@@ -14362,7 +14449,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 87
+            "y": 95
           },
           "id": 181,
           "options": {
@@ -14453,7 +14540,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 95
+            "y": 103
           },
           "id": 183,
           "options": {
@@ -14546,7 +14633,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 95
+            "y": 103
           },
           "id": 185,
           "options": {
@@ -14635,7 +14722,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 103
+            "y": 111
           },
           "id": 187,
           "options": {
@@ -14728,7 +14815,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 103
+            "y": 111
           },
           "id": 189,
           "options": {
@@ -14819,7 +14906,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 103
+            "y": 111
           },
           "id": 193,
           "options": {
@@ -14913,7 +15000,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 111
+            "y": 119
           },
           "id": 191,
           "options": {
@@ -15003,7 +15090,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 111
+            "y": 119
           },
           "id": 195,
           "options": {
@@ -15055,7 +15142,7 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 9
+        "y": 17
       },
       "id": 197,
       "panels": [],
@@ -15102,13 +15189,13 @@
       },
       "gridPos": {
         "h": 4,
-        "w": 4,
+        "w": 8,
         "x": 0,
-        "y": 10
+        "y": 18
       },
       "id": 224,
       "options": {
-        "colorMode": "value",
+        "colorMode": "none",
         "graphMode": "none",
         "justifyMode": "auto",
         "orientation": "auto",
@@ -15140,6 +15227,250 @@
       "title": "Schema Engine Mode",
       "type": "stat"
     },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "thresholds"
+          },
+          "mappings": [
+            {
+              "options": {
+                "0": {
+                  "index": 0,
+                  "text": "RatisConsensus"
+                },
+                "1": {
+                  "index": 1,
+                  "text": "SimpleConsensus"
+                }
+              },
+              "type": "value"
+            }
+          ],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          },
+          "unit": "none"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 4,
+        "w": 8,
+        "x": 8,
+        "y": 18
+      },
+      "id": 225,
+      "options": {
+        "colorMode": "none",
+        "graphMode": "none",
+        "justifyMode": "auto",
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "",
+          "values": false
+        },
+        "textMode": "value"
+      },
+      "pluginVersion": "9.3.1",
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": false,
+          "expr": "schema_engine{name=\"schema_region_consensus\",instance=~\"$instance\"}",
+          "instant": false,
+          "legendFormat": "{{name}}",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "Schema Consensus Protocol",
+      "type": "stat"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "thresholds"
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          },
+          "unit": "none"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 4,
+        "w": 8,
+        "x": 16,
+        "y": 18
+      },
+      "id": 219,
+      "options": {
+        "colorMode": "none",
+        "graphMode": "none",
+        "justifyMode": "auto",
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "",
+          "values": false
+        },
+        "textMode": "auto"
+      },
+      "pluginVersion": "9.3.1",
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": false,
+          "expr": "schema_engine{name=\"schema_region_number\",instance=~\"$instance\"}",
+          "instant": false,
+          "legendFormat": "{{name}}",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "Schema Region Number",
+      "type": "stat"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            }
+          },
+          "mappings": [],
+          "unit": "none"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 8,
+        "w": 4,
+        "x": 0,
+        "y": 22
+      },
+      "id": 235,
+      "options": {
+        "displayLabels": [],
+        "legend": {
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true,
+          "values": []
+        },
+        "pieType": "pie",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "",
+          "values": false
+        },
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
+      },
+      "pluginVersion": "9.3.1",
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": false,
+          "expr": "sum(quantity{name=\"timeSeries\", instance=~\"$instance\"})-\nsum(quantity{name=\"template_series_cnt\", instance=~\"$instance\"})",
+          "format": "time_series",
+          "hide": false,
+          "instant": false,
+          "legendFormat": "Normal",
+          "range": true,
+          "refId": "A"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "expr": "quantity{name=\"template_series_cnt\", instance=~\"$instance\"}",
+          "hide": false,
+          "legendFormat": "Template",
+          "range": true,
+          "refId": "B"
+        }
+      ],
+      "title": "Series Type",
+      "transformations": [
+        {
+          "id": "calculateField",
+          "options": {
+            "alias": "normal series",
+            "binary": {
+              "left": "{__name__=\"quantity\", cluster=\"defaultCluster\", instance=\"localhost:9093\", job=\"datanode\", name=\"timeSeries\", nodeId=\"-1\", nodeType=\"DATANODE\"}",
+              "operator": "-",
+              "reducer": "sum",
+              "right": "{__name__=\"quantity\", cluster=\"defaultCluster\", instance=\"localhost:9093\", job=\"datanode\", name=\"template_series_num\", nodeId=\"-1\", nodeType=\"DATANODE\"}"
+            },
+            "mode": "binary",
+            "reduce": {
+              "reducer": "sum"
+            },
+            "replaceFields": false
+          }
+        }
+      ],
+      "type": "piechart"
+    },
     {
       "datasource": {
         "type": "prometheus",
@@ -15168,9 +15499,9 @@
         "h": 4,
         "w": 4,
         "x": 4,
-        "y": 10
+        "y": 22
       },
-      "id": 219,
+      "id": 222,
       "options": {
         "colorMode": "value",
         "graphMode": "area",
@@ -15194,14 +15525,14 @@
           },
           "editorMode": "code",
           "exemplar": false,
-          "expr": "schema_engine{name=\"schema_region_number\",instance=~\"$instance\"}",
+          "expr": "quantity{name=\"timeSeries\",instance=~\"$instance\"}",
           "instant": false,
           "legendFormat": "{{name}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "Schema Region Number",
+      "title": "Time Series Number",
       "type": "stat"
     },
     {
@@ -15320,7 +15651,7 @@
         "h": 8,
         "w": 16,
         "x": 8,
-        "y": 10
+        "y": 22
       },
       "id": 217,
       "options": {
@@ -15361,21 +15692,7 @@
           "color": {
             "mode": "thresholds"
           },
-          "mappings": [
-            {
-              "options": {
-                "0": {
-                  "index": 0,
-                  "text": "RatisConsensus"
-                },
-                "1": {
-                  "index": 1,
-                  "text": "SimpleConsensus"
-                }
-              },
-              "type": "value"
-            }
-          ],
+          "mappings": [],
           "thresholds": {
             "mode": "absolute",
             "steps": [
@@ -15392,13 +15709,13 @@
       "gridPos": {
         "h": 4,
         "w": 4,
-        "x": 0,
-        "y": 14
+        "x": 4,
+        "y": 26
       },
-      "id": 225,
+      "id": 236,
       "options": {
         "colorMode": "value",
-        "graphMode": "none",
+        "graphMode": "area",
         "justifyMode": "auto",
         "orientation": "auto",
         "reduceOptions": {
@@ -15419,14 +15736,14 @@
           },
           "editorMode": "code",
           "exemplar": false,
-          "expr": "schema_engine{name=\"schema_region_consensus\",instance=~\"$instance\"}",
+          "expr": "quantity{name=\"template_series_cnt\",instance=~\"$instance\"}",
           "instant": false,
           "legendFormat": "{{name}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "Schema Consensus Protocol",
+      "title": "Template Series Number",
       "type": "stat"
     },
     {
@@ -15434,10 +15751,41 @@
         "type": "prometheus",
         "uid": "${DS_PROMETHEUS}"
       },
+      "description": "",
       "fieldConfig": {
         "defaults": {
           "color": {
-            "mode": "thresholds"
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisCenteredZero": false,
+            "axisColorMode": "text",
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 1,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
           },
           "mappings": [],
           "thresholds": {
@@ -15446,35 +15794,35 @@
               {
                 "color": "green",
                 "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
               }
             ]
-          },
-          "unit": "none"
+          }
         },
         "overrides": []
       },
       "gridPos": {
-        "h": 4,
-        "w": 4,
-        "x": 4,
-        "y": 14
+        "h": 7,
+        "w": 12,
+        "x": 0,
+        "y": 30
       },
-      "id": 222,
+      "id": 233,
       "options": {
-        "colorMode": "value",
-        "graphMode": "area",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
-          ],
-          "fields": "",
-          "values": false
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true
         },
-        "textMode": "value"
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
       },
-      "pluginVersion": "9.3.1",
       "targets": [
         {
           "datasource": {
@@ -15482,23 +15830,20 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "editorMode": "code",
-          "exemplar": false,
-          "expr": "quantity{name=\"timeSeries\",instance=~\"$instance\"}",
-          "instant": false,
-          "legendFormat": "{{name}}",
+          "expr": "schema_region{name=\"schema_region_series_cnt\",instance=~\"$instance\"}",
+          "legendFormat": "{{region}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "Time Series Number",
-      "type": "stat"
+      "title": "Timeseries Count per SchemaRegion",
+      "type": "timeseries"
     },
     {
       "datasource": {
         "type": "prometheus",
         "uid": "${DS_PROMETHEUS}"
       },
-      "description": "",
       "fieldConfig": {
         "defaults": {
           "color": {
@@ -15547,17 +15892,18 @@
                 "value": 80
               }
             ]
-          }
+          },
+          "unit": "bytes"
         },
         "overrides": []
       },
       "gridPos": {
         "h": 7,
         "w": 12,
-        "x": 0,
-        "y": 18
+        "x": 12,
+        "y": 30
       },
-      "id": 215,
+      "id": 213,
       "options": {
         "legend": {
           "calcs": [],
@@ -15577,13 +15923,13 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "editorMode": "code",
-          "expr": "schema_region{name=\"schema_region_series_cnt\",instance=~\"$instance\"}",
+          "expr": "schema_region{name=\"schema_region_mem_usage\",instance=~\"$instance\"}",
           "legendFormat": "{{region}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "Timeseries Count per SchemaRegion",
+      "title": "Memory Usgae per SchemaRegion",
       "type": "timeseries"
     },
     {
@@ -15591,6 +15937,73 @@
         "type": "prometheus",
         "uid": "${DS_PROMETHEUS}"
       },
+      "description": "",
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "thresholds"
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          }
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 7,
+        "w": 12,
+        "x": 0,
+        "y": 37
+      },
+      "id": 215,
+      "options": {
+        "displayMode": "gradient",
+        "minVizHeight": 10,
+        "minVizWidth": 0,
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "",
+          "values": false
+        },
+        "showUnfilled": true
+      },
+      "pluginVersion": "9.3.1",
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "expr": "schema_region{name=\"activated_template_cnt\",instance=~\"$instance\"}",
+          "legendFormat": "{{region}}",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "Activated Template Count per SchemaRegion",
+      "type": "bargauge"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "description": "",
       "fieldConfig": {
         "defaults": {
           "color": {
@@ -15639,8 +16052,7 @@
                 "value": 80
               }
             ]
-          },
-          "unit": "bytes"
+          }
         },
         "overrides": []
       },
@@ -15648,9 +16060,9 @@
         "h": 7,
         "w": 12,
         "x": 12,
-        "y": 18
+        "y": 37
       },
-      "id": 213,
+      "id": 232,
       "options": {
         "legend": {
           "calcs": [],
@@ -15670,13 +16082,13 @@
             "uid": "${DS_PROMETHEUS}"
           },
           "editorMode": "code",
-          "expr": "schema_region{name=\"schema_region_mem_usage\",instance=~\"$instance\"}",
+          "expr": "schema_region{name=\"template_series_cnt\",instance=~\"$instance\"}",
           "legendFormat": "{{region}}",
           "range": true,
           "refId": "A"
         }
       ],
-      "title": "Memory Usgae per SchemaRegion",
+      "title": "Template Series Count per SchemaRegion",
       "type": "timeseries"
     },
     {
@@ -15740,7 +16152,7 @@
         "h": 7,
         "w": 6,
         "x": 0,
-        "y": 25
+        "y": 44
       },
       "id": 199,
       "options": {
@@ -15836,7 +16248,7 @@
         "h": 7,
         "w": 6,
         "x": 6,
-        "y": 25
+        "y": 44
       },
       "id": 203,
       "options": {
@@ -15928,7 +16340,7 @@
         "h": 7,
         "w": 6,
         "x": 12,
-        "y": 25
+        "y": 44
       },
       "id": 209,
       "options": {
@@ -16021,7 +16433,7 @@
         "h": 7,
         "w": 6,
         "x": 18,
-        "y": 25
+        "y": 44
       },
       "id": 211,
       "options": {
@@ -16113,7 +16525,7 @@
         "h": 7,
         "w": 6,
         "x": 0,
-        "y": 32
+        "y": 51
       },
       "id": 201,
       "options": {
@@ -16207,7 +16619,7 @@
         "h": 7,
         "w": 6,
         "x": 6,
-        "y": 32
+        "y": 51
       },
       "id": 205,
       "options": {
@@ -16299,7 +16711,7 @@
         "h": 7,
         "w": 6,
         "x": 12,
-        "y": 32
+        "y": 51
       },
       "id": 207,
       "options": {
@@ -16391,7 +16803,7 @@
         "h": 7,
         "w": 6,
         "x": 18,
-        "y": 32
+        "y": 51
       },
       "id": 220,
       "options": {
@@ -16483,7 +16895,7 @@
         "h": 7,
         "w": 6,
         "x": 0,
-        "y": 39
+        "y": 58
       },
       "id": 221,
       "options": {
@@ -16575,7 +16987,7 @@
         "h": 7,
         "w": 6,
         "x": 6,
-        "y": 39
+        "y": 58
       },
       "id": 223,
       "options": {
@@ -16668,7 +17080,7 @@
         "h": 7,
         "w": 6,
         "x": 12,
-        "y": 39
+        "y": 58
       },
       "id": 229,
       "options": {
@@ -16761,7 +17173,7 @@
         "h": 7,
         "w": 6,
         "x": 18,
-        "y": 39
+        "y": 58
       },
       "id": 228,
       "options": {
@@ -16850,8 +17262,8 @@
     ]
   },
   "time": {
-    "from": "now-20m",
-    "to": "now-10m"
+    "from": "now-5m",
+    "to": "now"
   },
   "timepicker": {
     "refresh_intervals": [
@@ -16866,6 +17278,6 @@
   "timezone": "browser",
   "title": "Apache IoTDB DataNode Dashboard",
   "uid": "TbEVYRw7A",
-  "version": 20,
+  "version": 5,
   "weekStart": ""
 }
\ No newline at end of file
diff --git a/docs/UserGuide/Monitor-Alert/Metric-Tool.md b/docs/UserGuide/Monitor-Alert/Metric-Tool.md
index e8145023c1..21f91a2a9c 100644
--- a/docs/UserGuide/Monitor-Alert/Metric-Tool.md
+++ b/docs/UserGuide/Monitor-Alert/Metric-Tool.md
@@ -422,15 +422,18 @@ carefully evaluated. The current Core-level metrics are as follows:
 
 #### 4.2.16 Schema Engine
 
-| Metric        | Tags                                                               | Type      | Description                            |
-| ------------- | ------------------------------------------------------------------ | --------- | -------------------------------------- |
-| schema_engine | name="schema_region_total_mem_usage"                               | AutoGauge | Memory usgae for all SchemaRegion      |
-| schema_engine | name="schema_region_mem_capacity"                                  | AutoGauge | Memory capacity for all SchemaRegion   |
-| schema_engine | name="schema_engine_mode"                                          | Gauge     | Mode of SchemaEngine                   |
-| schema_engine | name="schema_region_consensus"                                     | Gauge     | Consensus protocol of SchemaRegion     |
-| schema_engine | name="schema_region_number"                                        | AutoGauge | Number of SchemaRegion                 |
-| schema_region | name="schema_region_mem_usage", region="SchemaRegion[{regionId}]"  | AutoGauge | Memory usgae for each SchemaRegion     |
-| schema_region | name="schema_region_series_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | Timeseries count for each SchemaRegion |
+| Metric        | Tags                                                         | Type      | Description                                        |
+| ------------- | ------------------------------------------------------------ | --------- | -------------------------------------------------- |
+| schema_engine | name="schema_region_total_mem_usage"                         | AutoGauge | Memory usgae for all SchemaRegion                  |
+| schema_engine | name="schema_region_mem_capacity"                            | AutoGauge | Memory capacity for all SchemaRegion               |
+| schema_engine | name="schema_engine_mode"                                    | Gauge     | Mode of SchemaEngine                               |
+| schema_engine | name="schema_region_consensus"                               | Gauge     | Consensus protocol of SchemaRegion                 |
+| schema_engine | name="schema_region_number"                                  | AutoGauge | Number of SchemaRegion                             |
+| quantity      | name="template_series_cnt"                                   | AutoGauge | Number of template series                          |
+| schema_region | name="schema_region_mem_usage", region="SchemaRegion[{regionId}]" | AutoGauge | Memory usgae for each SchemaRegion                 |
+| schema_region | name="schema_region_series_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | Number of total timeseries for each SchemaRegion   |
+| schema_region | name="activated_template_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | Number of Activated template for each SchemaRegion |
+| schema_region | name="template_series_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | Number of template series for each SchemaRegion    |
 
 #### 4.2.17 Write Performance
 
diff --git a/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md b/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
index e09b74ac4b..6e9fdf309c 100644
--- a/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
+++ b/docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md
@@ -401,15 +401,18 @@ Core 级别的监控指标在系统运行中默认开启,每一个 Core 级别
 
 #### 4.2.16 元数据引擎统计
 
-| Metric        | Tags                                                               | Type      | Description                        |
-| ------------- | ------------------------------------------------------------------ | --------- | ---------------------------------- |
-| schema_engine | name="schema_region_total_mem_usage"                               | AutoGauge | SchemaRegion 全局内存使用量        |
-| schema_engine | name="schema_region_mem_capacity"                                  | AutoGauge | SchemaRegion 全局可用内存          |
-| schema_engine | name="schema_engine_mode"                                          | Gauge     | SchemaEngine 模式                  |
-| schema_engine | name="schema_region_consensus"                                     | Gauge     | 元数据管理引擎共识协议             |
-| schema_engine | name="schema_region_number"                                        | AutoGauge | SchemaRegion 个数                  |
-| schema_region | name="schema_region_mem_usage", region="SchemaRegion[{regionId}]"  | AutoGauge | 每个 SchemaRegion 分别的内存使用量 |
+| Metric        | Tags                                                         | Type      | Description                        |
+| ------------- | ------------------------------------------------------------ | --------- | ---------------------------------- |
+| schema_engine | name="schema_region_total_mem_usage"                         | AutoGauge | SchemaRegion 全局内存使用量        |
+| schema_engine | name="schema_region_mem_capacity"                            | AutoGauge | SchemaRegion 全局可用内存          |
+| schema_engine | name="schema_engine_mode"                                    | Gauge     | SchemaEngine 模式                  |
+| schema_engine | name="schema_region_consensus"                               | Gauge     | 元数据管理引擎共识协议             |
+| schema_engine | name="schema_region_number"                                  | AutoGauge | SchemaRegion 个数                  |
+| quantity      | name="template_series_cnt"                                   | AutoGauge | 模板序列数                         |
+| schema_region | name="schema_region_mem_usage", region="SchemaRegion[{regionId}]" | AutoGauge | 每个 SchemaRegion 分别的内存使用量 |
 | schema_region | name="schema_region_series_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | 每个 SchemaRegion 分别的时间序列数 |
+| schema_region | name="activated_template_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | 每个 SchemaRegion 激活的模板数     |
+| schema_region | name="template_series_cnt", region="SchemaRegion[{regionId}]" | AutoGauge | 每个 SchemaRegion 的模板序列数     |
 
 ### 4.3. Normal 级别监控指标
 
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaEngineMemMetric.java b/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaEngineMemMetric.java
index 8d56139e63..54f282fbb2 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaEngineMemMetric.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaEngineMemMetric.java
@@ -39,6 +39,8 @@ public class SchemaEngineMemMetric implements ISchemaEngineMetric {
   private static final String SCHEMA_CONSENSUS = "schema_region_consensus";
   private static final String SCHEMA_ENGINE_MODE = "schema_engine_mode";
 
+  private static final String TEMPLATE_SERIES_CNT = "template_series_cnt";
+
   private final MemSchemaEngineStatistics engineStatistics;
 
   public SchemaEngineMemMetric(MemSchemaEngineStatistics engineStatistics) {
@@ -54,6 +56,13 @@ public class SchemaEngineMemMetric implements ISchemaEngineMetric {
         ISchemaEngineStatistics::getTotalSeriesNumber,
         Tag.NAME.toString(),
         TIME_SERES_CNT);
+    metricService.createAutoGauge(
+        Metric.QUANTITY.toString(),
+        MetricLevel.IMPORTANT,
+        engineStatistics,
+        ISchemaEngineStatistics::getTemplateSeriesNumber,
+        Tag.NAME.toString(),
+        TEMPLATE_SERIES_CNT);
     metricService.createAutoGauge(
         Metric.MEM.toString(),
         MetricLevel.IMPORTANT,
@@ -100,7 +109,12 @@ public class SchemaEngineMemMetric implements ISchemaEngineMetric {
   @Override
   public void unbindFrom(AbstractMetricService metricService) {
     metricService.remove(
-        MetricType.AUTO_GAUGE, Metric.QUANTITY.toString(), Tag.NAME.toString(), "timeSeries");
+        MetricType.AUTO_GAUGE, Metric.QUANTITY.toString(), Tag.NAME.toString(), TIME_SERES_CNT);
+    metricService.remove(
+        MetricType.AUTO_GAUGE,
+        Metric.QUANTITY.toString(),
+        Tag.NAME.toString(),
+        TEMPLATE_SERIES_CNT);
     metricService.remove(
         MetricType.AUTO_GAUGE,
         Metric.MEM.toString(),
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaRegionMemMetric.java b/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaRegionMemMetric.java
index a7475537d4..1fc4f4dd63 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaRegionMemMetric.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/metric/SchemaRegionMemMetric.java
@@ -29,6 +29,8 @@ public class SchemaRegionMemMetric implements ISchemaRegionMetric {
 
   private static final String MEM_USAGE = "schema_region_mem_usage";
   private static final String SERIES_CNT = "schema_region_series_cnt";
+  private static final String TEMPLATE_CNT = "activated_template_cnt";
+  private static final String TEMPLATE_SERIES_CNT = "template_series_cnt";
 
   private final MemSchemaRegionStatistics regionStatistics;
   private final String regionTagValue;
@@ -58,6 +60,24 @@ public class SchemaRegionMemMetric implements ISchemaRegionMetric {
         SERIES_CNT,
         Tag.REGION.toString(),
         regionTagValue);
+    metricService.createAutoGauge(
+        Metric.SCHEMA_REGION.toString(),
+        MetricLevel.IMPORTANT,
+        regionStatistics,
+        MemSchemaRegionStatistics::getTemplateActivatedNumber,
+        Tag.NAME.toString(),
+        TEMPLATE_CNT,
+        Tag.REGION.toString(),
+        regionTagValue);
+    metricService.createAutoGauge(
+        Metric.SCHEMA_REGION.toString(),
+        MetricLevel.IMPORTANT,
+        regionStatistics,
+        MemSchemaRegionStatistics::getTemplateSeriesNumber,
+        Tag.NAME.toString(),
+        TEMPLATE_SERIES_CNT,
+        Tag.REGION.toString(),
+        regionTagValue);
   }
 
   @Override
@@ -76,5 +96,19 @@ public class SchemaRegionMemMetric implements ISchemaRegionMetric {
         SERIES_CNT,
         Tag.REGION.toString(),
         regionTagValue);
+    metricService.remove(
+        MetricType.AUTO_GAUGE,
+        Metric.SCHEMA_REGION.toString(),
+        Tag.NAME.toString(),
+        TEMPLATE_CNT,
+        Tag.REGION.toString(),
+        regionTagValue);
+    metricService.remove(
+        MetricType.AUTO_GAUGE,
+        Metric.SCHEMA_REGION.toString(),
+        Tag.NAME.toString(),
+        TEMPLATE_SERIES_CNT,
+        Tag.REGION.toString(),
+        regionTagValue);
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
index 60d70848da..a0644e00cb 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
@@ -108,6 +108,7 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
   private final IMNode rootNode;
   private final Function<IMeasurementMNode, Map<String, String>> tagGetter;
   private final int levelOfSG;
+  private final CachedSchemaRegionStatistics regionStatistics;
 
   // region MTree initialization, clear and serialization
   public MTreeBelowSGCachedImpl(
@@ -119,6 +120,7 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
       CachedSchemaRegionStatistics regionStatistics)
       throws MetadataException, IOException {
     this.tagGetter = tagGetter;
+    this.regionStatistics = regionStatistics;
     store = new CachedMTreeStore(storageGroupPath, schemaRegionId, regionStatistics, flushCallback);
     this.storageGroupMNode = store.getRoot().getAsStorageGroupMNode();
     this.storageGroupMNode.setParent(storageGroupMNode.getParent());
@@ -145,21 +147,28 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
       PartialPath storageGroupPath,
       CachedMTreeStore store,
       Consumer<IMeasurementMNode> measurementProcess,
-      Function<IMeasurementMNode, Map<String, String>> tagGetter)
+      Consumer<IEntityMNode> deviceProcess,
+      Function<IMeasurementMNode, Map<String, String>> tagGetter,
+      CachedSchemaRegionStatistics regionStatistics)
       throws MetadataException {
     this.store = store;
+    this.regionStatistics = regionStatistics;
     this.storageGroupMNode = store.getRoot().getAsStorageGroupMNode();
     this.rootNode = store.generatePrefix(storageGroupPath);
     levelOfSG = storageGroupMNode.getPartialPath().getNodeLength() - 1;
     this.tagGetter = tagGetter;
 
     // recover measurement
-    try (MeasurementCollector<?> collector =
-        new MeasurementCollector<Void>(
+    try (MNodeCollector<?> collector =
+        new MNodeCollector<Void>(
             this.rootNode, new PartialPath(storageGroupMNode.getFullPath()), this.store, true) {
           @Override
-          protected Void collectMeasurement(IMeasurementMNode node) {
-            measurementProcess.accept(node);
+          protected Void collectMNode(IMNode node) {
+            if (node.isMeasurement()) {
+              measurementProcess.accept(node.getAsMeasurementMNode());
+            } else if (node.isEntity()) {
+              deviceProcess.accept(node.getAsEntityMNode());
+            }
             return null;
           }
         }) {
@@ -189,6 +198,7 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
       int schemaRegionId,
       CachedSchemaRegionStatistics regionStatistics,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       Function<IMeasurementMNode, Map<String, String>> tagGetter,
       Runnable flushCallback)
       throws IOException, MetadataException {
@@ -197,7 +207,9 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
         CachedMTreeStore.loadFromSnapshot(
             snapshotDir, storageGroupFullPath, schemaRegionId, regionStatistics, flushCallback),
         measurementProcess,
-        tagGetter);
+        deviceProcess,
+        tagGetter,
+        regionStatistics);
   }
 
   // endregion
@@ -837,6 +849,7 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
       entityMNode.setSchemaTemplateId(template.getId());
 
       store.updateMNode(entityMNode);
+      regionStatistics.activateTemplate(template.getId());
     } finally {
       unPinPath(cur);
     }
@@ -902,6 +915,7 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
                   && node.isPreDeactivateTemplate()) {
                 resultTemplateSetInfo.put(
                     node.getPartialPath(), Collections.singletonList(node.getSchemaTemplateId()));
+                regionStatistics.deactivateTemplate(node.getSchemaTemplateId());
                 node.deactivateTemplate();
                 store.updateMNode(node);
               }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGMemoryImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGMemoryImpl.java
index 7d1c397104..465468e24b 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGMemoryImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGMemoryImpl.java
@@ -109,6 +109,7 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
   private final IMNode rootNode;
   private final Function<IMeasurementMNode, Map<String, String>> tagGetter;
   private final int levelOfSG;
+  private final MemSchemaRegionStatistics regionStatistics;
 
   // region MTree initialization, clear and serialization
   public MTreeBelowSGMemoryImpl(
@@ -116,6 +117,7 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
       Function<IMeasurementMNode, Map<String, String>> tagGetter,
       MemSchemaRegionStatistics regionStatistics) {
     store = new MemMTreeStore(storageGroupPath, true, regionStatistics);
+    this.regionStatistics = regionStatistics;
     this.storageGroupMNode = store.getRoot().getAsStorageGroupMNode();
     this.rootNode = store.generatePrefix(storageGroupPath);
     levelOfSG = storageGroupPath.getNodeLength() - 1;
@@ -125,8 +127,10 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
   private MTreeBelowSGMemoryImpl(
       PartialPath storageGroupPath,
       MemMTreeStore store,
-      Function<IMeasurementMNode, Map<String, String>> tagGetter) {
+      Function<IMeasurementMNode, Map<String, String>> tagGetter,
+      MemSchemaRegionStatistics regionStatistics) {
     this.store = store;
+    this.regionStatistics = regionStatistics;
     this.storageGroupMNode = store.getRoot().getAsStorageGroupMNode();
     this.rootNode = store.generatePrefix(storageGroupPath);
     levelOfSG = storageGroupPath.getNodeLength() - 1;
@@ -154,12 +158,15 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
       String storageGroupFullPath,
       MemSchemaRegionStatistics regionStatistics,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       Function<IMeasurementMNode, Map<String, String>> tagGetter)
       throws IOException, IllegalPathException {
     return new MTreeBelowSGMemoryImpl(
         new PartialPath(storageGroupFullPath),
-        MemMTreeStore.loadFromSnapshot(snapshotDir, measurementProcess, regionStatistics),
-        tagGetter);
+        MemMTreeStore.loadFromSnapshot(
+            snapshotDir, measurementProcess, deviceProcess, regionStatistics),
+        tagGetter,
+        regionStatistics);
   }
 
   // endregion
@@ -719,6 +726,7 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
     }
     entityMNode.setUseTemplate(true);
     entityMNode.setSchemaTemplateId(template.getId());
+    regionStatistics.activateTemplate(template.getId());
   }
 
   @Override
@@ -780,6 +788,7 @@ public class MTreeBelowSGMemoryImpl implements IMTreeBelowSG {
                   && node.isPreDeactivateTemplate()) {
                 resultTemplateSetInfo.put(
                     node.getPartialPath(), Collections.singletonList(node.getSchemaTemplateId()));
+                regionStatistics.deactivateTemplate(node.getSchemaTemplateId());
                 node.deactivateTemplate();
                 deleteEmptyInternalMNode(node);
               }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/snapshot/MemMTreeSnapshotUtil.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/snapshot/MemMTreeSnapshotUtil.java
index b650dc710c..af48f0d2ce 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/snapshot/MemMTreeSnapshotUtil.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/snapshot/MemMTreeSnapshotUtil.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.db.metadata.mtree.snapshot;
 import org.apache.iotdb.commons.file.SystemFileFactory;
 import org.apache.iotdb.db.metadata.MetadataConstant;
 import org.apache.iotdb.db.metadata.mnode.EntityMNode;
+import org.apache.iotdb.db.metadata.mnode.IEntityMNode;
 import org.apache.iotdb.db.metadata.mnode.IMNode;
 import org.apache.iotdb.db.metadata.mnode.IMeasurementMNode;
 import org.apache.iotdb.db.metadata.mnode.InternalMNode;
@@ -107,12 +108,13 @@ public class MemMTreeSnapshotUtil {
   public static IMNode loadSnapshot(
       File snapshotDir,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       MemSchemaRegionStatistics regionStatistics)
       throws IOException {
     File snapshot =
         SystemFileFactory.INSTANCE.getFile(snapshotDir, MetadataConstant.MTREE_SNAPSHOT);
     try (BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream(snapshot))) {
-      return deserializeFrom(inputStream, measurementProcess, regionStatistics);
+      return deserializeFrom(inputStream, measurementProcess, deviceProcess, regionStatistics);
     } catch (Throwable e) {
       // This method is only invoked during recovery. If failed, the memory usage should be cleared
       // since the loaded schema will not be used.
@@ -157,15 +159,17 @@ public class MemMTreeSnapshotUtil {
   private static IMNode deserializeFrom(
       InputStream inputStream,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       MemSchemaRegionStatistics regionStatistics)
       throws IOException {
     byte version = ReadWriteIOUtils.readByte(inputStream);
-    return inorderDeserialize(inputStream, measurementProcess, regionStatistics);
+    return inorderDeserialize(inputStream, measurementProcess, deviceProcess, regionStatistics);
   }
 
   private static IMNode inorderDeserialize(
       InputStream inputStream,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       MemSchemaRegionStatistics regionStatistics)
       throws IOException {
     MNodeDeserializer deserializer = new MNodeDeserializer();
@@ -177,6 +181,7 @@ public class MemMTreeSnapshotUtil {
         deserializer,
         inputStream,
         measurementProcess,
+        deviceProcess,
         regionStatistics);
     int childrenNum;
     IMNode root = ancestors.peek();
@@ -192,6 +197,7 @@ public class MemMTreeSnapshotUtil {
             deserializer,
             inputStream,
             measurementProcess,
+            deviceProcess,
             regionStatistics);
       }
     }
@@ -204,6 +210,7 @@ public class MemMTreeSnapshotUtil {
       MNodeDeserializer deserializer,
       InputStream inputStream,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       MemSchemaRegionStatistics regionStatistics)
       throws IOException {
     byte type = ReadWriteIOUtils.readByte(inputStream);
@@ -221,10 +228,12 @@ public class MemMTreeSnapshotUtil {
       case ENTITY_MNODE_TYPE:
         childrenNum = ReadWriteIOUtils.readInt(inputStream);
         node = deserializer.deserializeEntityMNode(inputStream);
+        deviceProcess.accept(node.getAsEntityMNode());
         break;
       case STORAGE_GROUP_ENTITY_MNODE_TYPE:
         childrenNum = ReadWriteIOUtils.readInt(inputStream);
         node = deserializer.deserializeStorageGroupEntityMNode(inputStream);
+        deviceProcess.accept(node.getAsEntityMNode());
         break;
       case MEASUREMENT_MNODE_TYPE:
         childrenNum = 0;
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/MemMTreeStore.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/MemMTreeStore.java
index 49b92f7861..791eb17e57 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/MemMTreeStore.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/store/MemMTreeStore.java
@@ -229,10 +229,12 @@ public class MemMTreeStore implements IMTreeStore {
   public static MemMTreeStore loadFromSnapshot(
       File snapshotDir,
       Consumer<IMeasurementMNode> measurementProcess,
+      Consumer<IEntityMNode> deviceProcess,
       MemSchemaRegionStatistics regionStatistics)
       throws IOException {
     return new MemMTreeStore(
-        MemMTreeSnapshotUtil.loadSnapshot(snapshotDir, measurementProcess, regionStatistics),
+        MemMTreeSnapshotUtil.loadSnapshot(
+            snapshotDir, measurementProcess, deviceProcess, regionStatistics),
         regionStatistics);
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaEngineStatistics.java b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaEngineStatistics.java
index 5109c7a083..88189f68b1 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaEngineStatistics.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaEngineStatistics.java
@@ -32,6 +32,8 @@ public interface ISchemaEngineStatistics {
 
   int getSchemaRegionNumber();
 
+  long getTemplateSeriesNumber();
+
   MemSchemaEngineStatistics getAsMemSchemaEngineStatistics();
 
   CachedSchemaEngineStatistics getAsCachedSchemaEngineStatistics();
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaRegionStatistics.java b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaRegionStatistics.java
index a03d229b70..6dade84995 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaRegionStatistics.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/ISchemaRegionStatistics.java
@@ -28,6 +28,10 @@ public interface ISchemaRegionStatistics {
 
   long getSeriesNumber();
 
+  int getTemplateActivatedNumber();
+
+  long getTemplateSeriesNumber();
+
   MemSchemaRegionStatistics getAsMemSchemaRegionStatistics();
 
   CachedSchemaRegionStatistics getAsCachedSchemaRegionStatistics();
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaEngineStatistics.java b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaEngineStatistics.java
index 7fad2d55e5..a683e343dc 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaEngineStatistics.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaEngineStatistics.java
@@ -20,10 +20,13 @@ package org.apache.iotdb.db.metadata.rescon;
 
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.metadata.schemaregion.SchemaEngine;
+import org.apache.iotdb.db.metadata.template.ClusterTemplateManager;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
 /** This class is used to record the global statistics of SchemaEngine in Memory mode */
@@ -39,6 +42,8 @@ public class MemSchemaEngineStatistics implements ISchemaEngineStatistics {
 
   private final AtomicLong totalSeriesNumber = new AtomicLong(0);
 
+  private final Map<Integer, Integer> templateUsage = new ConcurrentHashMap<>();
+
   private volatile boolean allowToCreateNewSeries = true;
 
   @Override
@@ -82,7 +87,7 @@ public class MemSchemaEngineStatistics implements ISchemaEngineStatistics {
 
   @Override
   public long getTotalSeriesNumber() {
-    return totalSeriesNumber.get();
+    return totalSeriesNumber.get() + getTemplateSeriesNumber();
   }
 
   @Override
@@ -90,6 +95,25 @@ public class MemSchemaEngineStatistics implements ISchemaEngineStatistics {
     return SchemaEngine.getInstance().getSchemaRegionNumber();
   }
 
+  @Override
+  public long getTemplateSeriesNumber() {
+    ClusterTemplateManager clusterTemplateManager = ClusterTemplateManager.getInstance();
+    return templateUsage.entrySet().stream()
+        .mapToLong(
+            i ->
+                (long) clusterTemplateManager.getTemplate(i.getKey()).getMeasurementNumber()
+                    * i.getValue())
+        .sum();
+  }
+
+  public void activateTemplate(int templateId) {
+    templateUsage.compute(templateId, (k, v) -> (v == null) ? 1 : v + 1);
+  }
+
+  public void deactivateTemplate(int templateId, int cnt) {
+    templateUsage.compute(templateId, (k, v) -> (v == null || v <= cnt) ? null : v - cnt);
+  }
+
   public void addTimeseries(long addedNum) {
     totalSeriesNumber.addAndGet(addedNum);
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaRegionStatistics.java b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaRegionStatistics.java
index 96f1895334..c8747d3b07 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaRegionStatistics.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/rescon/MemSchemaRegionStatistics.java
@@ -18,6 +18,10 @@
  */
 package org.apache.iotdb.db.metadata.rescon;
 
+import org.apache.iotdb.db.metadata.template.ClusterTemplateManager;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.atomic.AtomicLong;
 
 /** This class is used to record statistics within the SchemaRegion in Memory mode */
@@ -27,6 +31,7 @@ public class MemSchemaRegionStatistics implements ISchemaRegionStatistics {
   private final int schemaRegionId;
   private final AtomicLong memoryUsage = new AtomicLong(0);
   private final AtomicLong seriesNumber = new AtomicLong(0);
+  private final Map<Integer, Integer> templateUsage = new ConcurrentHashMap<>();
 
   private long mLogLength = 0;
 
@@ -52,7 +57,7 @@ public class MemSchemaRegionStatistics implements ISchemaRegionStatistics {
 
   @Override
   public long getSeriesNumber() {
-    return seriesNumber.get();
+    return seriesNumber.get() + getTemplateSeriesNumber();
   }
 
   public void addTimeseries(long addedNum) {
@@ -65,6 +70,32 @@ public class MemSchemaRegionStatistics implements ISchemaRegionStatistics {
     schemaEngineStatistics.deleteTimeseries(deletedNum);
   }
 
+  @Override
+  public int getTemplateActivatedNumber() {
+    return templateUsage.size();
+  }
+
+  @Override
+  public long getTemplateSeriesNumber() {
+    ClusterTemplateManager clusterTemplateManager = ClusterTemplateManager.getInstance();
+    return templateUsage.entrySet().stream()
+        .mapToLong(
+            i ->
+                (long) clusterTemplateManager.getTemplate(i.getKey()).getMeasurementNumber()
+                    * i.getValue())
+        .sum();
+  }
+
+  public void activateTemplate(int templateId) {
+    templateUsage.compute(templateId, (k, v) -> (v == null) ? 1 : v + 1);
+    schemaEngineStatistics.activateTemplate(templateId);
+  }
+
+  public void deactivateTemplate(int templateId) {
+    templateUsage.compute(templateId, (k, v) -> (v == null || v == 1) ? null : v - 1);
+    schemaEngineStatistics.deactivateTemplate(templateId, 1);
+  }
+
   @Override
   public long getRegionMemoryUsage() {
     return memoryUsage.get();
@@ -99,5 +130,8 @@ public class MemSchemaRegionStatistics implements ISchemaRegionStatistics {
     schemaEngineStatistics.deleteTimeseries(seriesNumber.get());
     memoryUsage.getAndSet(0);
     seriesNumber.getAndSet(0);
+    templateUsage.forEach(
+        (templateId, cnt) -> schemaEngineStatistics.deactivateTemplate(templateId, cnt));
+    templateUsage.clear();
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java
index 59383c6f01..fb9d0e8dc5 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionMemoryImpl.java
@@ -476,6 +476,11 @@ public class SchemaRegionMemoryImpl implements ISchemaRegion {
                       schemaRegionId);
                 }
               },
+              deviceMNode -> {
+                if (deviceMNode.getSchemaTemplateIdWithState() >= 0) {
+                  regionStatistics.activateTemplate(deviceMNode.getSchemaTemplateId());
+                }
+              },
               tagManager::readTags);
       logger.info(
           "MTree snapshot loading of schemaRegion {} costs {}ms.",
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
index dbf2e59185..7968407c14 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
@@ -516,6 +516,11 @@ public class SchemaRegionSchemaFileImpl implements ISchemaRegion {
                       schemaRegionId);
                 }
               },
+              deviceMNode -> {
+                if (deviceMNode.getSchemaTemplateIdWithState() >= 0) {
+                  regionStatistics.activateTemplate(deviceMNode.getSchemaTemplateId());
+                }
+              },
               tagManager::readTags,
               this::flushCallback);
       logger.info(
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java b/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
index 1350a07a04..1eb2d28477 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/template/ClusterTemplateManager.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.commons.consensus.ConfigRegionId;
 import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.exception.IoTDBException;
 import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.commons.utils.TestOnly;
 import org.apache.iotdb.confignode.rpc.thrift.TCreateSchemaTemplateReq;
 import org.apache.iotdb.confignode.rpc.thrift.TGetAllTemplatesResp;
 import org.apache.iotdb.confignode.rpc.thrift.TGetPathsSetTemplatesResp;
@@ -365,4 +366,10 @@ public class ClusterTemplateManager implements ITemplateManager {
       readWriteLock.writeLock().unlock();
     }
   }
+
+  @TestOnly
+  public void putTemplate(Template template) {
+    templateIdMap.put(template.getId(), template);
+    templateNameMap.put(template.getName(), template.getId());
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/template/Template.java b/server/src/main/java/org/apache/iotdb/db/metadata/template/Template.java
index a2a2130cce..1b2a831f84 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/template/Template.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/template/Template.java
@@ -170,6 +170,10 @@ public class Template implements Serializable {
     return isDirectAligned;
   }
 
+  public int getMeasurementNumber() {
+    return schemaMap.size();
+  }
+
   // region construct template tree
   /** Construct aligned measurements, checks prefix equality, path duplication and conflict */
   private void constructTemplateTree(String[] alignedPaths, IMeasurementSchema[] schemas)
diff --git a/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaStatisticsTest.java b/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaStatisticsTest.java
index 6e1383275f..c494b55b47 100644
--- a/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaStatisticsTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/metadata/schemaRegion/SchemaStatisticsTest.java
@@ -30,11 +30,14 @@ import org.apache.iotdb.db.metadata.mnode.StorageGroupMNode;
 import org.apache.iotdb.db.metadata.mnode.estimator.BasicMNodSizeEstimator;
 import org.apache.iotdb.db.metadata.mnode.estimator.IMNodeSizeEstimator;
 import org.apache.iotdb.db.metadata.mtree.store.disk.memcontrol.CachedMNodeSizeEstimator;
+import org.apache.iotdb.db.metadata.plan.schemaregion.impl.write.SchemaRegionWritePlanFactory;
 import org.apache.iotdb.db.metadata.rescon.CachedSchemaEngineStatistics;
 import org.apache.iotdb.db.metadata.rescon.CachedSchemaRegionStatistics;
 import org.apache.iotdb.db.metadata.rescon.ISchemaEngineStatistics;
 import org.apache.iotdb.db.metadata.schemaregion.ISchemaRegion;
 import org.apache.iotdb.db.metadata.schemaregion.SchemaEngine;
+import org.apache.iotdb.db.metadata.template.ClusterTemplateManager;
+import org.apache.iotdb.db.metadata.template.Template;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -44,6 +47,10 @@ import org.junit.Assert;
 import org.junit.Test;
 
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 public class SchemaStatisticsTest extends AbstractSchemaRegionTest {
 
@@ -248,4 +255,103 @@ public class SchemaStatisticsTest extends AbstractSchemaRegionTest {
           engineStatistics.getUnpinnedMemorySize());
     }
   }
+
+  @Test
+  public void testTemplateStatistics() throws Exception {
+    ISchemaEngineStatistics engineStatistics =
+        SchemaEngine.getInstance().getSchemaEngineStatistics();
+    ISchemaRegion schemaRegion1 = getSchemaRegion("root.sg1", 0);
+    ISchemaRegion schemaRegion2 = getSchemaRegion("root.sg2", 1);
+    schemaRegion1.createTimeseries(
+        SchemaRegionWritePlanFactory.getCreateTimeSeriesPlan(
+            new PartialPath("root.sg.wf01.wt01.status"),
+            TSDataType.BOOLEAN,
+            TSEncoding.PLAIN,
+            CompressionType.SNAPPY,
+            null,
+            null,
+            null,
+            null),
+        -1);
+    Template template1 =
+        new Template(
+            "t1",
+            Arrays.asList(
+                Collections.singletonList("s1"),
+                Collections.singletonList("s2"),
+                Collections.singletonList("s3")),
+            Arrays.asList(
+                Collections.singletonList(TSDataType.DOUBLE),
+                Collections.singletonList(TSDataType.INT32),
+                Collections.singletonList(TSDataType.BOOLEAN)),
+            Arrays.asList(
+                Collections.singletonList(TSEncoding.RLE),
+                Collections.singletonList(TSEncoding.RLE),
+                Collections.singletonList(TSEncoding.RLE)),
+            Arrays.asList(
+                Collections.singletonList(CompressionType.SNAPPY),
+                Collections.singletonList(CompressionType.SNAPPY),
+                Collections.singletonList(CompressionType.SNAPPY)));
+    template1.setId(1);
+    Template template2 =
+        new Template(
+            "t2",
+            Arrays.asList(
+                Collections.singletonList("temperature"), Collections.singletonList("status")),
+            Arrays.asList(
+                Collections.singletonList(TSDataType.DOUBLE),
+                Collections.singletonList(TSDataType.INT32)),
+            Arrays.asList(
+                Collections.singletonList(TSEncoding.RLE),
+                Collections.singletonList(TSEncoding.RLE)),
+            Arrays.asList(
+                Collections.singletonList(CompressionType.SNAPPY),
+                Collections.singletonList(CompressionType.SNAPPY)));
+    template2.setId(2);
+    ClusterTemplateManager.getInstance().putTemplate(template1);
+    ClusterTemplateManager.getInstance().putTemplate(template2);
+    for (int i = 0; i < 4; i++) {
+      schemaRegion1.activateSchemaTemplate(
+          SchemaRegionWritePlanFactory.getActivateTemplateInClusterPlan(
+              new PartialPath("root.sg1.d" + i), 2, 1),
+          template1);
+      schemaRegion2.activateSchemaTemplate(
+          SchemaRegionWritePlanFactory.getActivateTemplateInClusterPlan(
+              new PartialPath("root.sg2.d" + i), 2, 1),
+          template1);
+    }
+    schemaRegion2.activateSchemaTemplate(
+        SchemaRegionWritePlanFactory.getActivateTemplateInClusterPlan(
+            new PartialPath("root.sg2.wf01.wt02"), 3, 2),
+        template2);
+
+    // check template statistic
+    Assert.assertEquals(26, engineStatistics.getTemplateSeriesNumber());
+    Assert.assertEquals(27, engineStatistics.getTotalSeriesNumber());
+    Assert.assertEquals(13, schemaRegion1.getSchemaRegionStatistics().getSeriesNumber());
+    Assert.assertEquals(12, schemaRegion1.getSchemaRegionStatistics().getTemplateSeriesNumber());
+    Assert.assertEquals(14, schemaRegion2.getSchemaRegionStatistics().getSeriesNumber());
+    Assert.assertEquals(14, schemaRegion2.getSchemaRegionStatistics().getTemplateSeriesNumber());
+
+    // deactivate template
+    // construct schema blacklist with template on root.sg.wf01.wt01 and root.sg.wf02
+    Map<PartialPath, List<Integer>> allDeviceTemplateMap = new HashMap<>();
+    allDeviceTemplateMap.put(new PartialPath("root.**.d0"), Arrays.asList(1, 2));
+    schemaRegion1.constructSchemaBlackListWithTemplate(
+        SchemaRegionWritePlanFactory.getPreDeactivateTemplatePlan(allDeviceTemplateMap));
+    schemaRegion2.constructSchemaBlackListWithTemplate(
+        SchemaRegionWritePlanFactory.getPreDeactivateTemplatePlan(allDeviceTemplateMap));
+    schemaRegion1.deactivateTemplateInBlackList(
+        SchemaRegionWritePlanFactory.getDeactivateTemplatePlan(allDeviceTemplateMap));
+    schemaRegion2.deactivateTemplateInBlackList(
+        SchemaRegionWritePlanFactory.getDeactivateTemplatePlan(allDeviceTemplateMap));
+
+    // check template statistic
+    Assert.assertEquals(20, engineStatistics.getTemplateSeriesNumber());
+    Assert.assertEquals(21, engineStatistics.getTotalSeriesNumber());
+    Assert.assertEquals(10, schemaRegion1.getSchemaRegionStatistics().getSeriesNumber());
+    Assert.assertEquals(9, schemaRegion1.getSchemaRegionStatistics().getTemplateSeriesNumber());
+    Assert.assertEquals(11, schemaRegion2.getSchemaRegionStatistics().getSeriesNumber());
+    Assert.assertEquals(11, schemaRegion2.getSchemaRegionStatistics().getTemplateSeriesNumber());
+  }
 }


[iotdb] 11/13: [IOTDB-5368] add port check for confignode and datanode (#9270) (#9371)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2bbba2fe55d7b538fb2dd26659305dfbae1ffb7c
Author: YuFengLiu <38...@users.noreply.github.com>
AuthorDate: Sun Mar 19 22:10:31 2023 +0800

    [IOTDB-5368] add port check for confignode and datanode (#9270) (#9371)
---
 .../confignode/conf/ConfigNodeStartupCheck.java    | 40 ++++++++-----
 .../confignode/service/ConfigNodeCommandLine.java  |  7 +--
 .../it/cluster/IoTDBClusterNodeErrorStartUpIT.java | 47 +++++++++++++++
 .../iotdb/commons/service/StartupChecks.java       | 33 ++++++-----
 .../apache/iotdb/db/conf/DataNodeStartupCheck.java | 69 ++++++++++++++++++++++
 .../java/org/apache/iotdb/db/service/DataNode.java | 37 ++++++------
 6 files changed, 180 insertions(+), 53 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index f889c131e1..47c0c26f55 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.confignode.conf;
 import org.apache.iotdb.commons.conf.IoTDBConstant;
 import org.apache.iotdb.commons.exception.ConfigurationException;
 import org.apache.iotdb.commons.exception.StartupException;
+import org.apache.iotdb.commons.service.StartupChecks;
 import org.apache.iotdb.confignode.manager.load.balancer.router.leader.ILeaderBalancer;
 import org.apache.iotdb.confignode.manager.load.balancer.router.priority.IPriorityBalancer;
 import org.apache.iotdb.consensus.ConsensusFactory;
@@ -31,18 +32,42 @@ import org.slf4j.LoggerFactory;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
 
 /**
  * ConfigNodeStartupCheck checks the parameters in iotdb-confignode.properties and
  * confignode-system.properties when start and restart
  */
-public class ConfigNodeStartupCheck {
+public class ConfigNodeStartupCheck extends StartupChecks {
 
   private static final Logger LOGGER = LoggerFactory.getLogger(ConfigNodeStartupCheck.class);
 
   private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
 
+  private static final int CONFIGNODE_PORTS = 2;
+
+  public ConfigNodeStartupCheck(String nodeRole) {
+    super(nodeRole);
+  }
+
+  @Override
+  protected void portCheck() throws StartupException {
+    Set<Integer> portSet = new HashSet<>();
+    portSet.add(CONF.getConsensusPort());
+    portSet.add(CONF.getInternalPort());
+    if (portSet.size() != CONFIGNODE_PORTS) {
+      throw new StartupException("ports used in configNode have repeat.");
+    } else {
+      LOGGER.info("configNode port check successful.");
+    }
+  }
+
+  @Override
   public void startUpCheck() throws StartupException, IOException, ConfigurationException {
+    envCheck();
+    portCheck();
+    verify();
     checkGlobalConfig();
     createDirsIfNecessary();
     if (SystemPropertiesUtils.isRestarted()) {
@@ -164,17 +189,4 @@ public class ConfigNodeStartupCheck {
       }
     }
   }
-
-  private static class ConfigNodeConfCheckHolder {
-
-    private static final ConfigNodeStartupCheck INSTANCE = new ConfigNodeStartupCheck();
-
-    private ConfigNodeConfCheckHolder() {
-      // Empty constructor
-    }
-  }
-
-  public static ConfigNodeStartupCheck getInstance() {
-    return ConfigNodeConfCheckHolder.INSTANCE;
-  }
 }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNodeCommandLine.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNodeCommandLine.java
index 76423ec104..2877aead62 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNodeCommandLine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNodeCommandLine.java
@@ -24,7 +24,6 @@ import org.apache.iotdb.commons.conf.IoTDBConstant;
 import org.apache.iotdb.commons.exception.BadNodeUrlException;
 import org.apache.iotdb.commons.exception.ConfigurationException;
 import org.apache.iotdb.commons.exception.StartupException;
-import org.apache.iotdb.commons.service.StartupChecks;
 import org.apache.iotdb.confignode.conf.ConfigNodeRemoveCheck;
 import org.apache.iotdb.confignode.conf.ConfigNodeStartupCheck;
 
@@ -69,11 +68,9 @@ public class ConfigNodeCommandLine extends ServerCommandLine {
     LOGGER.info("Running mode {}", mode);
     if (MODE_START.equals(mode)) {
       try {
-        // Startup environment check
-        StartupChecks checks = new StartupChecks(IoTDBConstant.CN_ROLE).withDefaultTest();
-        checks.verify();
         // Do ConfigNode startup checks
-        ConfigNodeStartupCheck.getInstance().startUpCheck();
+        ConfigNodeStartupCheck checks = new ConfigNodeStartupCheck(IoTDBConstant.CN_ROLE);
+        checks.startUpCheck();
       } catch (StartupException | ConfigurationException | IOException e) {
         LOGGER.error("Meet error when doing start checking", e);
         return -1;
diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
index 26e57fab73..5a92658f90 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
@@ -67,6 +67,8 @@ public class IoTDBClusterNodeErrorStartUpIT {
   private static final String TEST_CLUSTER_NAME = "defaultCluster";
   private static final String ERROR_CLUSTER_NAME = "errorCluster";
 
+  private static final int START_RETRY_NUM = 10;
+
   @Before
   public void setUp() throws Exception {
     EnvFactory.getEnv()
@@ -297,4 +299,49 @@ public class IoTDBClusterNodeErrorStartUpIT {
               Arrays.asList(NodeStatus.Running, NodeStatus.Running));
     }
   }
+
+  @Test
+  public void testIllegalNodeStartUp()
+      throws IOException, ClientManagerException, InterruptedException, TException {
+    ConfigNodeWrapper portConflictConfigNodeWrapper =
+        EnvFactory.getEnv().generateRandomConfigNodeWrapper();
+    DataNodeWrapper portConflictDataNodeWrapper =
+        EnvFactory.getEnv().generateRandomDataNodeWrapper();
+    try (SyncConfigNodeIServiceClient client =
+        (SyncConfigNodeIServiceClient) EnvFactory.getEnv().getLeaderConfigNodeConnection()) {
+      TShowClusterResp showClusterResp = client.showCluster();
+      int beforeStartConfigNodes = showClusterResp.getConfigNodeListSize();
+      int beforeStartDataNodes = showClusterResp.getDataNodeListSize();
+      // set ConfigNode port repeat
+      portConflictConfigNodeWrapper.setConsensusPort(portConflictConfigNodeWrapper.getPort());
+      portConflictConfigNodeWrapper.changeConfig(
+          (MppBaseConfig) EnvFactory.getEnv().getConfig().getConfigNodeConfig(),
+          (MppCommonConfig) EnvFactory.getEnv().getConfig().getConfigNodeCommonConfig(),
+          null);
+      portConflictConfigNodeWrapper.start();
+      int afterStartConfigNodes;
+      for (int i = 0; i < START_RETRY_NUM; ++i) {
+        showClusterResp = client.showCluster();
+        afterStartConfigNodes = showClusterResp.getConfigNodeListSize();
+        Assert.assertEquals(beforeStartConfigNodes, afterStartConfigNodes);
+        Thread.sleep(1000);
+      }
+
+      // set datanode port repeat
+      portConflictDataNodeWrapper.setMppDataExchangePort(
+          portConflictDataNodeWrapper.getDataRegionConsensusPort());
+      portConflictDataNodeWrapper.changeConfig(
+          (MppBaseConfig) EnvFactory.getEnv().getConfig().getDataNodeConfig(),
+          (MppCommonConfig) EnvFactory.getEnv().getConfig().getDataNodeCommonConfig(),
+          null);
+      portConflictDataNodeWrapper.start();
+      int afterStartDataNodes;
+      for (int i = 0; i < START_RETRY_NUM; ++i) {
+        showClusterResp = client.showCluster();
+        afterStartDataNodes = showClusterResp.getDataNodeListSize();
+        Assert.assertEquals(beforeStartDataNodes, afterStartDataNodes);
+        Thread.sleep(1000);
+      }
+    }
+  }
 }
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/service/StartupChecks.java b/node-commons/src/main/java/org/apache/iotdb/commons/service/StartupChecks.java
index 23e9d255d3..cd247bf3b7 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/service/StartupChecks.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/service/StartupChecks.java
@@ -28,10 +28,12 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.List;
 
-public class StartupChecks {
+public abstract class StartupChecks {
 
   private static final Logger logger = LoggerFactory.getLogger(StartupChecks.class);
-  public static final StartupCheck checkJDK =
+
+  private final String nodeRole;
+  private static final StartupCheck checkJDK =
       () -> {
         int version = JVMCommonUtils.getJdkVersion();
         if (version < IoTDBConstant.MIN_SUPPORTED_JDK_VERSION) {
@@ -43,16 +45,14 @@ public class StartupChecks {
           logger.info("JDK version is {}.", version);
         }
       };
-  private final List<StartupCheck> preChecks = new ArrayList<>();
-  private final List<StartupCheck> defaultTests = new ArrayList<>();
+  protected final List<StartupCheck> preChecks = new ArrayList<>();
 
-  public StartupChecks(String nodeRole) {
-    defaultTests.add(() -> checkJMXPort(nodeRole));
-    defaultTests.add(checkJDK);
+  protected StartupChecks(String nodeRole) {
+    this.nodeRole = nodeRole;
   }
 
   private void checkJMXPort(String nodeRole) {
-    Boolean jmxLocal = Boolean.valueOf(System.getProperty(IoTDBConstant.IOTDB_JMX_LOCAL));
+    boolean jmxLocal = Boolean.parseBoolean(System.getProperty(IoTDBConstant.IOTDB_JMX_LOCAL));
     String jmxPort = System.getProperty(IoTDBConstant.IOTDB_JMX_PORT);
 
     if (jmxLocal) {
@@ -66,7 +66,7 @@ public class StartupChecks {
               ? IoTDBConstant.DN_ENV_FILE_NAME
               : IoTDBConstant.CN_ENV_FILE_NAME;
       logger.warn(
-          "{} missing from {}.sh(Unix or OS X, if you use Windows," + " check conf/{}.bat)",
+          "{} missing from {}.sh(Unix or OS X, if you use Windows, check conf/{}.bat)",
           IoTDBConstant.IOTDB_JMX_PORT,
           filename,
           filename);
@@ -76,15 +76,18 @@ public class StartupChecks {
     }
   }
 
-  public StartupChecks withDefaultTest() {
-    preChecks.addAll(defaultTests);
-    return this;
+  protected void envCheck() {
+    preChecks.add(() -> checkJMXPort(nodeRole));
+    preChecks.add(checkJDK);
   }
-
-  /** execute every pretests. */
-  public void verify() throws StartupException {
+  /** execute every pretest. */
+  protected void verify() throws StartupException {
     for (StartupCheck check : preChecks) {
       check.execute();
     }
   }
+
+  protected abstract void portCheck() throws StartupException;
+
+  protected abstract void startUpCheck() throws Exception;
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/DataNodeStartupCheck.java b/server/src/main/java/org/apache/iotdb/db/conf/DataNodeStartupCheck.java
new file mode 100644
index 0000000000..e0147881ee
--- /dev/null
+++ b/server/src/main/java/org/apache/iotdb/db/conf/DataNodeStartupCheck.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+package org.apache.iotdb.db.conf;
+
+import org.apache.iotdb.commons.exception.StartupException;
+import org.apache.iotdb.commons.service.StartupChecks;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * DataNodeStartupCheck checks the parameters in iotdb-datanode.properties when start and restart
+ */
+public class DataNodeStartupCheck extends StartupChecks {
+  private static final Logger LOGGER = LoggerFactory.getLogger(DataNodeStartupCheck.class);
+  private final IoTDBConfig config;
+  private static final int DATANODE_PORTS = 6;
+
+  public DataNodeStartupCheck(String nodeRole, IoTDBConfig config) {
+    super(nodeRole);
+    this.config = config;
+  }
+
+  private void checkDataNodePortUnique() throws StartupException {
+    Set<Integer> portSet = new HashSet<>();
+    portSet.add(config.getInternalPort());
+    portSet.add(config.getMqttPort());
+    portSet.add(config.getRpcPort());
+    portSet.add(config.getMppDataExchangePort());
+    portSet.add(config.getDataRegionConsensusPort());
+    portSet.add(config.getSchemaRegionConsensusPort());
+    if (portSet.size() != DATANODE_PORTS)
+      throw new StartupException("ports used in datanode have repeat.");
+    else {
+      LOGGER.info("DataNode port check successful.");
+    }
+  }
+
+  @Override
+  protected void portCheck() {
+    preChecks.add(this::checkDataNodePortUnique);
+  }
+
+  @Override
+  public void startUpCheck() throws StartupException {
+    envCheck();
+    portCheck();
+    verify();
+  }
+}
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 45959def26..7747bcdd08 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -28,12 +28,10 @@ import org.apache.iotdb.commons.client.exception.ClientManagerException;
 import org.apache.iotdb.commons.concurrent.IoTDBDefaultThreadExceptionHandler;
 import org.apache.iotdb.commons.conf.CommonDescriptor;
 import org.apache.iotdb.commons.conf.IoTDBConstant;
-import org.apache.iotdb.commons.exception.ConfigurationException;
 import org.apache.iotdb.commons.exception.StartupException;
 import org.apache.iotdb.commons.file.SystemFileFactory;
 import org.apache.iotdb.commons.service.JMXService;
 import org.apache.iotdb.commons.service.RegisterManager;
-import org.apache.iotdb.commons.service.StartupChecks;
 import org.apache.iotdb.commons.service.metric.MetricService;
 import org.apache.iotdb.commons.trigger.TriggerInformation;
 import org.apache.iotdb.commons.trigger.exception.TriggerManagementException;
@@ -54,6 +52,7 @@ import org.apache.iotdb.consensus.ConsensusFactory;
 import org.apache.iotdb.db.client.ConfigNodeClient;
 import org.apache.iotdb.db.client.ConfigNodeClientManager;
 import org.apache.iotdb.db.client.ConfigNodeInfo;
+import org.apache.iotdb.db.conf.DataNodeStartupCheck;
 import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.conf.IoTDBStartCheck;
@@ -64,7 +63,6 @@ import org.apache.iotdb.db.engine.StorageEngine;
 import org.apache.iotdb.db.engine.cache.CacheHitRatioMonitor;
 import org.apache.iotdb.db.engine.compaction.schedule.CompactionTaskManager;
 import org.apache.iotdb.db.engine.flush.FlushManager;
-import org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.metadata.schemaregion.SchemaEngine;
 import org.apache.iotdb.db.metadata.template.ClusterTemplateManager;
 import org.apache.iotdb.db.mpp.execution.exchange.MPPDataExchangeService;
@@ -130,6 +128,9 @@ public class DataNode implements DataNodeMBean {
   private final TriggerInformationUpdater triggerInformationUpdater =
       new TriggerInformationUpdater();
 
+  private static final String REGISTER_INTERRUPTION =
+      "Unexpected interruption when waiting to register to the cluster";
+
   private DataNode() {
     // we do not init anything here, so that we can re-initialize the instance in IT.
   }
@@ -141,7 +142,7 @@ public class DataNode implements DataNodeMBean {
   }
 
   public static void main(String[] args) {
-    logger.info("IoTDB-DataNode environment variables: " + IoTDBConfig.getEnvironmentVariables());
+    logger.info("IoTDB-DataNode environment variables: {}", IoTDBConfig.getEnvironmentVariables());
     new DataNodeServerCommandLine().doMain(args);
   }
 
@@ -177,10 +178,10 @@ public class DataNode implements DataNodeMBean {
       // Serialize mutable system properties
       IoTDBStartCheck.getInstance().serializeMutableSystemPropertiesIfNecessary();
 
-      logger.info("IoTDB configuration: " + config.getConfigMessage());
+      logger.info("IoTDB configuration: {}", config.getConfigMessage());
       logger.info("Congratulation, IoTDB DataNode is set up successfully. Now, enjoy yourself!");
 
-    } catch (StartupException | ConfigurationException | IOException e) {
+    } catch (StartupException | IOException e) {
       logger.error("Fail to start server", e);
       if (isFirstStart) {
         // Delete the system.properties file when first start failed.
@@ -192,7 +193,7 @@ public class DataNode implements DataNodeMBean {
   }
 
   /** Prepare cluster IoTDB-DataNode */
-  private boolean prepareDataNode() throws StartupException, ConfigurationException, IOException {
+  private boolean prepareDataNode() throws StartupException, IOException {
     // Set cluster mode
     config.setClusterMode(true);
 
@@ -212,9 +213,8 @@ public class DataNode implements DataNodeMBean {
     thisNode.setPort(config.getInternalPort());
 
     // Startup checks
-    StartupChecks checks = new StartupChecks(IoTDBConstant.DN_ROLE).withDefaultTest();
-    checks.verify();
-
+    DataNodeStartupCheck checks = new DataNodeStartupCheck(IoTDBConstant.DN_ROLE, config);
+    checks.startUpCheck();
     return isFirstStart;
   }
 
@@ -254,8 +254,8 @@ public class DataNode implements DataNodeMBean {
         Thread.sleep(DEFAULT_RETRY_INTERVAL_IN_MS);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
-        logger.warn("Unexpected interruption when waiting to register to the cluster", e);
-        break;
+        logger.warn(REGISTER_INTERRUPTION, e);
+        retry = -1;
       }
     }
     if (configurationResp == null) {
@@ -364,8 +364,8 @@ public class DataNode implements DataNodeMBean {
         Thread.sleep(DEFAULT_RETRY_INTERVAL_IN_MS);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
-        logger.warn("Unexpected interruption when waiting to register to the cluster", e);
-        break;
+        logger.warn(REGISTER_INTERRUPTION, e);
+        retry = -1;
       }
     }
     if (dataNodeRegisterResp == null) {
@@ -424,8 +424,8 @@ public class DataNode implements DataNodeMBean {
         Thread.sleep(DEFAULT_RETRY_INTERVAL_IN_MS);
       } catch (InterruptedException e) {
         Thread.currentThread().interrupt();
-        logger.warn("Unexpected interruption when waiting to register to the cluster", e);
-        break;
+        logger.warn(REGISTER_INTERRUPTION, e);
+        retry = -1;
       }
     }
     if (dataNodeRestartResp == null) {
@@ -458,7 +458,7 @@ public class DataNode implements DataNodeMBean {
     try {
       processPid();
       setUp();
-    } catch (StartupException | QueryProcessException e) {
+    } catch (StartupException e) {
       logger.error("Meet error while starting up.", e);
       throw new StartupException("Error in activating IoTDB DataNode.");
     }
@@ -479,7 +479,7 @@ public class DataNode implements DataNodeMBean {
     }
   }
 
-  private void setUp() throws StartupException, QueryProcessException {
+  private void setUp() throws StartupException {
     logger.info("Setting up IoTDB DataNode...");
     registerManager.register(new JMXService());
     JMXService.registerMBean(getInstance(), mbeanName);
@@ -859,7 +859,6 @@ public class DataNode implements DataNodeMBean {
   private void deactivate() {
     logger.info("Deactivating IoTDB DataNode...");
     stopTriggerRelatedServices();
-    // stopThreadPools();
     registerManager.deregisterAll();
     JMXService.deregisterMBean(mbeanName);
     logger.info("IoTDB DataNode is deactivated.");


[iotdb] 02/13: [To rel/1.1] Fix dispatch result collection logic (#9323)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 4a5b900419eec61171a315c9f6e586487948fa55
Author: Marcos_Zyk <38...@users.noreply.github.com>
AuthorDate: Thu Mar 16 16:15:10 2023 +0800

    [To rel/1.1] Fix dispatch result collection logic (#9323)
---
 .../execution/executor/RegionWriteExecutor.java    | 149 ++++++++-------------
 .../metedata/write/CreateMultiTimeSeriesNode.java  |   6 +-
 .../plan/node/metedata/write/MeasurementGroup.java |  36 ++---
 .../db/mpp/plan/scheduler/AsyncPlanNodeSender.java |  34 +++++
 .../scheduler/FragmentInstanceDispatcherImpl.java  |  32 ++++-
 5 files changed, 132 insertions(+), 125 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
index 71e870cc67..69ca7a4f3b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
@@ -462,53 +462,10 @@ public class RegionWriteExecutor {
           }
           measurementGroup.removeMeasurements(failingMeasurementMap.keySet());
 
-          RegionExecutionResult executionResult =
-              super.visitInternalCreateTimeSeries(node, context);
-
-          if (failingStatus.isEmpty() && alreadyExistingStatus.isEmpty()) {
-            return executionResult;
-          }
-
-          TSStatus executionStatus = executionResult.getStatus();
-
-          // separate the measurement_already_exist exception and other exceptions process,
-          // measurement_already_exist exception is acceptable due to concurrent timeseries creation
-          if (failingStatus.isEmpty()) {
-            if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-              if (executionStatus.getSubStatus().get(0).getCode()
-                  == TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
-                // there's only measurement_already_exist exception
-                alreadyExistingStatus.addAll(executionStatus.getSubStatus());
-              } else {
-                failingStatus.addAll(executionStatus.getSubStatus());
-              }
-            } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-              failingStatus.add(executionStatus);
-            }
-          } else {
-            if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-              if (executionStatus.getSubStatus().get(0).getCode()
-                  != TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
-                failingStatus.addAll(executionStatus.getSubStatus());
-              }
-            } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-              failingStatus.add(executionStatus);
-            }
-          }
-
-          RegionExecutionResult result = new RegionExecutionResult();
-          TSStatus status;
-          if (failingStatus.isEmpty()) {
-            status = RpcUtils.getStatus(alreadyExistingStatus);
-            result.setAccepted(true);
-          } else {
-            status = RpcUtils.getStatus(failingStatus);
-            result.setAccepted(false);
-          }
-
-          result.setMessage(status.getMessage());
-          result.setStatus(status);
-          return result;
+          return processExecutionResultOfInternalCreateSchema(
+              super.visitInternalCreateTimeSeries(node, context),
+              failingStatus,
+              alreadyExistingStatus);
         } finally {
           context.getRegionWriteValidationRWLock().writeLock().unlock();
         }
@@ -562,59 +519,65 @@ public class RegionWriteExecutor {
             measurementGroup.removeMeasurements(failingMeasurementMap.keySet());
           }
 
-          RegionExecutionResult executionResult =
-              super.visitInternalCreateMultiTimeSeries(node, context);
-
-          if (failingStatus.isEmpty() && alreadyExistingStatus.isEmpty()) {
-            return executionResult;
-          }
-
-          TSStatus executionStatus = executionResult.getStatus();
+          return processExecutionResultOfInternalCreateSchema(
+              super.visitInternalCreateMultiTimeSeries(node, context),
+              failingStatus,
+              alreadyExistingStatus);
+        } finally {
+          context.getRegionWriteValidationRWLock().writeLock().unlock();
+        }
+      } else {
+        return super.visitInternalCreateMultiTimeSeries(node, context);
+      }
+    }
 
-          // separate the measurement_already_exist exception and other exceptions process,
-          // measurement_already_exist exception is acceptable due to concurrent timeseries creation
-          if (failingStatus.isEmpty()) {
-            if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-              if (executionStatus.getSubStatus().get(0).getCode()
-                  == TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
-                // there's only measurement_already_exist exception
-                alreadyExistingStatus.addAll(executionStatus.getSubStatus());
-              } else {
-                failingStatus.addAll(executionStatus.getSubStatus());
-              }
-            } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-              failingStatus.add(executionStatus);
-            }
+    private RegionExecutionResult processExecutionResultOfInternalCreateSchema(
+        RegionExecutionResult executionResult,
+        List<TSStatus> failingStatus,
+        List<TSStatus> alreadyExistingStatus) {
+      TSStatus executionStatus = executionResult.getStatus();
+
+      // separate the measurement_already_exist exception and other exceptions process,
+      // measurement_already_exist exception is acceptable due to concurrent timeseries creation
+      if (failingStatus.isEmpty()) {
+        if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
+          if (executionStatus.getSubStatus().get(0).getCode()
+              == TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
+            // there's only measurement_already_exist exception
+            alreadyExistingStatus.addAll(executionStatus.getSubStatus());
           } else {
-            if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
-              if (executionStatus.getSubStatus().get(0).getCode()
-                  != TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
-                failingStatus.addAll(executionStatus.getSubStatus());
-              }
-            } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
-              failingStatus.add(executionStatus);
-            }
+            failingStatus.addAll(executionStatus.getSubStatus());
           }
-
-          RegionExecutionResult result = new RegionExecutionResult();
-          TSStatus status;
-          if (failingStatus.isEmpty()) {
-            status = RpcUtils.getStatus(alreadyExistingStatus);
-            result.setAccepted(true);
-          } else {
-            status = RpcUtils.getStatus(failingStatus);
-            result.setAccepted(false);
+        } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          failingStatus.add(executionStatus);
+        }
+      } else {
+        if (executionStatus.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
+          if (executionStatus.getSubStatus().get(0).getCode()
+              != TSStatusCode.TIMESERIES_ALREADY_EXIST.getStatusCode()) {
+            failingStatus.addAll(executionStatus.getSubStatus());
           }
-
-          result.setMessage(status.getMessage());
-          result.setStatus(status);
-          return result;
-        } finally {
-          context.getRegionWriteValidationRWLock().writeLock().unlock();
+        } else if (executionStatus.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          failingStatus.add(executionStatus);
         }
+      }
+
+      RegionExecutionResult result = new RegionExecutionResult();
+      TSStatus status;
+      if (failingStatus.isEmpty() && alreadyExistingStatus.isEmpty()) {
+        status = RpcUtils.SUCCESS_STATUS;
+        result.setAccepted(true);
+      } else if (failingStatus.isEmpty()) {
+        status = RpcUtils.getStatus(alreadyExistingStatus);
+        result.setAccepted(true);
       } else {
-        return super.visitInternalCreateMultiTimeSeries(node, context);
+        status = RpcUtils.getStatus(failingStatus);
+        result.setAccepted(false);
       }
+
+      result.setMessage(status.getMessage());
+      result.setStatus(status);
+      return result;
     }
 
     @Override
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/CreateMultiTimeSeriesNode.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/CreateMultiTimeSeriesNode.java
index a739020e30..32445aee12 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/CreateMultiTimeSeriesNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/CreateMultiTimeSeriesNode.java
@@ -83,8 +83,10 @@ public class CreateMultiTimeSeriesNode extends WritePlanNode {
         measurementGroupMap.put(devicePath, measurementGroup);
       }
 
-      measurementGroup.addMeasurement(
-          paths.get(i).getMeasurement(), dataTypes.get(i), encodings.get(i), compressors.get(i));
+      if (!measurementGroup.addMeasurement(
+          paths.get(i).getMeasurement(), dataTypes.get(i), encodings.get(i), compressors.get(i))) {
+        continue;
+      }
 
       if (propsList != null) {
         measurementGroup.addProps(propsList.get(i));
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/MeasurementGroup.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/MeasurementGroup.java
index f5bd2ccc52..5123f0ba0b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/MeasurementGroup.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/planner/plan/node/metedata/write/MeasurementGroup.java
@@ -28,6 +28,7 @@ import java.io.DataOutputStream;
 import java.io.IOException;
 import java.nio.ByteBuffer;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -44,6 +45,8 @@ public class MeasurementGroup {
   private List<Map<String, String>> tagsList;
   private List<Map<String, String>> attributesList;
 
+  private final transient Set<String> measurementSet = new HashSet<>();
+
   public List<String> getMeasurements() {
     return measurements;
   }
@@ -80,15 +83,20 @@ public class MeasurementGroup {
     return attributesList;
   }
 
-  public void addMeasurement(
+  public boolean addMeasurement(
       String measurement,
       TSDataType dataType,
       TSEncoding encoding,
       CompressionType compressionType) {
+    if (measurementSet.contains(measurement)) {
+      return false;
+    }
     measurements.add(measurement);
+    measurementSet.add(measurement);
     dataTypes.add(dataType);
     encodings.add(encoding);
     compressors.add(compressionType);
+    return true;
   }
 
   public void addAlias(String alias) {
@@ -119,29 +127,6 @@ public class MeasurementGroup {
     attributesList.add(attributes);
   }
 
-  public void removeMeasurement(int index) {
-    measurements.remove(index);
-    dataTypes.remove(index);
-    encodings.remove(index);
-    compressors.remove(index);
-
-    if (aliasList != null) {
-      aliasList.remove(index);
-    }
-
-    if (propsList != null) {
-      propsList.remove(index);
-    }
-
-    if (tagsList != null) {
-      tagsList.remove(index);
-    }
-
-    if (attributesList != null) {
-      attributesList.remove(index);
-    }
-  }
-
   public void removeMeasurements(Set<Integer> indexSet) {
     int restSize = this.measurements.size() - indexSet.size();
     List<String> measurements = new ArrayList<>(restSize);
@@ -156,6 +141,7 @@ public class MeasurementGroup {
 
     for (int i = 0; i < this.measurements.size(); i++) {
       if (indexSet.contains(i)) {
+        measurementSet.remove(this.measurements.get(i));
         continue;
       }
       measurements.add(this.measurements.get(i));
@@ -217,6 +203,7 @@ public class MeasurementGroup {
     MeasurementGroup subMeasurementGroup;
     subMeasurementGroup = new MeasurementGroup();
     subMeasurementGroup.measurements = measurements.subList(startIndex, endIndex);
+    subMeasurementGroup.measurementSet.addAll(subMeasurementGroup.measurements);
     subMeasurementGroup.dataTypes = dataTypes.subList(startIndex, endIndex);
     subMeasurementGroup.encodings = encodings.subList(startIndex, endIndex);
     subMeasurementGroup.compressors = compressors.subList(startIndex, endIndex);
@@ -359,6 +346,7 @@ public class MeasurementGroup {
     for (int i = 0; i < size; i++) {
       measurements.add(ReadWriteIOUtils.readString(byteBuffer));
     }
+    measurementSet.addAll(measurements);
 
     dataTypes = new ArrayList<>();
     for (int i = 0; i < size; i++) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AsyncPlanNodeSender.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AsyncPlanNodeSender.java
index f19de2323f..29a5f80f62 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AsyncPlanNodeSender.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/AsyncPlanNodeSender.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.mpp.plan.scheduler;
 
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
+import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.client.IClientManager;
 import org.apache.iotdb.commons.client.async.AsyncDataNodeInternalServiceClient;
 import org.apache.iotdb.db.mpp.plan.planner.plan.FragmentInstance;
@@ -32,6 +33,7 @@ import org.apache.iotdb.rpc.TSStatusCode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
@@ -87,6 +89,38 @@ public class AsyncPlanNodeSender {
     }
   }
 
+  public List<TSStatus> getFailureStatusList() {
+    List<TSStatus> failureStatusList = new ArrayList<>();
+    TSStatus status;
+    for (Map.Entry<Integer, TSendPlanNodeResp> entry : instanceId2RespMap.entrySet()) {
+      status = entry.getValue().getStatus();
+      if (!entry.getValue().accepted) {
+        if (status == null) {
+          logger.warn(
+              "dispatch write failed. message: {}, node {}",
+              entry.getValue().message,
+              instances.get(entry.getKey()).getHostDataNode().getInternalEndPoint());
+          failureStatusList.add(
+              RpcUtils.getStatus(TSStatusCode.WRITE_PROCESS_ERROR, entry.getValue().getMessage()));
+        } else {
+          logger.warn(
+              "dispatch write failed. status: {}, code: {}, message: {}, node {}",
+              entry.getValue().status,
+              TSStatusCode.representOf(status.code),
+              entry.getValue().message,
+              instances.get(entry.getKey()).getHostDataNode().getInternalEndPoint());
+          failureStatusList.add(status);
+        }
+      } else {
+        // some expected and accepted status except SUCCESS_STATUS need to be returned
+        if (status != null && status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
+          failureStatusList.add(status);
+        }
+      }
+    }
+    return failureStatusList;
+  }
+
   public Future<FragInstanceDispatchResult> getResult() {
     for (Map.Entry<Integer, TSendPlanNodeResp> entry : instanceId2RespMap.entrySet()) {
       if (!entry.getValue().accepted) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
index 3226884b56..0719b86452 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/plan/scheduler/FragmentInstanceDispatcherImpl.java
@@ -177,19 +177,21 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
     AsyncPlanNodeSender asyncPlanNodeSender =
         new AsyncPlanNodeSender(asyncInternalServiceClientManager, remoteInstances);
     asyncPlanNodeSender.sendAll();
+
+    List<TSStatus> dataNodeFailureList = new ArrayList<>();
+
     // sync dispatch to local
     long localScheduleStartTime = System.nanoTime();
     for (FragmentInstance localInstance : localInstances) {
       try (SetThreadName threadName = new SetThreadName(localInstance.getId().getFullId())) {
         dispatchOneInstance(localInstance);
       } catch (FragmentInstanceDispatchException e) {
-        return immediateFuture(new FragInstanceDispatchResult(e.getFailureStatus()));
+        dataNodeFailureList.add(e.getFailureStatus());
       } catch (Throwable t) {
         logger.warn("[DispatchFailed]", t);
-        return immediateFuture(
-            new FragInstanceDispatchResult(
-                RpcUtils.getStatus(
-                    TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage())));
+        dataNodeFailureList.add(
+            RpcUtils.getStatus(
+                TSStatusCode.INTERNAL_SERVER_ERROR, "Unexpected errors: " + t.getMessage()));
       }
     }
     PerformanceOverviewMetricsManager.recordScheduleLocalCost(
@@ -205,7 +207,25 @@ public class FragmentInstanceDispatcherImpl implements IFragInstanceDispatcher {
               RpcUtils.getStatus(
                   TSStatusCode.INTERNAL_SERVER_ERROR, "Interrupted errors: " + e.getMessage())));
     }
-    return asyncPlanNodeSender.getResult();
+
+    dataNodeFailureList.addAll(asyncPlanNodeSender.getFailureStatusList());
+
+    if (dataNodeFailureList.isEmpty()) {
+      return immediateFuture(new FragInstanceDispatchResult(true));
+    }
+    if (instances.size() == 1) {
+      return immediateFuture(new FragInstanceDispatchResult(dataNodeFailureList.get(0)));
+    } else {
+      List<TSStatus> failureStatusList = new ArrayList<>();
+      for (TSStatus dataNodeFailure : dataNodeFailureList) {
+        if (dataNodeFailure.getCode() == TSStatusCode.MULTIPLE_ERROR.getStatusCode()) {
+          failureStatusList.addAll(dataNodeFailure.getSubStatus());
+        } else {
+          failureStatusList.add(dataNodeFailure);
+        }
+      }
+      return immediateFuture(new FragInstanceDispatchResult(RpcUtils.getStatus(failureStatusList)));
+    }
   }
 
   private void dispatchOneInstance(FragmentInstance instance)


[iotdb] 13/13: [IOTDB-5681] Fix the creation of system database used by IoTDB Internal Reporter (#9339) (#9378)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 9493bbc15bbe1b8a1ee7eb4fdcd50cf848199b9d
Author: ZhangHongYin <46...@users.noreply.github.com>
AuthorDate: Mon Mar 20 09:23:37 2023 +0800

    [IOTDB-5681] Fix the creation of system database used by IoTDB Internal Reporter (#9339) (#9378)
    
    (cherry picked from commit be23689cceab4ab8eeb0d27fcdab49b1ed693edd)
---
 .../metrics/IoTDBInternalLocalReporter.java        | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java b/server/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java
index 2714387735..a275bbad6a 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java
@@ -19,8 +19,17 @@
 
 package org.apache.iotdb.db.service.metrics;
 
+import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.commons.client.IClientManager;
+import org.apache.iotdb.commons.client.exception.ClientManagerException;
 import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
+import org.apache.iotdb.commons.consensus.ConfigRegionId;
 import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.confignode.rpc.thrift.TDatabaseSchema;
+import org.apache.iotdb.confignode.rpc.thrift.TShowDatabaseResp;
+import org.apache.iotdb.db.client.ConfigNodeClient;
+import org.apache.iotdb.db.client.ConfigNodeClientManager;
+import org.apache.iotdb.db.client.ConfigNodeInfo;
 import org.apache.iotdb.db.exception.query.QueryProcessException;
 import org.apache.iotdb.db.mpp.common.SessionInfo;
 import org.apache.iotdb.db.mpp.plan.Coordinator;
@@ -35,6 +44,7 @@ import org.apache.iotdb.db.query.control.SessionManager;
 import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
 import org.apache.iotdb.metrics.reporter.iotdb.IoTDBInternalReporter;
 import org.apache.iotdb.metrics.utils.InternalReporterType;
+import org.apache.iotdb.metrics.utils.IoTDBMetricsUtils;
 import org.apache.iotdb.metrics.utils.ReporterType;
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.TSStatusCode;
@@ -42,12 +52,14 @@ import org.apache.iotdb.service.rpc.thrift.TSInsertRecordReq;
 import org.apache.iotdb.session.util.SessionUtils;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 
+import org.apache.thrift.TException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.nio.ByteBuffer;
 import java.time.ZoneId;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.Executors;
@@ -69,6 +81,31 @@ public class IoTDBInternalLocalReporter extends IoTDBInternalReporter {
     partitionFetcher = ClusterPartitionFetcher.getInstance();
     schemaFetcher = ClusterSchemaFetcher.getInstance();
     sessionInfo = new SessionInfo(0, "root", ZoneId.systemDefault().getId());
+
+    IClientManager<ConfigRegionId, ConfigNodeClient> configNodeClientManager =
+        ConfigNodeClientManager.getInstance();
+    try (ConfigNodeClient client =
+        configNodeClientManager.borrowClient(ConfigNodeInfo.CONFIG_REGION_ID)) {
+      TShowDatabaseResp showDatabaseResp =
+          client.showDatabase(Arrays.asList(IoTDBMetricsUtils.DATABASE.split("\\.")));
+      if (TSStatusCode.SUCCESS_STATUS.getStatusCode() == showDatabaseResp.getStatus().getCode()
+          && showDatabaseResp.getDatabaseInfoMapSize() == 0) {
+        TDatabaseSchema databaseSchema = new TDatabaseSchema();
+        databaseSchema.setName(IoTDBMetricsUtils.DATABASE);
+        databaseSchema.setSchemaReplicationFactor(1);
+        databaseSchema.setDataReplicationFactor(1);
+        databaseSchema.setMaxSchemaRegionGroupNum(1);
+        databaseSchema.setMinSchemaRegionGroupNum(1);
+        databaseSchema.setMaxDataRegionGroupNum(1);
+        TSStatus tsStatus = client.setDatabase(databaseSchema);
+        if (TSStatusCode.SUCCESS_STATUS.getStatusCode() != tsStatus.getCode()) {
+          LOGGER.error("IoTDBSessionReporter checkOrCreateDatabase failed.");
+        }
+      }
+    } catch (ClientManagerException | TException e) {
+      // do nothing
+      LOGGER.warn("IoTDBSessionReporter checkOrCreateDatabase failed because ", e);
+    }
   }
 
   @Override


[iotdb] 12/13: [To rel/1.1][IOTDB-5618] Add RatisConsensus metrics in dashboard (#9369)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit f5ce7762e6c5b0c5dce357d70e7fbac09d68f81e
Author: Xiangpeng Hu <65...@users.noreply.github.com>
AuthorDate: Sun Mar 19 22:12:22 2023 +0800

    [To rel/1.1][IOTDB-5618] Add RatisConsensus metrics in dashboard (#9369)
---
 .../manager/consensus/ConsensusManager.java        |    3 -
 .../iotdb/consensus/config/ConsensusConfig.java    |   15 -
 .../ratis/ApplicationStateMachineProxy.java        |   30 +-
 .../iotdb/consensus/ratis/RatisConsensus.java      |   31 +-
 .../org/apache/iotdb/consensus/ratis/Utils.java    |   15 +
 .../ratis/metrics/IoTDBMetricRegistry.java         |   65 +-
 .../ratis/metrics/MetricRegistryManager.java       |   13 +-
 .../consensus/ratis/metrics/RatisMetricSet.java    |   79 +-
 .../ratis/metrics/RatisMetricsManager.java         |   84 +
 .../apache/iotdb/consensus/iot/ReplicateTest.java  |    2 -
 .../apache/iotdb/consensus/iot/StabilityTest.java  |    2 -
 .../iotdb/consensus/ratis/RatisConsensusTest.java  |    2 -
 .../apache/iotdb/consensus/ratis/SnapshotTest.java |   11 +-
 .../iotdb/consensus/simple/RecoveryTest.java       |    2 -
 .../Apache-IoTDB-ConfigNode-Dashboard.json         | 3837 +++++----
 .../Apache-IoTDB-DataNode-Dashboard.json           | 8781 +++++++++++---------
 docs/UserGuide/Monitor-Alert/Metric-Tool.md        |   77 +-
 docs/zh/UserGuide/Monitor-Alert/Metric-Tool.md     |   60 +-
 .../iotdb/commons/service/metric/enums/Metric.java |    2 +
 .../db/consensus/DataRegionConsensusImpl.java      |    2 -
 .../db/consensus/SchemaRegionConsensusImpl.java    |    2 -
 21 files changed, 7463 insertions(+), 5652 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
index a767d05c9c..16302fac47 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
@@ -20,7 +20,6 @@
 package org.apache.iotdb.confignode.manager.consensus;
 
 import org.apache.iotdb.common.rpc.thrift.TConfigNodeLocation;
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.consensus.ConfigRegionId;
@@ -92,7 +91,6 @@ public class ConsensusManager {
                       .setThisNode(
                           new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort()))
                       .setStorageDir(CONF.getConsensusDir())
-                      .setConsensusGroupType(TConsensusGroupType.ConfigRegion)
                       .build(),
                   gid -> stateMachine)
               .orElseThrow(
@@ -181,7 +179,6 @@ public class ConsensusManager {
                                       .build())
                               .build())
                       .setStorageDir(CONF.getConsensusDir())
-                      .setConsensusGroupType(TConsensusGroupType.ConfigRegion)
                       .build(),
                   gid -> stateMachine)
               .orElseThrow(
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/config/ConsensusConfig.java b/consensus/src/main/java/org/apache/iotdb/consensus/config/ConsensusConfig.java
index 36aa9fa937..92db8f8a84 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/config/ConsensusConfig.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/config/ConsensusConfig.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.consensus.config;
 
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 
 import java.util.Optional;
@@ -29,7 +28,6 @@ public class ConsensusConfig {
   private final TEndPoint thisNodeEndPoint;
   private final int thisNodeId;
   private final String storageDir;
-  private final TConsensusGroupType consensusGroupType;
   private final RatisConfig ratisConfig;
   private final IoTConsensusConfig ioTConsensusConfig;
 
@@ -37,13 +35,11 @@ public class ConsensusConfig {
       TEndPoint thisNode,
       int thisNodeId,
       String storageDir,
-      TConsensusGroupType consensusGroupType,
       RatisConfig ratisConfig,
       IoTConsensusConfig ioTConsensusConfig) {
     this.thisNodeEndPoint = thisNode;
     this.thisNodeId = thisNodeId;
     this.storageDir = storageDir;
-    this.consensusGroupType = consensusGroupType;
     this.ratisConfig = ratisConfig;
     this.ioTConsensusConfig = ioTConsensusConfig;
   }
@@ -60,10 +56,6 @@ public class ConsensusConfig {
     return storageDir;
   }
 
-  public TConsensusGroupType getConsensusGroupType() {
-    return consensusGroupType;
-  }
-
   public RatisConfig getRatisConfig() {
     return ratisConfig;
   }
@@ -81,7 +73,6 @@ public class ConsensusConfig {
     private TEndPoint thisNode;
     private int thisNodeId;
     private String storageDir;
-    private TConsensusGroupType consensusGroupType;
     private RatisConfig ratisConfig;
     private IoTConsensusConfig ioTConsensusConfig;
 
@@ -90,7 +81,6 @@ public class ConsensusConfig {
           thisNode,
           thisNodeId,
           storageDir,
-          consensusGroupType,
           Optional.ofNullable(ratisConfig).orElseGet(() -> RatisConfig.newBuilder().build()),
           Optional.ofNullable(ioTConsensusConfig)
               .orElseGet(() -> IoTConsensusConfig.newBuilder().build()));
@@ -111,11 +101,6 @@ public class ConsensusConfig {
       return this;
     }
 
-    public Builder setConsensusGroupType(TConsensusGroupType consensusGroupType) {
-      this.consensusGroupType = consensusGroupType;
-      return this;
-    }
-
     public Builder setRatisConfig(RatisConfig ratisConfig) {
       this.ratisConfig = ratisConfig;
       return this;
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
index da94ded6b0..b256079623 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/ApplicationStateMachineProxy.java
@@ -27,6 +27,7 @@ import org.apache.iotdb.consensus.IStateMachine;
 import org.apache.iotdb.consensus.common.DataSet;
 import org.apache.iotdb.consensus.common.request.ByteBufferConsensusRequest;
 import org.apache.iotdb.consensus.common.request.IConsensusRequest;
+import org.apache.iotdb.consensus.ratis.metrics.RatisMetricsManager;
 import org.apache.iotdb.metrics.utils.MetricLevel;
 
 import org.apache.ratis.proto.RaftProtos;
@@ -60,6 +61,7 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
   private final IStateMachine.RetryPolicy retryPolicy;
   private final SnapshotStorage snapshotStorage;
   private final RaftGroupId groupId;
+  private final String consensusGroupType;
 
   public ApplicationStateMachineProxy(IStateMachine stateMachine, RaftGroupId id) {
     applicationStateMachine = stateMachine;
@@ -69,6 +71,7 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
             ? (IStateMachine.RetryPolicy) applicationStateMachine
             : new IStateMachine.RetryPolicy() {};
     snapshotStorage = new SnapshotStorage(applicationStateMachine, groupId);
+    consensusGroupType = Utils.getConsensusGroupTypeFromPrefix(groupId.toString());
     applicationStateMachine.start();
   }
 
@@ -109,6 +112,7 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
   @Override
   public CompletableFuture<Message> applyTransaction(TransactionContext trx) {
     boolean isLeader = false;
+    long writeToStateMachineStartTime = System.nanoTime();
     RaftProtos.LogEntryProto log = trx.getLogEntry();
     updateLastAppliedTermIndex(log.getTerm(), log.getIndex());
 
@@ -140,18 +144,7 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
         IConsensusRequest deserializedRequest =
             applicationStateMachine.deserializeRequest(applicationRequest);
 
-        long startWriteTime = System.nanoTime();
         TSStatus result = applicationStateMachine.write(deserializedRequest);
-        if (isLeader) {
-          MetricService.getInstance()
-              .timer(
-                  System.nanoTime() - startWriteTime,
-                  TimeUnit.NANOSECONDS,
-                  Metric.PERFORMANCE_OVERVIEW_STORAGE_DETAIL.toString(),
-                  MetricLevel.IMPORTANT,
-                  Tag.STAGE.toString(),
-                  PerformanceOverviewMetrics.ENGINE);
-        }
 
         if (firstTry) {
           finalStatus = result;
@@ -179,7 +172,20 @@ public class ApplicationStateMachineProxy extends BaseStateMachine {
         }
       }
     } while (shouldRetry);
-
+    if (isLeader) {
+      MetricService.getInstance()
+          .timer(
+              System.nanoTime() - writeToStateMachineStartTime,
+              TimeUnit.NANOSECONDS,
+              Metric.PERFORMANCE_OVERVIEW_STORAGE_DETAIL.toString(),
+              MetricLevel.IMPORTANT,
+              Tag.STAGE.toString(),
+              PerformanceOverviewMetrics.ENGINE);
+      // statistic the time of write stateMachine
+      RatisMetricsManager.getInstance()
+          .recordWriteStateMachineCost(
+              System.nanoTime() - writeToStateMachineStartTime, consensusGroupType);
+    }
     return CompletableFuture.completedFuture(ret);
   }
 
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
index c80ae31fb1..38242b56d4 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/RatisConsensus.java
@@ -50,6 +50,7 @@ import org.apache.iotdb.consensus.exception.PeerAlreadyInConsensusGroupException
 import org.apache.iotdb.consensus.exception.PeerNotInConsensusGroupException;
 import org.apache.iotdb.consensus.exception.RatisRequestFailedException;
 import org.apache.iotdb.consensus.ratis.metrics.RatisMetricSet;
+import org.apache.iotdb.consensus.ratis.metrics.RatisMetricsManager;
 
 import org.apache.commons.pool2.KeyedObjectPool;
 import org.apache.commons.pool2.impl.GenericKeyedObjectPool;
@@ -125,6 +126,8 @@ class RatisConsensus implements IConsensus {
 
   private final RatisMetricSet ratisMetricSet;
 
+  private String consensusGroupType = null;
+
   public RatisConsensus(ConsensusConfig config, IStateMachine.Registry registry)
       throws IOException {
     myself =
@@ -141,8 +144,7 @@ class RatisConsensus implements IConsensus {
 
     Utils.initRatisConfig(properties, config.getRatisConfig());
     this.config = config.getRatisConfig();
-
-    this.ratisMetricSet = new RatisMetricSet(config.getConsensusGroupType());
+    this.ratisMetricSet = new RatisMetricSet();
 
     clientManager =
         new IClientManager.Factory<RaftGroup, RatisClient>()
@@ -235,7 +237,6 @@ class RatisConsensus implements IConsensus {
   @Override
   public ConsensusWriteResponse write(
       ConsensusGroupId consensusGroupId, IConsensusRequest IConsensusRequest) {
-
     // pre-condition: group exists and myself server serves this group
     RaftGroupId raftGroupId = Utils.fromConsensusGroupIdToRaftGroupId(consensusGroupId);
     RaftGroup raftGroup = getGroupInfo(raftGroupId);
@@ -259,6 +260,8 @@ class RatisConsensus implements IConsensus {
     // 1. first try the local server
     RaftClientRequest clientRequest =
         buildRawRequest(raftGroupId, message, RaftClientRequest.writeRequestType());
+
+    long writeToRatisStartTime = System.nanoTime();
     RaftClientReply localServerReply;
     RaftPeer suggestedLeader = null;
     if (isLeader(consensusGroupId) && waitUntilLeaderReady(raftGroupId)) {
@@ -275,6 +278,13 @@ class RatisConsensus implements IConsensus {
         }
       } catch (IOException e) {
         return failedWrite(new RatisRequestFailedException(e));
+      } finally {
+        if (consensusGroupType == null) {
+          consensusGroupType = Utils.getConsensusGroupTypeFromPrefix(raftGroupId.toString());
+        }
+        // statistic the time of write locally
+        RatisMetricsManager.getInstance()
+            .recordWriteLocallyCost(System.nanoTime() - writeToRatisStartTime, consensusGroupType);
       }
     }
 
@@ -294,13 +304,18 @@ class RatisConsensus implements IConsensus {
       if (client != null) {
         client.returnSelf();
       }
+      if (consensusGroupType == null) {
+        consensusGroupType = Utils.getConsensusGroupTypeFromPrefix(raftGroupId.toString());
+      }
+      // statistic the time of write remotely
+      RatisMetricsManager.getInstance()
+          .recordWriteRemotelyCost(System.nanoTime() - writeToRatisStartTime, consensusGroupType);
     }
 
     if (suggestedLeader != null) {
       TEndPoint leaderEndPoint = Utils.fromRaftPeerAddressToTEndPoint(suggestedLeader.getAddress());
       writeResult.setRedirectNode(new TEndPoint(leaderEndPoint.getIp(), leaderEndPoint.getPort()));
     }
-
     return ConsensusWriteResponse.newBuilder().setStatus(writeResult).build();
   }
 
@@ -319,7 +334,14 @@ class RatisConsensus implements IConsensus {
       RequestMessage message = new RequestMessage(IConsensusRequest);
       RaftClientRequest clientRequest =
           buildRawRequest(groupId, message, RaftClientRequest.staleReadRequestType(-1));
+      long readRatisStartTime = System.nanoTime();
       reply = server.submitClientRequest(clientRequest);
+      if (consensusGroupType == null) {
+        consensusGroupType = Utils.getConsensusGroupTypeFromPrefix(groupId.toString());
+      }
+      // statistic the time of submit read request
+      RatisMetricsManager.getInstance()
+          .recordReadRequestCost(System.nanoTime() - readRatisStartTime, consensusGroupType);
       if (!reply.isSuccess()) {
         return failedRead(new RatisRequestFailedException(reply.getException()));
       }
@@ -330,7 +352,6 @@ class RatisConsensus implements IConsensus {
     Message ret = reply.getMessage();
     ResponseMessage readResponseMessage = (ResponseMessage) ret;
     DataSet dataSet = (DataSet) readResponseMessage.getContentHolder();
-
     return ConsensusReadResponse.newBuilder().setDataSet(dataSet).build();
   }
 
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
index 941dfc76f8..7d7954a530 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/Utils.java
@@ -18,6 +18,7 @@
  */
 package org.apache.iotdb.consensus.ratis;
 
+import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
@@ -47,6 +48,8 @@ import java.util.stream.Collectors;
 public class Utils {
   private static final int TEMP_BUFFER_SIZE = 1024;
   private static final byte PADDING_MAGIC = 0x47;
+  private static final String DATA_REGION_GROUP = "group-0001";
+  private static final String SCHEMA_REGION_GROUP = "group-0002";
 
   private Utils() {}
 
@@ -174,6 +177,18 @@ public class Utils {
     return TermIndex.valueOf(Long.parseLong(items[0]), Long.parseLong(items[1]));
   }
 
+  public static String getConsensusGroupTypeFromPrefix(String prefix) {
+    TConsensusGroupType consensusGroupType;
+    if (prefix.contains(DATA_REGION_GROUP)) {
+      consensusGroupType = TConsensusGroupType.DataRegion;
+    } else if (prefix.contains(SCHEMA_REGION_GROUP)) {
+      consensusGroupType = TConsensusGroupType.SchemaRegion;
+    } else {
+      consensusGroupType = TConsensusGroupType.ConfigRegion;
+    }
+    return consensusGroupType.toString();
+  }
+
   public static void initRatisConfig(RaftProperties properties, RatisConfig config) {
     GrpcConfigKeys.setMessageSizeMax(properties, config.getGrpc().getMessageSizeMax());
     GrpcConfigKeys.setFlowControlWindow(properties, config.getGrpc().getFlowControlWindow());
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/IoTDBMetricRegistry.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/IoTDBMetricRegistry.java
index 8b9af65e6f..7846c61b89 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/IoTDBMetricRegistry.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/IoTDBMetricRegistry.java
@@ -18,6 +18,7 @@
  */
 package org.apache.iotdb.consensus.ratis.metrics;
 
+import org.apache.iotdb.consensus.ratis.Utils;
 import org.apache.iotdb.metrics.AbstractMetricService;
 import org.apache.iotdb.metrics.utils.MetricLevel;
 import org.apache.iotdb.metrics.utils.MetricType;
@@ -36,6 +37,8 @@ import com.codahale.metrics.Timer;
 import org.apache.ratis.metrics.MetricRegistryInfo;
 import org.apache.ratis.metrics.RatisMetricRegistry;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.SortedMap;
 import java.util.concurrent.ConcurrentHashMap;
@@ -49,28 +52,72 @@ public class IoTDBMetricRegistry implements RatisMetricRegistry {
   private final Map<String, CounterProxy> counterCache = new ConcurrentHashMap<>();
   private final Map<String, TimerProxy> timerCache = new ConcurrentHashMap<>();
   private final Map<String, GaugeProxy> gaugeCache = new ConcurrentHashMap<>();
-
-  IoTDBMetricRegistry(
-      MetricRegistryInfo info, AbstractMetricService service, String consensusGroupType) {
+  /** Time taken to flush log. */
+  public static final String RAFT_LOG_FLUSH_TIME = "flushTime";
+  /** Size of SegmentedRaftLogCache::closedSegments in bytes */
+  public static final String RAFT_LOG_CACHE_CLOSED_SEGMENTS_SIZE_IN_BYTES =
+      "closedSegmentsSizeInBytes";
+  /** Size of SegmentedRaftLogCache::openSegment in bytes */
+  public static final String RAFT_LOG_CACHE_OPEN_SEGMENT_SIZE_IN_BYTES = "openSegmentSizeInBytes";
+  /** Total time taken to append a raft log entry */
+  public static final String RAFT_LOG_APPEND_ENTRY_LATENCY = "appendEntryLatency";
+  /**
+   * Time taken for a Raft log operation to get into the queue after being requested. This is the
+   * time that it has to wait for the queue to be non-full.
+   */
+  public static final String RAFT_LOG_TASK_ENQUEUE_DELAY = "queueingDelay";
+  /** Time spent by a Raft log operation in the queue. */
+  public static final String RAFT_LOG_TASK_QUEUE_TIME = "enqueuedTime";
+  /** Time taken for a Raft log operation to complete execution. */
+  public static final String RAFT_LOG_TASK_EXECUTION_TIME = "ExecutionTime";
+  /** Time taken for followers to append log entries. */
+  public static final String FOLLOWER_APPEND_ENTRIES_LATENCY = "follower_append_entry_latency";
+  /** Time taken to process write requests from client. */
+  public static final String RAFT_CLIENT_WRITE_REQUEST = "clientWriteRequest";
+
+  private static final List<String> RATIS_METRICS = new ArrayList<>();
+
+  static {
+    RATIS_METRICS.add(RAFT_LOG_FLUSH_TIME);
+    RATIS_METRICS.add(RAFT_LOG_CACHE_CLOSED_SEGMENTS_SIZE_IN_BYTES);
+    RATIS_METRICS.add(RAFT_LOG_CACHE_OPEN_SEGMENT_SIZE_IN_BYTES);
+    RATIS_METRICS.add(RAFT_LOG_APPEND_ENTRY_LATENCY);
+    RATIS_METRICS.add(RAFT_LOG_TASK_ENQUEUE_DELAY);
+    RATIS_METRICS.add(RAFT_LOG_TASK_QUEUE_TIME);
+    RATIS_METRICS.add(RAFT_LOG_TASK_EXECUTION_TIME);
+    RATIS_METRICS.add(FOLLOWER_APPEND_ENTRIES_LATENCY);
+    RATIS_METRICS.add(RAFT_CLIENT_WRITE_REQUEST);
+  }
+
+  IoTDBMetricRegistry(MetricRegistryInfo info, AbstractMetricService service) {
     this.info = info;
     this.metricService = service;
     prefix =
         MetricRegistry.name(
-            consensusGroupType,
+            Utils.getConsensusGroupTypeFromPrefix(info.getPrefix()),
             info.getApplicationName(),
-            info.getMetricsComponentName(),
-            info.getPrefix());
+            info.getMetricsComponentName());
   }
 
   private String getMetricName(String name) {
     return metricNameCache.computeIfAbsent(name, n -> MetricRegistry.name(prefix, n));
   }
 
+  public MetricLevel getMetricLevel(String name) {
+    for (String ratisMetric : RATIS_METRICS) {
+      if (name.contains(ratisMetric)) {
+        return MetricLevel.IMPORTANT;
+      }
+    }
+    return MetricLevel.CORE;
+  }
+
   @Override
   public Timer timer(String name) {
     final String fullName = getMetricName(name);
     return timerCache.computeIfAbsent(
-        fullName, fn -> new TimerProxy(metricService.getOrCreateTimer(fn, MetricLevel.IMPORTANT)));
+        fullName,
+        fn -> new TimerProxy(metricService.getOrCreateTimer(fn, getMetricLevel(fullName))));
   }
 
   @Override
@@ -80,7 +127,7 @@ public class IoTDBMetricRegistry implements RatisMetricRegistry {
         fullName,
         fn ->
             new CounterProxy(
-                metricService.getOrCreateCounter(getMetricName(name), MetricLevel.IMPORTANT)));
+                metricService.getOrCreateCounter(getMetricName(name), getMetricLevel(fullName))));
   }
 
   @Override
@@ -124,7 +171,7 @@ public class IoTDBMetricRegistry implements RatisMetricRegistry {
         gaugeName -> {
           final GaugeProxy gauge = new GaugeProxy(metricSupplier);
           metricService.createAutoGauge(
-              gaugeName, MetricLevel.IMPORTANT, gauge, GaugeProxy::getValueAsDouble);
+              gaugeName, getMetricLevel(fullName), gauge, GaugeProxy::getValueAsDouble);
           return gauge;
         });
   }
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/MetricRegistryManager.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/MetricRegistryManager.java
index 898ebd4680..de62b45939 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/MetricRegistryManager.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/MetricRegistryManager.java
@@ -18,8 +18,8 @@
  */
 package org.apache.iotdb.consensus.ratis.metrics;
 
+import org.apache.iotdb.commons.service.metric.MetricService;
 import org.apache.iotdb.metrics.AbstractMetricService;
-import org.apache.iotdb.metrics.DoNothingMetricService;
 
 import org.apache.ratis.metrics.MetricRegistries;
 import org.apache.ratis.metrics.MetricRegistryInfo;
@@ -36,9 +36,7 @@ public class MetricRegistryManager extends MetricRegistries {
   /** Using RefCountingMap here because of potential duplicate MetricRegistryInfos */
   private final RefCountingMap<MetricRegistryInfo, RatisMetricRegistry> registries;
   /** TODO: enable ratis metrics after verifying its correctness and efficiency */
-  private final AbstractMetricService service = new DoNothingMetricService();
-
-  private String consensusGroupType;
+  private final AbstractMetricService service = MetricService.getInstance();
 
   public MetricRegistryManager() {
     this.registries = new RefCountingMap<>();
@@ -55,8 +53,7 @@ public class MetricRegistryManager extends MetricRegistries {
   @Override
   public RatisMetricRegistry create(MetricRegistryInfo metricRegistryInfo) {
     return registries.put(
-        metricRegistryInfo,
-        () -> new IoTDBMetricRegistry(metricRegistryInfo, service, consensusGroupType));
+        metricRegistryInfo, () -> new IoTDBMetricRegistry(metricRegistryInfo, service));
   }
 
   @Override
@@ -98,8 +95,4 @@ public class MetricRegistryManager extends MetricRegistries {
     throw new UnsupportedOperationException(
         "Console Reporter is disabled from RatisMetricRegistries");
   }
-
-  public void setConsensusGroupType(String consensusGroupType) {
-    this.consensusGroupType = consensusGroupType;
-  }
 }
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricSet.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricSet.java
index 732f4015d4..7e20c94466 100644
--- a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricSet.java
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricSet.java
@@ -19,30 +19,97 @@
 package org.apache.iotdb.consensus.ratis.metrics;
 
 import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
+import org.apache.iotdb.commons.service.metric.enums.Metric;
+import org.apache.iotdb.commons.service.metric.enums.Tag;
 import org.apache.iotdb.metrics.AbstractMetricService;
 import org.apache.iotdb.metrics.metricsets.IMetricSet;
+import org.apache.iotdb.metrics.utils.MetricInfo;
+import org.apache.iotdb.metrics.utils.MetricLevel;
+import org.apache.iotdb.metrics.utils.MetricType;
 
 import org.apache.ratis.metrics.MetricRegistries;
 
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 public class RatisMetricSet implements IMetricSet {
   private MetricRegistries manager;
-  private final String consensusGroupType;
+  private static final Map<String, MetricInfo> metricInfoMap = new HashMap<>();
+  private static final String RATIS_CONSENSUS_WRITE = Metric.RATIS_CONSENSUS_WRITE.toString();
+  private static final String RATIS_CONSENSUS_READ = Metric.RATIS_CONSENSUS_READ.toString();
+
+  private static final String DATA_REGION_RATIS_CONSENSUS_WRITE =
+      TConsensusGroupType.DataRegion + "_" + RATIS_CONSENSUS_WRITE;
+  private static final String DATA_REGION_RATIS_CONSENSUS_READ =
+      TConsensusGroupType.DataRegion + "_" + RATIS_CONSENSUS_READ;
+  private static final String SCHEMA_REGION_RATIS_CONSENSUS_WRITE =
+      TConsensusGroupType.SchemaRegion + "_" + RATIS_CONSENSUS_WRITE;
+  private static final String SCHEMA_REGION_RATIS_CONSENSUS_READ =
+      TConsensusGroupType.SchemaRegion + "_" + RATIS_CONSENSUS_READ;
+  private static final String CONFIG_REGION_RATIS_CONSENSUS_WRITE =
+      TConsensusGroupType.ConfigRegion + "_" + RATIS_CONSENSUS_WRITE;
+  private static final String CONFIG_REGION_RATIS_CONSENSUS_READ =
+      TConsensusGroupType.ConfigRegion + "_" + RATIS_CONSENSUS_READ;
+
+  public static final String WRITE_LOCALLY = "writeLocally";
+  public static final String WRITE_REMOTELY = "writeRemotely";
+  public static final String SUBMIT_READ_REQUEST = "submitReadRequest";
+  public static final String WRITE_STATE_MACHINE = "writeStateMachine";
+  private static final List<String> RATIS_WRITE_METRICS = new ArrayList<>();
+  private static final List<String> RATIS_WRITE_STAGES = new ArrayList<>();
+  private static final List<String> RATIS_READ_METRICS = new ArrayList<>();
+  private static final List<String> RATIS_READ_STAGES = new ArrayList<>();
+
+  static {
+    RATIS_WRITE_METRICS.add(DATA_REGION_RATIS_CONSENSUS_WRITE);
+    RATIS_WRITE_METRICS.add(SCHEMA_REGION_RATIS_CONSENSUS_WRITE);
+    RATIS_WRITE_METRICS.add(CONFIG_REGION_RATIS_CONSENSUS_WRITE);
+
+    RATIS_READ_METRICS.add(DATA_REGION_RATIS_CONSENSUS_READ);
+    RATIS_READ_METRICS.add(SCHEMA_REGION_RATIS_CONSENSUS_READ);
+    RATIS_READ_METRICS.add(CONFIG_REGION_RATIS_CONSENSUS_READ);
+
+    RATIS_WRITE_STAGES.add(WRITE_LOCALLY);
+    RATIS_WRITE_STAGES.add(WRITE_REMOTELY);
+    RATIS_WRITE_STAGES.add(WRITE_STATE_MACHINE);
 
-  public RatisMetricSet(TConsensusGroupType consensusGroupType) {
-    super();
-    this.consensusGroupType = consensusGroupType.toString();
+    RATIS_READ_STAGES.add(SUBMIT_READ_REQUEST);
+
+    for (String ratisWriteMetric : RATIS_WRITE_METRICS) {
+      for (String ratisWriteStage : RATIS_WRITE_STAGES) {
+        metricInfoMap.put(
+            ratisWriteStage,
+            new MetricInfo(
+                MetricType.TIMER, ratisWriteMetric, Tag.STAGE.toString(), ratisWriteStage));
+      }
+    }
+
+    for (String ratisReadMetric : RATIS_READ_METRICS) {
+      for (String ratisReadStage : RATIS_READ_STAGES) {
+        metricInfoMap.put(
+            ratisReadStage,
+            new MetricInfo(
+                MetricType.TIMER, ratisReadMetric, Tag.STAGE.toString(), ratisReadStage));
+      }
+    }
   }
 
   @Override
   public void bindTo(AbstractMetricService metricService) {
     manager = MetricRegistries.global();
-    if (manager instanceof MetricRegistryManager) {
-      ((MetricRegistryManager) manager).setConsensusGroupType(consensusGroupType);
+    for (MetricInfo metricInfo : metricInfoMap.values()) {
+      metricService.getOrCreateTimer(
+          metricInfo.getName(), MetricLevel.CORE, metricInfo.getTagsInArray());
     }
   }
 
   @Override
   public void unbindFrom(AbstractMetricService metricService) {
     manager.clear();
+    for (MetricInfo metricInfo : metricInfoMap.values()) {
+      metricService.remove(MetricType.TIMER, metricInfo.getName(), metricInfo.getTagsInArray());
+    }
   }
 }
diff --git a/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricsManager.java b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricsManager.java
new file mode 100644
index 0000000000..b7d11a732f
--- /dev/null
+++ b/consensus/src/main/java/org/apache/iotdb/consensus/ratis/metrics/RatisMetricsManager.java
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+package org.apache.iotdb.consensus.ratis.metrics;
+
+import org.apache.iotdb.commons.service.metric.MetricService;
+import org.apache.iotdb.commons.service.metric.enums.Metric;
+import org.apache.iotdb.commons.service.metric.enums.Tag;
+import org.apache.iotdb.metrics.utils.MetricLevel;
+
+import java.util.concurrent.TimeUnit;
+
+public class RatisMetricsManager {
+  private final MetricService metricService = MetricService.getInstance();
+  /** Record the time cost in write locally stage. */
+  public void recordWriteLocallyCost(long costTimeInNanos, String consensusGroupType) {
+    metricService.timer(
+        costTimeInNanos,
+        TimeUnit.NANOSECONDS,
+        consensusGroupType + "_" + Metric.RATIS_CONSENSUS_WRITE,
+        MetricLevel.IMPORTANT,
+        Tag.STAGE.toString(),
+        RatisMetricSet.WRITE_LOCALLY);
+  }
+
+  /** Record the time cost in write remotely stage. */
+  public void recordWriteRemotelyCost(long costTimeInNanos, String consensusGroupType) {
+    metricService.timer(
+        costTimeInNanos,
+        TimeUnit.NANOSECONDS,
+        consensusGroupType + "_" + Metric.RATIS_CONSENSUS_WRITE,
+        MetricLevel.IMPORTANT,
+        Tag.STAGE.toString(),
+        RatisMetricSet.WRITE_REMOTELY);
+  }
+  /** Record the time cost in submit read request stage. */
+  public void recordReadRequestCost(long costTimeInNanos, String consensusGroupType) {
+    metricService.timer(
+        costTimeInNanos,
+        TimeUnit.NANOSECONDS,
+        consensusGroupType + "_" + Metric.RATIS_CONSENSUS_READ,
+        MetricLevel.IMPORTANT,
+        Tag.STAGE.toString(),
+        RatisMetricSet.SUBMIT_READ_REQUEST);
+  }
+
+  /** Record the time cost in write state machine stage. */
+  public void recordWriteStateMachineCost(long costTimeInNanos, String consensusGroupType) {
+    metricService.timer(
+        costTimeInNanos,
+        TimeUnit.NANOSECONDS,
+        consensusGroupType + "_" + Metric.RATIS_CONSENSUS_WRITE,
+        MetricLevel.IMPORTANT,
+        Tag.STAGE.toString(),
+        RatisMetricSet.WRITE_STATE_MACHINE);
+  }
+
+  public static RatisMetricsManager getInstance() {
+    return RatisMetricsManagerHolder.INSTANCE;
+  }
+
+  private static class RatisMetricsManagerHolder {
+    private static final RatisMetricsManager INSTANCE = new RatisMetricsManager();
+
+    private RatisMetricsManagerHolder() {
+      // empty constructor
+    }
+  }
+}
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/iot/ReplicateTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/iot/ReplicateTest.java
index 0c9321fc2b..a36db6e3ea 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/iot/ReplicateTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/iot/ReplicateTest.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.consensus.iot;
 
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
 import org.apache.iotdb.commons.consensus.DataRegionId;
@@ -94,7 +93,6 @@ public class ReplicateTest {
                           .setThisNodeId(peers.get(i).getNodeId())
                           .setThisNode(peers.get(i).getEndpoint())
                           .setStorageDir(peersStorage.get(i).getAbsolutePath())
-                          .setConsensusGroupType(TConsensusGroupType.DataRegion)
                           .build(),
                       groupId -> stateMachines.get(finalI))
                   .orElseThrow(
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/iot/StabilityTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/iot/StabilityTest.java
index 5f04af6ee0..ea7c15c8f1 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/iot/StabilityTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/iot/StabilityTest.java
@@ -19,7 +19,6 @@
 
 package org.apache.iotdb.consensus.iot;
 
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
 import org.apache.iotdb.commons.consensus.DataRegionId;
@@ -57,7 +56,6 @@ public class StabilityTest {
                     .setThisNodeId(1)
                     .setThisNode(new TEndPoint("0.0.0.0", 9000))
                     .setStorageDir(storageDir.getAbsolutePath())
-                    .setConsensusGroupType(TConsensusGroupType.DataRegion)
                     .build(),
                 gid -> new TestStateMachine())
             .orElseThrow(
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
index 6a5bbde7da..cb86a0f79d 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/RatisConsensusTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.consensus.ratis;
 
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
 import org.apache.iotdb.commons.consensus.DataRegionId;
@@ -100,7 +99,6 @@ public class RatisConsensusTest {
                       .setThisNode(peers.get(i).getEndpoint())
                       .setRatisConfig(config)
                       .setStorageDir(peersStorage.get(i).getAbsolutePath())
-                      .setConsensusGroupType(TConsensusGroupType.DataRegion)
                       .build(),
                   groupId -> stateMachines.get(finalI))
               .orElseThrow(
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/SnapshotTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/SnapshotTest.java
index 5ce5d83fe0..9a642f1bda 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/ratis/SnapshotTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/ratis/SnapshotTest.java
@@ -18,6 +18,9 @@
  */
 package org.apache.iotdb.consensus.ratis;
 
+import org.apache.iotdb.commons.consensus.ConsensusGroupId;
+
+import org.apache.ratis.protocol.RaftGroupId;
 import org.apache.ratis.server.RaftServerConfigKeys;
 import org.apache.ratis.server.storage.RaftStorage;
 import org.apache.ratis.server.storage.RaftStorageDirectory;
@@ -94,8 +97,10 @@ public class SnapshotTest {
 
   @Test
   public void testSnapshot() throws Exception {
+    ConsensusGroupId consensusGroupId = ConsensusGroupId.Factory.create(0, 0);
+    RaftGroupId raftGroupId = Utils.fromConsensusGroupIdToRaftGroupId(consensusGroupId);
     ApplicationStateMachineProxy proxy =
-        new ApplicationStateMachineProxy(new TestUtils.IntegerCounter(), null);
+        new ApplicationStateMachineProxy(new TestUtils.IntegerCounter(), raftGroupId);
 
     proxy.initialize(null, null, new EmptyStorageWithOnlySMDir());
 
@@ -166,8 +171,10 @@ public class SnapshotTest {
 
   @Test
   public void testCrossDiskLinkSnapshot() throws Exception {
+    ConsensusGroupId consensusGroupId = ConsensusGroupId.Factory.create(0, 0);
+    RaftGroupId raftGroupId = Utils.fromConsensusGroupIdToRaftGroupId(consensusGroupId);
     ApplicationStateMachineProxy proxy =
-        new ApplicationStateMachineProxy(new CrossDiskLinkStatemachine(), null);
+        new ApplicationStateMachineProxy(new CrossDiskLinkStatemachine(), raftGroupId);
 
     proxy.initialize(null, null, new EmptyStorageWithOnlySMDir());
     proxy.notifyTermIndexUpdated(20, 1005);
diff --git a/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java b/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
index 496f24e0a7..83fc2414b9 100644
--- a/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
+++ b/consensus/src/test/java/org/apache/iotdb/consensus/simple/RecoveryTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.iotdb.consensus.simple;
 
-import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
 import org.apache.iotdb.common.rpc.thrift.TEndPoint;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
 import org.apache.iotdb.commons.consensus.SchemaRegionId;
@@ -52,7 +51,6 @@ public class RecoveryTest {
                     .setThisNodeId(1)
                     .setThisNode(new TEndPoint("0.0.0.0", 9000))
                     .setStorageDir("target" + java.io.File.separator + "recovery")
-                    .setConsensusGroupType(TConsensusGroupType.SchemaRegion)
                     .build(),
                 gid -> new EmptyStateMachine())
             .orElseThrow(
diff --git a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-ConfigNode-Dashboard.json b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-ConfigNode-Dashboard.json
index 89dfb35d65..7016071f59 100644
--- a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-ConfigNode-Dashboard.json
+++ b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-ConfigNode-Dashboard.json
@@ -9,7 +9,7 @@
       "pluginName": "Prometheus"
     }
   ],
-  "__elements": {},
+  "__elements": [],
   "__requires": [
     {
       "type": "panel",
@@ -21,7 +21,7 @@
       "type": "grafana",
       "id": "grafana",
       "name": "Grafana",
-      "version": "9.3.6"
+      "version": "8.4.2"
     },
     {
       "type": "panel",
@@ -75,11 +75,12 @@
   "fiscalYearStartMonth": 0,
   "graphTooltip": 1,
   "id": null,
+  "iteration": 1678983654736,
   "links": [],
   "liveNow": false,
   "panels": [
     {
-      "collapsed": false,
+      "collapsed": true,
       "gridPos": {
         "h": 1,
         "w": 24,
@@ -87,692 +88,1120 @@
         "y": 0
       },
       "id": 57,
-      "panels": [],
-      "title": "Overview",
-      "type": "row"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The current status of cluster ConfigNodes",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "palette-classic"
-          },
-          "custom": {
-            "hideFrom": {
-              "legend": false,
-              "tooltip": false,
-              "viz": false
-            }
-          },
-          "mappings": []
-        },
-        "overrides": [
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"ReadOnly\", type=\"ConfigNode\"}"
-            },
-            "properties": [
-              {
-                "id": "color",
-                "value": {
-                  "fixedColor": "orange",
-                  "mode": "fixed"
+      "panels": [
+        {
+          "description": "The current status of cluster ConfigNodes",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
                 }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Removing\", type=\"ConfigNode\"}"
+              },
+              "mappings": []
             },
-            "properties": [
+            "overrides": [
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "red",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Unknown\", type=\"ConfigNode\"}"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"ReadOnly\", type=\"ConfigNode\"}"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "yellow",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Running\", type=\"ConfigNode\"}"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Removing\", type=\"ConfigNode\"}"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "green",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Running"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Unknown\", type=\"ConfigNode\"}"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "green",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "ReadOnly"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "{__name__=\"node_num\", instance=\"localhost:9091\", job=\"confignode\", status=\"Running\", type=\"ConfigNode\"}"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "orange",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Removing"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "Running"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "red",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Unknown"
-            },
-            "properties": [
+                "matcher": {
+                  "id": "byName",
+                  "options": "ReadOnly"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "yellow",
-                  "mode": "fixed"
-                }
+                "matcher": {
+                  "id": "byName",
+                  "options": "Removing"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Unknown"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
               }
             ]
-          }
-        ]
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 0,
-        "y": 1
-      },
-      "id": 59,
-      "options": {
-        "legend": {
-          "displayMode": "table",
-          "placement": "right",
-          "showLegend": true,
-          "values": [
-            "value"
-          ]
-        },
-        "pieType": "pie",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
-          ],
-          "fields": "",
-          "values": false
-        },
-        "tooltip": {
-          "mode": "single",
-          "sort": "none"
-        }
-      },
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
           },
-          "editorMode": "builder",
-          "expr": "node_num{type=\"ConfigNode\"}",
-          "legendFormat": "{{status}}",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "title": "ConfigNode Current Status",
-      "type": "piechart"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The CPU Core of current ConfigNode",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "thresholds"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 0,
+            "y": 1
           },
-          "mappings": [],
-          "thresholds": {
-            "mode": "absolute",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              }
-            ]
+          "id": 59,
+          "options": {
+            "legend": {
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true,
+              "values": [
+                "value"
+              ]
+            },
+            "pieType": "pie",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
+            }
           },
-          "unit": "Core(s)"
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 5,
-        "y": 1
-      },
-      "id": 69,
-      "options": {
-        "colorMode": "value",
-        "graphMode": "none",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "node_num{instance=\"$instance\", type=\"ConfigNode\"}",
+              "interval": "",
+              "legendFormat": "{{status}}",
+              "range": true,
+              "refId": "A"
+            }
           ],
-          "fields": "",
-          "values": false
+          "title": "ConfigNode Current Status",
+          "type": "piechart"
         },
-        "textMode": "auto"
-      },
-      "pluginVersion": "9.3.6",
-      "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+          "description": "The number of cluster Databases",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              }
+            },
+            "overrides": []
           },
-          "editorMode": "code",
-          "exemplar": false,
-          "expr": "sys_cpu_cores{instance=\"$instance\", name=\"system\"}",
-          "instant": false,
-          "interval": "",
-          "legendFormat": "{{name}}",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "title": "CPU Core",
-      "type": "stat"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The total disk space of current ConfigNode",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "thresholds"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 4,
+            "y": 1
           },
-          "mappings": [],
-          "thresholds": {
-            "mode": "absolute",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              }
-            ]
+          "id": 79,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "area",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
           },
-          "unit": "bytes"
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 10,
-        "y": 1
-      },
-      "id": 77,
-      "options": {
-        "colorMode": "value",
-        "graphMode": "none",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "database_num{instance=\"$instance\"}",
+              "interval": "",
+              "legendFormat": "__auto",
+              "range": true,
+              "refId": "A"
+            }
           ],
-          "fields": "",
-          "values": false
+          "title": "Database Count",
+          "type": "stat"
         },
-        "textMode": "auto"
-      },
-      "pluginVersion": "9.3.6",
-      "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "editorMode": "builder",
-          "expr": "sys_disk_total_space",
-          "legendFormat": "{{name}}",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "title": "Total Disk Space",
-      "type": "stat"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "Bar of current ConfigNode",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "thresholds"
-          },
-          "mappings": [],
-          "max": 1,
-          "min": 0,
-          "thresholds": {
-            "mode": "percentage",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              },
-              {
-                "color": "#EAB839",
-                "value": 80
+          "description": "The number of cluster DataRegions",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
               },
-              {
-                "color": "red",
-                "value": 90
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
               }
-            ]
+            },
+            "overrides": []
           },
-          "unit": "percentunit"
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 12,
-        "w": 9,
-        "x": 15,
-        "y": 1
-      },
-      "id": 73,
-      "options": {
-        "displayMode": "lcd",
-        "minVizHeight": 10,
-        "minVizWidth": 0,
-        "orientation": "horizontal",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 8,
+            "y": 1
+          },
+          "id": 85,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "area",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
+          },
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "sum by (type) (region_num{type=\"DataRegion\", instance=\"$instance\"})",
+              "interval": "",
+              "legendFormat": "__auto",
+              "range": true,
+              "refId": "A"
+            }
           ],
-          "fields": "",
-          "values": false
+          "title": "DataRegion Count",
+          "type": "stat"
         },
-        "showUnfilled": true
-      },
-      "pluginVersion": "9.3.6",
-      "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+          "description": "The number of cluster SchemaRegions",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              }
+            },
+            "overrides": []
           },
-          "editorMode": "code",
-          "expr": "process_cpu_load{instance=~\"$instance\"} / 100",
-          "hide": false,
-          "legendFormat": "cpu load",
-          "range": true,
-          "refId": "C"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 12,
+            "y": 1
           },
-          "editorMode": "code",
-          "expr": "1- sys_disk_free_space / sys_disk_total_space",
-          "hide": false,
-          "legendFormat": "disk",
-          "range": true,
-          "refId": "D"
-        },
+          "id": 83,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "area",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
+          },
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "sum by(type) (region_num{type=\"SchemaRegion\", instance=\"$instance\"})",
+              "interval": "",
+              "legendFormat": "__auto",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "SchemaRegion Count",
+          "type": "stat"
+        },
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "editorMode": "code",
-          "expr": "1 - process_free_mem{instance=\"$instance\"} / process_total_mem{instance=\"$instance\"}",
-          "hide": false,
-          "legendFormat": "process memory",
-          "range": true,
-          "refId": "B"
+          "description": "The CPU Core of current ConfigNode",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              },
+              "unit": "Core(s)"
+            },
+            "overrides": []
+          },
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 16,
+            "y": 1
+          },
+          "id": 69,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "none",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
+          },
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": false,
+              "expr": "sys_cpu_cores{instance=\"$instance\", name=\"system\"}",
+              "instant": false,
+              "interval": "",
+              "legendFormat": "{{name}}",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "CPU Core",
+          "type": "stat"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+          "description": "The total disk space of current ConfigNode",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              },
+              "unit": "bytes"
+            },
+            "overrides": []
           },
-          "editorMode": "code",
-          "exemplar": false,
-          "expr": "1 - sys_free_physical_memory_size{instance=\"$instance\", name=\"system\"} / sys_total_physical_memory_size{instance=\"$instance\", name=\"system\"}",
-          "instant": false,
-          "interval": "",
-          "legendFormat": "system memory",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "type": "bargauge"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The current status of cluster DataNodes",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "palette-classic"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 20,
+            "y": 1
           },
-          "custom": {
-            "hideFrom": {
-              "legend": false,
-              "tooltip": false,
-              "viz": false
+          "id": 77,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "none",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
+          },
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "sys_disk_total_space{instance=\"$instance\"}",
+              "interval": "",
+              "legendFormat": "{{name}}",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "Total Disk Space",
+          "type": "stat"
+        },
+        {
+          "description": "The current status of cluster DataNodes",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
+                }
+              },
+              "mappings": []
+            },
+            "overrides": [
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Running"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "ReadOnly"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Removing"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Unknown"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              }
+            ]
+          },
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 0,
+            "y": 7
+          },
+          "id": 65,
+          "options": {
+            "legend": {
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true,
+              "values": [
+                "value"
+              ]
+            },
+            "pieType": "pie",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
             }
           },
-          "mappings": []
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "node_num{instance=\"$instance\", type=\"DataNode\"}",
+              "interval": "",
+              "legendFormat": "{{status}}",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "DataNode Current Status",
+          "type": "piechart"
         },
-        "overrides": [
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Running"
+        {
+          "description": "Bar of current ConfigNode",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "max": 1,
+              "min": 0,
+              "thresholds": {
+                "mode": "percentage",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  },
+                  {
+                    "color": "#EAB839",
+                    "value": 80
+                  },
+                  {
+                    "color": "red",
+                    "value": 90
+                  }
+                ]
+              },
+              "unit": "percentunit"
             },
-            "properties": [
+            "overrides": []
+          },
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 4,
+            "y": 7
+          },
+          "id": 73,
+          "options": {
+            "displayMode": "lcd",
+            "minVizHeight": 10,
+            "minVizWidth": 0,
+            "orientation": "horizontal",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "showUnfilled": true
+          },
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "expr": "process_cpu_load{instance=~\"$instance\"} / 100",
+              "hide": false,
+              "legendFormat": "cpu load",
+              "range": true,
+              "refId": "C"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": true,
+              "expr": "1- sys_disk_free_space{instance=\"$instance\"} / sys_disk_total_space{instance=\"$instance\"}",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "disk",
+              "range": true,
+              "refId": "D"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": true,
+              "expr": "1 - process_free_mem{instance=\"$instance\"} / process_total_mem{instance=\"$instance\"}",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "process memory",
+              "range": true,
+              "refId": "B"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": false,
+              "expr": "1 - sys_free_physical_memory_size{instance=\"$instance\", name=\"system\"} / sys_total_physical_memory_size{instance=\"$instance\", name=\"system\"}",
+              "instant": false,
+              "interval": "",
+              "legendFormat": "system memory",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "type": "bargauge"
+        },
+        {
+          "description": "The current status of cluster DataRegions",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
+                }
+              },
+              "mappings": []
+            },
+            "overrides": [
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Running"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "ReadOnly"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Removing"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "green",
-                  "mode": "fixed"
-                }
+                "matcher": {
+                  "id": "byName",
+                  "options": "Unknown"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
               }
             ]
           },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "ReadOnly"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 8,
+            "y": 7
+          },
+          "id": 93,
+          "options": {
+            "legend": {
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true,
+              "values": [
+                "value"
+              ]
             },
-            "properties": [
-              {
-                "id": "color",
-                "value": {
-                  "fixedColor": "orange",
-                  "mode": "fixed"
-                }
-              }
-            ]
+            "pieType": "pie",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
+            }
           },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Removing"
+          "pluginVersion": "9.3.6",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "region_num{type=\"DataRegion\", instance=\"$instance\"}",
+              "interval": "",
+              "legendFormat": "{{status}}",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "DataRegion Current Status",
+          "type": "piechart"
+        },
+        {
+          "description": "The current status of cluster SchemaRegions",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
+                }
+              },
+              "mappings": []
             },
-            "properties": [
+            "overrides": [
               {
-                "id": "color",
-                "value": {
-                  "fixedColor": "red",
-                  "mode": "fixed"
-                }
+                "matcher": {
+                  "id": "byName",
+                  "options": "Running"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "ReadOnly"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Removing"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Unknown"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
               }
             ]
           },
-          {
-            "matcher": {
-              "id": "byName",
-              "options": "Unknown"
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 12,
+            "y": 7
+          },
+          "id": 87,
+          "options": {
+            "legend": {
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true,
+              "values": [
+                "value"
+              ]
             },
-            "properties": [
-              {
-                "id": "color",
-                "value": {
-                  "fixedColor": "yellow",
-                  "mode": "fixed"
-                }
-              }
-            ]
-          }
-        ]
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 0,
-        "y": 7
-      },
-      "id": 65,
-      "options": {
-        "legend": {
-          "displayMode": "table",
-          "placement": "right",
-          "showLegend": true,
-          "values": [
-            "value"
-          ]
-        },
-        "pieType": "pie",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
+            "pieType": "pie",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
+            }
+          },
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "exemplar": true,
+              "expr": "region_num{type=\"SchemaRegion\", instance=\"$instance\"}",
+              "interval": "",
+              "legendFormat": "{{status}}",
+              "range": true,
+              "refId": "A"
+            }
           ],
-          "fields": "",
-          "values": false
+          "title": "SchemaRegion Current Status",
+          "type": "piechart"
         },
-        "tooltip": {
-          "mode": "single",
-          "sort": "none"
-        }
-      },
-      "targets": [
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "editorMode": "builder",
-          "expr": "node_num{type=\"DataNode\"}",
-          "legendFormat": "{{status}}",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "title": "DataNode Current Status",
-      "type": "piechart"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The system memory of current ConfigNode",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "thresholds"
+          "description": "The system memory of current ConfigNode",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              },
+              "unit": "bytes"
+            },
+            "overrides": []
           },
-          "mappings": [],
-          "thresholds": {
-            "mode": "absolute",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              }
-            ]
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 16,
+            "y": 7
+          },
+          "id": 71,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "none",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "textMode": "auto"
           },
-          "unit": "bytes"
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 5,
-        "y": 7
-      },
-      "id": 71,
-      "options": {
-        "colorMode": "value",
-        "graphMode": "none",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "expr": "sys_total_physical_memory_size{instance=\"$instance\", name=\"system\"}",
+              "legendFormat": "{{name}}",
+              "range": true,
+              "refId": "A"
+            }
           ],
-          "fields": "",
-          "values": false
+          "title": "System Memory",
+          "type": "stat"
         },
-        "textMode": "auto"
-      },
-      "pluginVersion": "9.3.6",
-      "targets": [
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "editorMode": "code",
-          "expr": "sys_total_physical_memory_size{instance=\"$instance\", name=\"system\"}",
-          "legendFormat": "{{name}}",
-          "range": true,
-          "refId": "A"
-        }
-      ],
-      "title": "System Memory",
-      "type": "stat"
-    },
-    {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "The swap memory of current ConfigNode",
-      "fieldConfig": {
-        "defaults": {
-          "color": {
-            "mode": "thresholds"
+          "description": "The swap memory of current ConfigNode",
+          "fieldConfig": {
+            "defaults": {
+              "color": {
+                "mode": "thresholds"
+              },
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green",
+                    "value": null
+                  }
+                ]
+              },
+              "unit": "bytes"
+            },
+            "overrides": []
           },
-          "mappings": [],
-          "thresholds": {
-            "mode": "absolute",
-            "steps": [
-              {
-                "color": "green",
-                "value": null
-              }
-            ]
+          "gridPos": {
+            "h": 6,
+            "w": 4,
+            "x": 20,
+            "y": 7
           },
-          "unit": "bytes"
-        },
-        "overrides": []
-      },
-      "gridPos": {
-        "h": 6,
-        "w": 5,
-        "x": 10,
-        "y": 7
-      },
-      "id": 75,
-      "options": {
-        "colorMode": "value",
-        "graphMode": "none",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
-          ],
-          "fields": "",
-          "values": false
-        },
-        "text": {},
-        "textMode": "auto"
-      },
-      "pluginVersion": "9.3.6",
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+          "id": 75,
+          "options": {
+            "colorMode": "value",
+            "graphMode": "none",
+            "justifyMode": "auto",
+            "orientation": "auto",
+            "reduceOptions": {
+              "calcs": [
+                "lastNotNull"
+              ],
+              "fields": "",
+              "values": false
+            },
+            "text": {},
+            "textMode": "auto"
           },
-          "editorMode": "builder",
-          "expr": "sys_total_swap_space_size{instance=\"$instance\", name=\"system\"}",
-          "legendFormat": "{{name}}",
-          "range": true,
-          "refId": "A"
+          "pluginVersion": "8.4.2",
+          "targets": [
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "builder",
+              "expr": "sys_total_swap_space_size{instance=\"$instance\", name=\"system\"}",
+              "legendFormat": "{{name}}",
+              "range": true,
+              "refId": "A"
+            }
+          ],
+          "title": "Swap Memory",
+          "type": "stat"
         }
       ],
-      "title": "Swap Memory",
-      "type": "stat"
+      "title": "Overview",
+      "type": "row"
     },
     {
       "collapsed": true,
@@ -780,28 +1209,51 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 13
+        "y": 1
       },
       "id": 49,
       "panels": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The number of cluster ConfigNodes",
           "fieldConfig": {
             "defaults": {
               "color": {
-                "mode": "thresholds"
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "axisLabel": "",
+                "axisPlacement": "auto",
+                "barAlignment": 0,
+                "drawStyle": "line",
+                "fillOpacity": 5,
+                "gradientMode": "none",
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
+                },
+                "lineInterpolation": "linear",
+                "lineWidth": 1,
+                "pointSize": 5,
+                "scaleDistribution": {
+                  "type": "linear"
+                },
+                "showPoints": "auto",
+                "spanNulls": false,
+                "stacking": {
+                  "group": "A",
+                  "mode": "none"
+                },
+                "thresholdsStyle": {
+                  "mode": "off"
+                }
               },
               "mappings": [],
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -810,26 +1262,25 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 6,
+            "w": 7,
             "x": 0,
             "y": 14
           },
           "id": 55,
           "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
+            "legend": {
               "calcs": [
                 "lastNotNull"
               ],
-              "fields": "",
-              "values": false
+              "displayMode": "table",
+              "placement": "right"
             },
-            "textMode": "auto"
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
+            }
           },
-          "pluginVersion": "9.3.6",
+          "pluginVersion": "8.4.2",
           "targets": [
             {
               "datasource": {
@@ -837,20 +1288,18 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "sum by(type) (node_num{type=\"ConfigNode\"})",
-              "legendFormat": "__auto",
+              "exemplar": true,
+              "expr": "sum(node_num{instance=\"$instance\"}) by(type) ",
+              "interval": "",
+              "legendFormat": "{{type}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "ConfigNode Count",
-          "type": "stat"
+          "title": "Node Count",
+          "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The status history of cluster ConfigNodes",
           "fieldConfig": {
             "defaults": {
@@ -858,8 +1307,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -892,8 +1339,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -963,8 +1409,8 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 18,
-            "x": 6,
+            "w": 9,
+            "x": 7,
             "y": 14
           },
           "id": 61,
@@ -989,7 +1435,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "node_num{type=\"ConfigNode\"}",
+              "exemplar": true,
+              "expr": "node_num{type=\"ConfigNode\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{status}}",
               "range": true,
               "refId": "A"
@@ -997,88 +1445,8 @@
           ],
           "title": "ConfigNode Status History",
           "type": "timeseries"
-        }
-      ],
-      "title": "ConfigNode",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 14
-      },
-      "id": 51,
-      "panels": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of cluster DataNodes",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              }
-            },
-            "overrides": []
-          },
-          "gridPos": {
-            "h": 6,
-            "w": 6,
-            "x": 0,
-            "y": 15
-          },
-          "id": 63,
-          "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
-            },
-            "textMode": "auto"
-          },
-          "pluginVersion": "9.3.6",
-          "targets": [
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "builder",
-              "expr": "sum by(type) (node_num{type=\"DataNode\"})",
-              "legendFormat": "__auto",
-              "range": true,
-              "refId": "A"
-            }
-          ],
-          "title": "DataNode Count",
-          "type": "stat"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+        },
+        {
           "description": "The status history of cluster DataNodes",
           "fieldConfig": {
             "defaults": {
@@ -1086,8 +1454,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1120,8 +1486,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1191,9 +1556,9 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 18,
-            "x": 6,
-            "y": 15
+            "w": 8,
+            "x": 16,
+            "y": 14
           },
           "id": 67,
           "options": {
@@ -1217,7 +1582,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "node_num{type=\"DataNode\"}",
+              "exemplar": true,
+              "expr": "node_num{type=\"DataNode\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{status}}",
               "range": true,
               "refId": "A"
@@ -1227,10 +1594,6 @@
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The number of SchemaRegions in each DataNode",
           "fieldConfig": {
             "defaults": {
@@ -1238,8 +1601,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1272,8 +1633,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1284,7 +1644,7 @@
             "h": 6,
             "w": 12,
             "x": 0,
-            "y": 21
+            "y": 20
           },
           "id": 97,
           "options": {
@@ -1308,7 +1668,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_num_in_data_node{type=\"SchemaRegion\"}",
+              "exemplar": true,
+              "expr": "region_num_in_data_node{type=\"SchemaRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
@@ -1318,10 +1680,6 @@
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The number of SchemaRegionGroup leadere in each DataNodes",
           "fieldConfig": {
             "defaults": {
@@ -1329,8 +1687,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1363,8 +1719,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1375,7 +1730,7 @@
             "h": 6,
             "w": 12,
             "x": 12,
-            "y": 21
+            "y": 20
           },
           "id": 95,
           "options": {
@@ -1399,7 +1754,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_group_leader_num_in_data_node{type=\"SchemaRegion\"}",
+              "exemplar": true,
+              "expr": "region_group_leader_num_in_data_node{type=\"SchemaRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
@@ -1409,10 +1766,6 @@
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The number of DataRegions in each DataNode",
           "fieldConfig": {
             "defaults": {
@@ -1420,8 +1773,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1454,8 +1805,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1466,7 +1816,7 @@
             "h": 6,
             "w": 12,
             "x": 0,
-            "y": 27
+            "y": 26
           },
           "id": 99,
           "options": {
@@ -1490,7 +1840,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_num_in_data_node{type=\"DataRegion\"}",
+              "exemplar": true,
+              "expr": "region_num_in_data_node{type=\"DataRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
@@ -1500,10 +1852,6 @@
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
           "description": "The number of DataRegionGroup leaders in each DataNode",
           "fieldConfig": {
             "defaults": {
@@ -1511,8 +1859,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1545,8 +1891,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1557,7 +1902,7 @@
             "h": 6,
             "w": 12,
             "x": 12,
-            "y": 27
+            "y": 26
           },
           "id": 101,
           "options": {
@@ -1581,7 +1926,9 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_num_in_data_node{type=\"DataRegion\"}",
+              "exemplar": true,
+              "expr": "region_num_in_data_node{type=\"DataRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
@@ -1591,7 +1938,7 @@
           "type": "timeseries"
         }
       ],
-      "title": "DataNode",
+      "title": "NodeInfo",
       "type": "row"
     },
     {
@@ -1600,91 +1947,23 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 15
+        "y": 2
       },
       "id": 53,
       "panels": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of cluster Databases",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              }
-            },
-            "overrides": []
-          },
-          "gridPos": {
-            "h": 6,
-            "w": 6,
-            "x": 0,
-            "y": 16
-          },
-          "id": 79,
-          "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
-            },
-            "textMode": "auto"
-          },
-          "pluginVersion": "9.3.6",
-          "targets": [
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "builder",
-              "expr": "database_num",
-              "legendFormat": "__auto",
-              "range": true,
-              "refId": "A"
-            }
-          ],
-          "title": "Database Count",
-          "type": "stat"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of SeriesSlots in each Database",
+          "description": "The number of SchemaRegionGroups in each Database",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
                 "drawStyle": "line",
-                "fillOpacity": 10,
+                "fillOpacity": 4,
                 "gradientMode": "none",
                 "hideFrom": {
                   "legend": false,
@@ -1712,8 +1991,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1722,11 +2000,11 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 18,
-            "x": 6,
-            "y": 16
+            "w": 8,
+            "x": 0,
+            "y": 3
           },
-          "id": 103,
+          "id": 105,
           "options": {
             "legend": {
               "calcs": [
@@ -1748,34 +2026,30 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "series_slot_num_in_database",
+              "exemplar": true,
+              "expr": "region_group_num_in_database{type=\"SchemaRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "SeriesSlot Count",
+          "title": "SchemaRegionGroup Count",
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of SchemaRegionGroups in each Database",
+          "description": "The number of DataRegionGroups in each DataNode",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
                 "drawStyle": "line",
-                "fillOpacity": 10,
+                "fillOpacity": 4,
                 "gradientMode": "none",
                 "hideFrom": {
                   "legend": false,
@@ -1803,8 +2077,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1813,11 +2086,11 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 12,
-            "x": 0,
-            "y": 22
+            "w": 8,
+            "x": 8,
+            "y": 3
           },
-          "id": 105,
+          "id": 107,
           "options": {
             "legend": {
               "calcs": [
@@ -1839,34 +2112,30 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_group_num_in_database{type=\"SchemaRegion\"}",
+              "exemplar": true,
+              "expr": "region_group_num_in_database{type=\"DataRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "SchemaRegionGroup Count",
+          "title": "DataRegionGroup Count",
           "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of DataRegionGroups in each DataNode",
+          "description": "The number of SeriesSlots in each Database",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
                 "drawStyle": "line",
-                "fillOpacity": 10,
+                "fillOpacity": 4,
                 "gradientMode": "none",
                 "hideFrom": {
                   "legend": false,
@@ -1894,8 +2163,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -1904,11 +2172,11 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 12,
-            "x": 12,
-            "y": 22
+            "w": 8,
+            "x": 16,
+            "y": 3
           },
-          "id": 107,
+          "id": 103,
           "options": {
             "legend": {
               "calcs": [
@@ -1930,13 +2198,15 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_group_num_in_database{type=\"DataRegion\"}",
+              "exemplar": true,
+              "expr": "series_slot_num_in_database{instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "DataRegionGroup Count",
+          "title": "SeriesSlot Count",
           "type": "timeseries"
         }
       ],
@@ -1949,56 +2219,139 @@
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 16
+        "y": 3
       },
       "id": 81,
       "panels": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The number of cluster SchemaRegions",
+          "description": "The status history of cluster DataRegions",
           "fieldConfig": {
             "defaults": {
               "color": {
-                "mode": "thresholds"
+                "mode": "palette-classic"
+              },
+              "custom": {
+                "axisLabel": "",
+                "axisPlacement": "auto",
+                "barAlignment": 0,
+                "drawStyle": "line",
+                "fillOpacity": 10,
+                "gradientMode": "none",
+                "hideFrom": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": false
+                },
+                "lineInterpolation": "linear",
+                "lineWidth": 1,
+                "pointSize": 5,
+                "scaleDistribution": {
+                  "type": "linear"
+                },
+                "showPoints": "never",
+                "spanNulls": false,
+                "stacking": {
+                  "group": "A",
+                  "mode": "none"
+                },
+                "thresholdsStyle": {
+                  "mode": "off"
+                }
               },
               "mappings": [],
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
+                  }
+                ]
+              }
+            },
+            "overrides": [
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "ReadOnly"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Removing"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Running"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "green",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "Unknown"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "yellow",
+                      "mode": "fixed"
+                    }
                   }
                 ]
               }
-            },
-            "overrides": []
+            ]
           },
           "gridPos": {
             "h": 6,
-            "w": 6,
+            "w": 12,
             "x": 0,
-            "y": 17
+            "y": 4
           },
-          "id": 83,
+          "id": 91,
           "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
+            "legend": {
               "calcs": [
                 "lastNotNull"
               ],
-              "fields": "",
-              "values": false
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true
             },
-            "textMode": "auto"
+            "tooltip": {
+              "mode": "single",
+              "sort": "none"
+            }
           },
-          "pluginVersion": "9.3.6",
           "targets": [
             {
               "datasource": {
@@ -2006,46 +2359,77 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "sum by(type) (region_num{type=\"SchemaRegion\"})",
-              "legendFormat": "__auto",
+              "exemplar": true,
+              "expr": "region_num{type=\"DataRegion\", instance=\"$instance\"}",
+              "interval": "",
+              "legendFormat": "{{status}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "SchemaRegion Count",
-          "type": "stat"
+          "title": "DataRegion Status History",
+          "type": "timeseries"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "The current status of cluster SchemaRegions",
+          "description": "The status history of cluster SchemaRegions",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
+                "axisLabel": "",
+                "axisPlacement": "auto",
+                "barAlignment": 0,
+                "drawStyle": "line",
+                "fillOpacity": 10,
+                "gradientMode": "none",
                 "hideFrom": {
                   "legend": false,
                   "tooltip": false,
                   "viz": false
+                },
+                "lineInterpolation": "linear",
+                "lineWidth": 1,
+                "pointSize": 5,
+                "scaleDistribution": {
+                  "type": "linear"
+                },
+                "showPoints": "never",
+                "spanNulls": false,
+                "stacking": {
+                  "group": "A",
+                  "mode": "none"
+                },
+                "thresholdsStyle": {
+                  "mode": "off"
                 }
               },
-              "mappings": []
+              "mappings": [],
+              "thresholds": {
+                "mode": "absolute",
+                "steps": [
+                  {
+                    "color": "green"
+                  },
+                  {
+                    "color": "red",
+                    "value": 80
+                  }
+                ]
+              }
             },
             "overrides": [
               {
                 "matcher": {
                   "id": "byName",
-                  "options": "Running"
+                  "options": "ReadOnly"
                 },
                 "properties": [
                   {
                     "id": "color",
                     "value": {
-                      "fixedColor": "green",
+                      "fixedColor": "orange",
                       "mode": "fixed"
                     }
                   }
@@ -2054,13 +2438,13 @@
               {
                 "matcher": {
                   "id": "byName",
-                  "options": "ReadOnly"
+                  "options": "Removing"
                 },
                 "properties": [
                   {
                     "id": "color",
                     "value": {
-                      "fixedColor": "orange",
+                      "fixedColor": "red",
                       "mode": "fixed"
                     }
                   }
@@ -2069,13 +2453,13 @@
               {
                 "matcher": {
                   "id": "byName",
-                  "options": "Removing"
+                  "options": "Running"
                 },
                 "properties": [
                   {
                     "id": "color",
                     "value": {
-                      "fixedColor": "red",
+                      "fixedColor": "green",
                       "mode": "fixed"
                     }
                   }
@@ -2100,27 +2484,19 @@
           },
           "gridPos": {
             "h": 6,
-            "w": 6,
-            "x": 6,
-            "y": 17
+            "w": 12,
+            "x": 12,
+            "y": 4
           },
-          "id": 87,
+          "id": 89,
           "options": {
             "legend": {
-              "displayMode": "table",
-              "placement": "right",
-              "showLegend": true,
-              "values": [
-                "value"
-              ]
-            },
-            "pieType": "pie",
-            "reduceOptions": {
               "calcs": [
                 "lastNotNull"
               ],
-              "fields": "",
-              "values": false
+              "displayMode": "table",
+              "placement": "right",
+              "showLegend": true
             },
             "tooltip": {
               "mode": "single",
@@ -2134,378 +2510,741 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "builder",
-              "expr": "region_num{type=\"SchemaRegion\"}",
+              "exemplar": true,
+              "expr": "region_num{type=\"SchemaRegion\", instance=\"$instance\"}",
+              "interval": "",
               "legendFormat": "{{status}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "SchemaRegion Current Status",
-          "type": "piechart"
+          "title": "SchemaRegion Status History",
+          "type": "timeseries"
+        }
+      ],
+      "title": "Region",
+      "type": "row"
+    },
+    {
+      "collapsed": false,
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 4
+      },
+      "id": 109,
+      "panels": [],
+      "title": "ConfigRegion Ratis Consensus",
+      "type": "row"
+    },
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 10,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "never",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [
+            {
+              "options": {
+                "match": "empty",
+                "result": {
+                  "index": 0,
+                  "text": "0"
+                }
+              },
+              "type": "special"
+            },
+            {
+              "options": {
+                "match": "null+nan",
+                "result": {
+                  "index": 1,
+                  "text": "0"
+                }
+              },
+              "type": "special"
+            }
+          ],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          },
+          "unit": "s"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 12,
+        "x": 0,
+        "y": 5
+      },
+      "id": 111,
+      "options": {
+        "legend": {
+          "calcs": [
+            "mean"
+          ],
+          "displayMode": "table",
+          "placement": "right"
         },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "The status history of cluster SchemaRegions",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "palette-classic"
-              },
-              "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
-                "axisLabel": "",
-                "axisPlacement": "auto",
-                "barAlignment": 0,
-                "drawStyle": "line",
-                "fillOpacity": 10,
-                "gradientMode": "none",
-                "hideFrom": {
-                  "legend": false,
-                  "tooltip": false,
-                  "viz": false
-                },
-                "lineInterpolation": "linear",
-                "lineWidth": 1,
-                "pointSize": 5,
-                "scaleDistribution": {
-                  "type": "linear"
-                },
-                "showPoints": "never",
-                "spanNulls": false,
-                "stacking": {
-                  "group": "A",
-                  "mode": "none"
-                },
-                "thresholdsStyle": {
-                  "mode": "off"
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_log_worker_appendEntryLatency_seconds_sum{instance=\"$instance\"}[1m])/rate(ConfigRegion_ratis_log_worker_appendEntryLatency_seconds_count{instance=\"$instance\"}[1m])",
+          "interval": "",
+          "legendFormat": "appendEntryLatency",
+          "refId": "A"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_server_follower_append_entry_latency_seconds_sum{instance=\"$instance\"}[1m])/rate(ConfigRegion_ratis_server_follower_append_entry_latency_seconds_count{instance=\"$instance\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "followerAppendEntryLatency",
+          "refId": "B"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_consensus_write_seconds_sum{instance=\"$instance\", stage=\"writeStateMachine\"}[1m]) / rate(ConfigRegion_ratis_consensus_write_seconds_count{instance=\"$instance\", stage=\"writeStateMachine\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "writeStateMachine",
+          "refId": "C"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_server_clientWriteRequest_seconds_sum{instance=\"$instance\"}[1m])/rate(ConfigRegion_ratis_server_clientWriteRequest_seconds_count{instance=\"$instance\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "clientWriteRequest",
+          "refId": "D"
+        }
+      ],
+      "title": "Ratis Stage Time",
+      "type": "timeseries"
+    },
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 10,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "never",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [
+            {
+              "options": {
+                "match": "empty",
+                "result": {
+                  "index": 0,
+                  "text": "0"
                 }
               },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  },
-                  {
-                    "color": "red",
-                    "value": 80
-                  }
-                ]
-              }
+              "type": "special"
             },
-            "overrides": [
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "ReadOnly"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "orange",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Removing"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "red",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+            {
+              "options": {
+                "match": "null+nan",
+                "result": {
+                  "index": 1,
+                  "text": "0"
+                }
               },
+              "type": "special"
+            }
+          ],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
               {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Running"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "green",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+                "color": "green",
+                "value": null
               },
               {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Unknown"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "yellow",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+                "color": "red",
+                "value": 80
               }
             ]
           },
-          "gridPos": {
-            "h": 6,
-            "w": 12,
-            "x": 12,
-            "y": 17
+          "unit": "s"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 12,
+        "x": 12,
+        "y": 5
+      },
+      "id": 112,
+      "options": {
+        "legend": {
+          "calcs": [
+            "mean"
+          ],
+          "displayMode": "table",
+          "placement": "right"
+        },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
           },
-          "id": 89,
-          "options": {
-            "legend": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "displayMode": "table",
-              "placement": "right",
-              "showLegend": true
-            },
-            "tooltip": {
-              "mode": "single",
-              "sort": "none"
-            }
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_log_worker_queueingDelay_seconds_sum{instance=\"$instance\"}[1m]) / rate(ConfigRegion_ratis_log_worker_queueingDelay_seconds_count{instance=\"$instance\"}[1m])",
+          "interval": "",
+          "legendFormat": "queueingDelay",
+          "refId": "A"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
           },
-          "targets": [
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "builder",
-              "expr": "region_num{type=\"SchemaRegion\"}",
-              "legendFormat": "{{status}}",
-              "range": true,
-              "refId": "A"
-            }
-          ],
-          "title": "SchemaRegion Status History",
-          "type": "timeseries"
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_log_worker_enqueuedTime_seconds_sum{instance=\"$instance\"}[1m]) / rate(ConfigRegion_ratis_log_worker_enqueuedTime_seconds_count{instance=\"$instance\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "enqueuedTime",
+          "refId": "B"
         },
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "The number of cluster DataRegions",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              }
-            },
-            "overrides": []
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_log_worker_writelogExecutionTime_seconds_sum {instance=\"$instance\"}[1m]) / rate(ConfigRegion_ratis_log_worker_writelogExecutionTime_seconds_count{instance=\"$instance\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "writelogExecutionTime",
+          "refId": "C"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
           },
-          "gridPos": {
-            "h": 6,
-            "w": 6,
-            "x": 0,
-            "y": 23
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_log_worker_flushTime_seconds_sum{instance=\"$instance\"}[1m]) / rate(ConfigRegion_ratis_log_worker_flushTime_seconds_count{instance=\"$instance\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "flushTime",
+          "refId": "D"
+        }
+      ],
+      "title": "Write Log Entry",
+      "type": "timeseries"
+    },
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
           },
-          "id": 85,
-          "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 10,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
             },
-            "textMode": "auto"
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "never",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
           },
-          "pluginVersion": "9.3.6",
-          "targets": [
+          "mappings": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
+              "options": {
+                "match": "empty",
+                "result": {
+                  "index": 0,
+                  "text": "0"
+                }
               },
-              "editorMode": "builder",
-              "expr": "sum by (type) (region_num{type=\"DataRegion\"})",
-              "legendFormat": "__auto",
-              "range": true,
-              "refId": "A"
+              "type": "special"
+            },
+            {
+              "options": {
+                "match": "null+nan",
+                "result": {
+                  "index": 1,
+                  "text": "0"
+                }
+              },
+              "type": "special"
             }
           ],
-          "title": "DataRegion Count",
-          "type": "stat"
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          },
+          "unit": "s"
+        },
+        "overrides": [
+          {
+            "__systemRef": "hideSeriesFrom",
+            "matcher": {
+              "id": "byNames",
+              "options": {
+                "mode": "exclude",
+                "names": [
+                  "writeLocally"
+                ],
+                "prefix": "All except:",
+                "readOnly": true
+              }
+            },
+            "properties": [
+              {
+                "id": "custom.hideFrom",
+                "value": {
+                  "legend": false,
+                  "tooltip": false,
+                  "viz": true
+                }
+              }
+            ]
+          }
+        ]
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 8,
+        "x": 0,
+        "y": 14
+      },
+      "id": 113,
+      "options": {
+        "legend": {
+          "calcs": [
+            "mean"
+          ],
+          "displayMode": "table",
+          "placement": "right"
         },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "The current status of cluster DataRegions",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "palette-classic"
-              },
-              "custom": {
-                "hideFrom": {
-                  "legend": false,
-                  "tooltip": false,
-                  "viz": false
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_consensus_write_seconds_sum{instance=\"$instance\", stage=\"writeLocally\"}[1m]) / rate(ConfigRegion_ratis_consensus_write_seconds_count{instance=\"$instance\", stage=\"writeLocally\"}[1m])",
+          "interval": "",
+          "legendFormat": "{{stage}}",
+          "refId": "A"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_consensus_write_seconds_sum{instance=\"$instance\", stage=\"writeRemotely\"}[1m]) / rate(ConfigRegion_ratis_consensus_write_seconds_count{instance=\"$instance\", stage=\"writeRemotely\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "{{stage}}",
+          "refId": "B"
+        }
+      ],
+      "title": "Remote / Local Write Time",
+      "type": "timeseries"
+    },
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 10,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "never",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [
+            {
+              "options": {
+                "match": "empty",
+                "result": {
+                  "index": 0,
+                  "text": "0"
                 }
               },
-              "mappings": []
+              "type": "special"
             },
-            "overrides": [
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Running"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "green",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "ReadOnly"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "orange",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+            {
+              "options": {
+                "match": "null+nan",
+                "result": {
+                  "index": 1,
+                  "text": "0"
+                }
               },
+              "type": "special"
+            }
+          ],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
               {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Removing"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "red",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+                "color": "green",
+                "value": null
               },
               {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Unknown"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "yellow",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
+                "color": "red",
+                "value": 80
               }
             ]
           },
-          "gridPos": {
-            "h": 6,
-            "w": 6,
-            "x": 6,
-            "y": 23
+          "unit": "reqps"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 8,
+        "x": 8,
+        "y": 14
+      },
+      "id": 114,
+      "options": {
+        "legend": {
+          "calcs": [
+            "mean"
+          ],
+          "displayMode": "table",
+          "placement": "right"
+        },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
           },
-          "id": 93,
-          "options": {
-            "legend": {
-              "displayMode": "table",
-              "placement": "right",
-              "showLegend": true,
-              "values": [
-                "value"
-              ]
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_consensus_write_seconds_count{instance=\"$instance\", stage=\"writeLocally\"}[1m])",
+          "interval": "",
+          "legendFormat": "{{stage}}",
+          "refId": "A"
+        },
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "rate(ConfigRegion_ratis_consensus_write_seconds_count{instance=\"$instance\", stage=\"writeRemotely\"}[1m])",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "{{stage}}",
+          "refId": "B"
+        }
+      ],
+      "title": "Remote / Local Write QPS",
+      "type": "timeseries"
+    },
+    {
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 10,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
             },
-            "pieType": "pie",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
             },
-            "tooltip": {
-              "mode": "single",
-              "sort": "none"
+            "showPoints": "never",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
             }
           },
-          "pluginVersion": "9.3.6",
-          "targets": [
+          "mappings": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
+              "options": {
+                "match": "empty",
+                "result": {
+                  "index": 0,
+                  "text": "0"
+                }
               },
-              "editorMode": "builder",
-              "expr": "region_num{type=\"DataRegion\"}",
-              "legendFormat": "{{status}}",
-              "range": true,
-              "refId": "A"
+              "type": "special"
+            },
+            {
+              "options": {
+                "match": "null+nan",
+                "result": {
+                  "index": 1,
+                  "text": "0"
+                }
+              },
+              "type": "special"
             }
           ],
-          "title": "DataRegion Current Status",
-          "type": "piechart"
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              },
+              {
+                "color": "red",
+                "value": 80
+              }
+            ]
+          },
+          "unit": "bytes"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 9,
+        "w": 8,
+        "x": 16,
+        "y": 14
+      },
+      "id": 115,
+      "options": {
+        "legend": {
+          "calcs": [
+            "mean"
+          ],
+          "displayMode": "table",
+          "placement": "right"
+        },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "exemplar": true,
+          "expr": "ConfigRegion_ratis_log_worker_closedSegmentsSizeInBytes {instance=\"$instance\"}",
+          "interval": "",
+          "legendFormat": "closedSegmentsSizeInBytes",
+          "refId": "A"
         },
         {
           "datasource": {
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "The status history of cluster DataRegions",
+          "exemplar": true,
+          "expr": "ConfigRegion_ratis_log_worker_openSegmentSizeInBytes {instance=\"$instance\"}",
+          "hide": false,
+          "interval": "",
+          "legendFormat": "openSegmentSizeInBytes",
+          "refId": "B"
+        }
+      ],
+      "title": "RatisConsensus Memory",
+      "type": "timeseries"
+    },
+    {
+      "collapsed": true,
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 23
+      },
+      "id": 13,
+      "panels": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
+                "axisSoftMax": 0,
+                "axisSoftMin": 0,
                 "barAlignment": 0,
                 "drawStyle": "line",
                 "fillOpacity": 10,
@@ -2533,97 +3272,34 @@
               },
               "mappings": [],
               "thresholds": {
-                "mode": "absolute",
+                "mode": "percentage",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              }
-            },
-            "overrides": [
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "ReadOnly"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "orange",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Removing"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "red",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Running"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "green",
-                      "mode": "fixed"
-                    }
+                    "color": "green"
                   }
                 ]
               },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "Unknown"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "yellow",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              }
-            ]
+              "unit": "percent"
+            },
+            "overrides": []
           },
           "gridPos": {
-            "h": 6,
-            "w": 12,
-            "x": 12,
-            "y": 23
+            "h": 8,
+            "w": 8,
+            "x": 0,
+            "y": 5
           },
-          "id": 91,
+          "id": 15,
           "options": {
             "legend": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "displayMode": "table",
-              "placement": "right",
+              "calcs": [],
+              "displayMode": "list",
+              "placement": "bottom",
               "showLegend": true
             },
             "tooltip": {
-              "mode": "single",
-              "sort": "none"
+              "mode": "multi",
+              "sort": "desc"
             }
           },
           "targets": [
@@ -2632,100 +3308,29 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "builder",
-              "expr": "region_num{type=\"DataRegion\"}",
-              "legendFormat": "{{status}}",
+              "editorMode": "code",
+              "exemplar": true,
+              "expr": "sys_cpu_load{instance=\"$instance\",name=\"system\"}",
+              "interval": "",
+              "legendFormat": "System CPU Load",
               "range": true,
               "refId": "A"
-            }
-          ],
-          "title": "DataRegion Status History",
-          "type": "timeseries"
-        }
-      ],
-      "title": "Region",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "lfuOmw1Vk"
-      },
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 17
-      },
-      "id": 13,
-      "panels": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "thresholds"
-              },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  },
-                  {
-                    "color": "red",
-                    "value": 80
-                  }
-                ]
-              },
-              "unit": "Core"
-            },
-            "overrides": []
-          },
-          "gridPos": {
-            "h": 8,
-            "w": 8,
-            "x": 0,
-            "y": 18
-          },
-          "id": 14,
-          "options": {
-            "colorMode": "value",
-            "graphMode": "area",
-            "justifyMode": "auto",
-            "orientation": "auto",
-            "reduceOptions": {
-              "calcs": [
-                "lastNotNull"
-              ],
-              "fields": "",
-              "values": false
             },
-            "textMode": "auto"
-          },
-          "pluginVersion": "9.3.6",
-          "targets": [
             {
               "datasource": {
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "code",
-              "expr": "sys_cpu_cores{instance=\"$instance\",name=\"system\"}",
+              "expr": "process_cpu_load{instance=\"$instance\",name=\"process\"}",
               "hide": false,
-              "legendFormat": "Process CPU Time",
+              "legendFormat": "Process CPU Load",
               "range": true,
               "refId": "B"
             }
           ],
-          "title": "CPU Core",
-          "type": "stat"
+          "title": "CPU Load",
+          "type": "timeseries"
         },
         {
           "datasource": {
@@ -2738,8 +3343,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "axisSoftMax": 0,
@@ -2774,12 +3377,11 @@
                 "mode": "percentage",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
-              "unit": "percent"
+              "unit": "ns"
             },
             "overrides": []
           },
@@ -2787,9 +3389,9 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 18
+            "y": 5
           },
-          "id": 15,
+          "id": 16,
           "options": {
             "legend": {
               "calcs": [],
@@ -2809,27 +3411,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "code",
-              "exemplar": true,
-              "expr": "sys_cpu_load{instance=\"$instance\",name=\"system\"}",
-              "interval": "",
-              "legendFormat": "System CPU Load",
-              "range": true,
-              "refId": "A"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "code",
-              "expr": "process_cpu_load{instance=\"$instance\",name=\"process\"}",
+              "expr": "sum(rate(process_cpu_time{instance=\"$instance\",name=\"process\"}[1m]))*60",
               "hide": false,
-              "legendFormat": "Process CPU Load",
+              "legendFormat": "Process CPU Time",
               "range": true,
               "refId": "B"
             }
           ],
-          "title": "CPU Load",
+          "title": "CPU Time Per Minute",
           "type": "timeseries"
         },
         {
@@ -2843,12 +3432,8 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
-                "axisSoftMax": 0,
-                "axisSoftMin": 0,
                 "barAlignment": 0,
                 "drawStyle": "line",
                 "fillOpacity": 10,
@@ -2876,25 +3461,70 @@
               },
               "mappings": [],
               "thresholds": {
-                "mode": "percentage",
+                "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
+                  }
+                ]
+              },
+              "unit": "none"
+            },
+            "overrides": [
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "warn"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "orange",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "trace"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "purple",
+                      "mode": "fixed"
+                    }
+                  }
+                ]
+              },
+              {
+                "matcher": {
+                  "id": "byName",
+                  "options": "error"
+                },
+                "properties": [
+                  {
+                    "id": "color",
+                    "value": {
+                      "fixedColor": "red",
+                      "mode": "fixed"
+                    }
                   }
                 ]
-              },
-              "unit": "ns"
-            },
-            "overrides": []
+              }
+            ]
           },
           "gridPos": {
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 18
+            "y": 5
           },
-          "id": 16,
+          "id": 25,
           "options": {
             "legend": {
               "calcs": [],
@@ -2914,14 +3544,16 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "editorMode": "code",
-              "expr": "sum(rate(process_cpu_time{instance=\"$instance\",name=\"process\"}[1m]))*60",
+              "exemplar": true,
+              "expr": "sum(rate(logback_events_total{instance=~\"${instance}\"}[1m])) by (level) * 60",
               "hide": false,
-              "legendFormat": "Process CPU Time",
+              "interval": "",
+              "legendFormat": "{{level}}",
               "range": true,
-              "refId": "B"
+              "refId": "C"
             }
           ],
-          "title": "CPU Time Per Minute",
+          "title": "Log Number Per Minute",
           "type": "timeseries"
         },
         {
@@ -2935,8 +3567,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -2969,8 +3599,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -2982,7 +3611,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 26
+            "y": 13
           },
           "id": 17,
           "options": {
@@ -3052,8 +3681,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3086,8 +3713,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -3130,7 +3756,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 26
+            "y": 13
           },
           "id": 18,
           "options": {
@@ -3187,8 +3813,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3221,8 +3845,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   },
                   {
                     "color": "red",
@@ -3238,7 +3861,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 26
+            "y": 13
           },
           "id": 19,
           "options": {
@@ -3304,8 +3927,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3338,8 +3959,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -3350,7 +3970,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 34
+            "y": 21
           },
           "id": 20,
           "options": {
@@ -3406,8 +4026,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3440,8 +4058,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -3453,7 +4070,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 34
+            "y": 21
           },
           "id": 21,
           "options": {
@@ -3507,8 +4124,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3541,8 +4156,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -3553,7 +4167,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 34
+            "y": 21
           },
           "id": 22,
           "options": {
@@ -3609,8 +4223,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3643,8 +4255,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -3656,7 +4267,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 42
+            "y": 29
           },
           "id": 23,
           "options": {
@@ -3748,8 +4359,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3782,8 +4391,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -3795,7 +4403,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 42
+            "y": 29
           },
           "id": 24,
           "options": {
@@ -3839,8 +4447,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -3853,6 +4459,9 @@
                   "viz": false
                 },
                 "lineInterpolation": "linear",
+                "lineStyle": {
+                  "fill": "solid"
+                },
                 "lineWidth": 1,
                 "pointSize": 5,
                 "scaleDistribution": {
@@ -3873,68 +4482,20 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              },
-              "unit": "none"
-            },
-            "overrides": [
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "warn"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "orange",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "trace"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "purple",
-                      "mode": "fixed"
-                    }
-                  }
-                ]
-              },
-              {
-                "matcher": {
-                  "id": "byName",
-                  "options": "error"
-                },
-                "properties": [
-                  {
-                    "id": "color",
-                    "value": {
-                      "fixedColor": "red",
-                      "mode": "fixed"
-                    }
+                    "color": "green"
                   }
                 ]
               }
-            ]
+            },
+            "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 42
+            "y": 29
           },
-          "id": 25,
+          "id": 27,
           "options": {
             "legend": {
               "calcs": [],
@@ -3955,92 +4516,12 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "sum(rate(logback_events_total{instance=~\"${instance}\"}[1m])) by (level) * 60",
-              "hide": false,
+              "expr": "jvm_classes_unloaded_classes{instance=~\"$instance\"}",
               "interval": "",
-              "legendFormat": "{{level}}",
+              "legendFormat": "Unloaded Number",
               "range": true,
-              "refId": "C"
-            }
-          ],
-          "title": "Log Number Per Minute",
-          "type": "timeseries"
-        },
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
-          "description": "",
-          "fieldConfig": {
-            "defaults": {
-              "color": {
-                "mode": "palette-classic"
-              },
-              "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
-                "axisLabel": "",
-                "axisPlacement": "auto",
-                "barAlignment": 0,
-                "drawStyle": "line",
-                "fillOpacity": 10,
-                "gradientMode": "none",
-                "hideFrom": {
-                  "legend": false,
-                  "tooltip": false,
-                  "viz": false
-                },
-                "lineInterpolation": "linear",
-                "lineWidth": 1,
-                "pointSize": 5,
-                "scaleDistribution": {
-                  "type": "linear"
-                },
-                "showPoints": "never",
-                "spanNulls": false,
-                "stacking": {
-                  "group": "A",
-                  "mode": "none"
-                },
-                "thresholdsStyle": {
-                  "mode": "off"
-                }
-              },
-              "mappings": [],
-              "thresholds": {
-                "mode": "absolute",
-                "steps": [
-                  {
-                    "color": "green",
-                    "value": null
-                  }
-                ]
-              },
-              "unit": "ms"
-            },
-            "overrides": []
-          },
-          "gridPos": {
-            "h": 8,
-            "w": 8,
-            "x": 0,
-            "y": 50
-          },
-          "id": 26,
-          "options": {
-            "legend": {
-              "calcs": [],
-              "displayMode": "list",
-              "placement": "bottom",
-              "showLegend": true
+              "refId": "A"
             },
-            "tooltip": {
-              "mode": "multi",
-              "sort": "desc"
-            }
-          },
-          "targets": [
             {
               "datasource": {
                 "type": "prometheus",
@@ -4048,14 +4529,15 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "sum(rate(jvm_compilation_time_ms{instance=~\"${instance}\"}[1m]))*60",
+              "expr": "jvm_classes_loaded_classes{instance=~\"$instance\"}",
+              "hide": false,
               "interval": "",
-              "legendFormat": "compiler",
+              "legendFormat": "Loaded Number",
               "range": true,
-              "refId": "A"
+              "refId": "B"
             }
           ],
-          "title": "The Time Consumed of Compilation Per Minute",
+          "title": "The  Number Of Class",
           "type": "timeseries"
         },
         {
@@ -4063,14 +4545,13 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4083,9 +4564,6 @@
                   "viz": false
                 },
                 "lineInterpolation": "linear",
-                "lineStyle": {
-                  "fill": "solid"
-                },
                 "lineWidth": 1,
                 "pointSize": 5,
                 "scaleDistribution": {
@@ -4106,21 +4584,21 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "ms"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 8,
-            "x": 8,
-            "y": 50
+            "x": 0,
+            "y": 37
           },
-          "id": 27,
+          "id": 26,
           "options": {
             "legend": {
               "calcs": [],
@@ -4141,28 +4619,14 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "jvm_classes_unloaded_classes{instance=~\"$instance\"}",
+              "expr": "sum(rate(jvm_compilation_time_ms{instance=~\"${instance}\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "Unloaded Number",
+              "legendFormat": "compiler",
               "range": true,
               "refId": "A"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "code",
-              "exemplar": true,
-              "expr": "jvm_classes_loaded_classes{instance=~\"$instance\"}",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "Loaded Number",
-              "range": true,
-              "refId": "B"
             }
           ],
-          "title": "The  Number Of Class",
+          "title": "The Time Consumed of Compilation Per Minute",
           "type": "timeseries"
         }
       ],
@@ -4170,7 +4634,7 @@
         {
           "datasource": {
             "type": "prometheus",
-            "uid": "lfuOmw1Vk"
+            "uid": "${DS_PROMETHEUS}"
           },
           "refId": "A"
         }
@@ -4182,13 +4646,13 @@
       "collapsed": true,
       "datasource": {
         "type": "prometheus",
-        "uid": "lfuOmw1Vk"
+        "uid": "${DS_PROMETHEUS}"
       },
       "gridPos": {
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 18
+        "y": 24
       },
       "id": 29,
       "panels": [
@@ -4203,8 +4667,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "axisSoftMax": 1,
@@ -4239,8 +4701,7 @@
                 "mode": "percentage",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   },
                   {
                     "color": "#EAB839",
@@ -4260,7 +4721,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 59
+            "y": 6
           },
           "id": 31,
           "options": {
@@ -4308,8 +4769,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4342,8 +4801,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4355,7 +4813,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 59
+            "y": 6
           },
           "id": 33,
           "options": {
@@ -4403,8 +4861,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4437,8 +4893,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4450,7 +4905,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 67
+            "y": 14
           },
           "id": 35,
           "options": {
@@ -4497,8 +4952,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4531,8 +4984,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4544,7 +4996,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 67
+            "y": 14
           },
           "id": 37,
           "options": {
@@ -4587,8 +5039,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4621,8 +5071,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4634,7 +5083,7 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 75
+            "y": 22
           },
           "id": 39,
           "options": {
@@ -4683,8 +5132,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4717,8 +5164,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4730,7 +5176,7 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 75
+            "y": 22
           },
           "id": 41,
           "options": {
@@ -4776,8 +5222,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4810,8 +5254,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               }
@@ -4822,7 +5265,7 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 75
+            "y": 22
           },
           "id": 43,
           "options": {
@@ -4870,8 +5313,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4904,8 +5345,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -4917,7 +5357,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 83
+            "y": 30
           },
           "id": 47,
           "options": {
@@ -4961,8 +5401,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -4995,8 +5433,7 @@
                 "mode": "absolute",
                 "steps": [
                   {
-                    "color": "green",
-                    "value": null
+                    "color": "green"
                   }
                 ]
               },
@@ -5008,7 +5445,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 83
+            "y": 30
           },
           "id": 45,
           "options": {
@@ -5048,7 +5485,7 @@
         {
           "datasource": {
             "type": "prometheus",
-            "uid": "lfuOmw1Vk"
+            "uid": "${DS_PROMETHEUS}"
           },
           "refId": "A"
         }
@@ -5057,8 +5494,8 @@
       "type": "row"
     }
   ],
-  "refresh": "15s",
-  "schemaVersion": 37,
+  "refresh": false,
+  "schemaVersion": 35,
   "style": "dark",
   "tags": [
     "Apache-IoTDB",
@@ -5114,7 +5551,7 @@
     ]
   },
   "time": {
-    "from": "now-30m",
+    "from": "now-1h",
     "to": "now"
   },
   "timepicker": {
@@ -5128,8 +5565,8 @@
     ]
   },
   "timezone": "browser",
-  "title": "yesterday dashboard",
-  "uid": "TbEVYRw7T666",
-  "version": 1,
+  "title": "Apache IoTDB ConfigNode Dashboard",
+  "uid": "4WkTYkx4z",
+  "version": 15,
   "weekStart": ""
 }
\ No newline at end of file
diff --git a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
index 673e00ba31..bdbe5ec5a3 100644
--- a/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
+++ b/docs/UserGuide/Monitor-Alert/Apache-IoTDB-DataNode-Dashboard.json
@@ -9,7 +9,7 @@
       "pluginName": "Prometheus"
     }
   ],
-  "__elements": {},
+  "__elements": [],
   "__requires": [
     {
       "type": "panel",
@@ -21,7 +21,7 @@
       "type": "grafana",
       "id": "grafana",
       "name": "Grafana",
-      "version": "9.3.1"
+      "version": "8.4.2"
     },
     {
       "type": "panel",
@@ -75,18 +75,47 @@
   "fiscalYearStartMonth": 0,
   "graphTooltip": 1,
   "id": null,
+  "iteration": 1679118029653,
   "links": [],
   "liveNow": false,
   "panels": [
     {
+      "collapsed": false,
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 0
+      },
+      "id": 1,
+      "panels": [],
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "refId": "A"
+        }
+      ],
+      "title": "Overview",
+      "type": "row"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
       "fieldConfig": {
         "defaults": {
           "color": {
             "mode": "palette-classic"
           },
           "custom": {
-            "axisCenteredZero": false,
-            "axisColorMode": "text",
             "axisLabel": "",
             "axisPlacement": "auto",
             "barAlignment": 0,
@@ -121,10 +150,6 @@
               {
                 "color": "green",
                 "value": null
-              },
-              {
-                "color": "red",
-                "value": 80
               }
             ]
           }
@@ -133,11 +158,99 @@
       },
       "gridPos": {
         "h": 8,
-        "w": 12,
+        "w": 8,
         "x": 0,
-        "y": 0
+        "y": 1
+      },
+      "id": 2,
+      "options": {
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true
+        },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": true,
+          "expr": "quantity{instance=~\"$instance\"}",
+          "interval": "",
+          "legendFormat": "{{name}}",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "The Number Of Entity",
+      "type": "timeseries"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
       },
-      "id": 231,
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          }
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 8,
+        "w": 8,
+        "x": 8,
+        "y": 1
+      },
+      "id": 3,
       "options": {
         "legend": {
           "calcs": [],
@@ -146,26 +259,130 @@
           "showLegend": true
         },
         "tooltip": {
-          "mode": "single",
+          "mode": "multi",
           "sort": "none"
         }
       },
-      "title": "Panel Title",
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": true,
+          "expr": "rate(quantity_total{instance=~\"$instance\"}[1m])",
+          "interval": "1m",
+          "legendFormat": "write point per second",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "Write Point Per Second",
+      "type": "timeseries"
+    },
+    {
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "fieldConfig": {
+        "defaults": {
+          "color": {
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
+          },
+          "mappings": [],
+          "thresholds": {
+            "mode": "absolute",
+            "steps": [
+              {
+                "color": "green",
+                "value": null
+              }
+            ]
+          },
+          "unit": "bytes"
+        },
+        "overrides": []
+      },
+      "gridPos": {
+        "h": 8,
+        "w": 8,
+        "x": 16,
+        "y": 1
+      },
+      "id": 4,
+      "options": {
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true
+        },
+        "tooltip": {
+          "mode": "multi",
+          "sort": "desc"
+        }
+      },
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "editorMode": "code",
+          "exemplar": true,
+          "expr": "mem{instance=~\"$instance\", name!=\"IoTConsensus\"}",
+          "interval": "",
+          "legendFormat": "{{name}}",
+          "range": true,
+          "refId": "A"
+        }
+      ],
+      "title": "Database Used Memory",
       "type": "timeseries"
     },
     {
       "collapsed": true,
       "datasource": {
         "type": "prometheus",
-        "uid": "lfuOmw1Vk"
+        "uid": "${DS_PROMETHEUS}"
       },
       "gridPos": {
         "h": 1,
         "w": 24,
         "x": 0,
-        "y": 8
+        "y": 9
       },
-      "id": 1,
+      "id": 5,
       "panels": [
         {
           "datasource": {
@@ -215,7 +432,8 @@
                     "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "s"
             },
             "overrides": []
           },
@@ -223,9 +441,9 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 49
+            "y": 50
           },
-          "id": 2,
+          "id": 6,
           "options": {
             "legend": {
               "calcs": [],
@@ -244,16 +462,15 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "quantity{instance=~\"$instance\"}",
+              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"0.5\"}",
+              "hide": false,
               "interval": "",
-              "legendFormat": "{{name}}",
-              "range": true,
+              "legendFormat": "{{type}}/{{interface}}",
               "refId": "A"
             }
           ],
-          "title": "The Number Of Entity",
+          "title": "The Time Consumed Of Operation (50%)",
           "type": "timeseries"
         },
         {
@@ -304,7 +521,8 @@
                     "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "s"
             },
             "overrides": []
           },
@@ -312,9 +530,9 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 49
+            "y": 50
           },
-          "id": 3,
+          "id": 55,
           "options": {
             "legend": {
               "calcs": [],
@@ -324,7 +542,7 @@
             },
             "tooltip": {
               "mode": "multi",
-              "sort": "none"
+              "sort": "desc"
             }
           },
           "targets": [
@@ -333,16 +551,15 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "rate(quantity_total{instance=~\"$instance\"}[1m])",
-              "interval": "1m",
-              "legendFormat": "write point per second",
-              "range": true,
+              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"0.75\"}",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "{{type}}/{{interface}}",
               "refId": "A"
             }
           ],
-          "title": "Write Point Per Second",
+          "title": "The Time Consumed Of Operation (75%)",
           "type": "timeseries"
         },
         {
@@ -394,7 +611,7 @@
                   }
                 ]
               },
-              "unit": "bytes"
+              "unit": "s"
             },
             "overrides": []
           },
@@ -402,9 +619,9 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 49
+            "y": 50
           },
-          "id": 4,
+          "id": 56,
           "options": {
             "legend": {
               "calcs": [],
@@ -423,49 +640,21 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "mem{instance=~\"$instance\", name!=\"IoTConsensus\"}",
+              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"1.0\"}",
+              "hide": false,
               "interval": "",
-              "legendFormat": "{{name}}",
-              "range": true,
+              "legendFormat": "{{type}}/{{interface}}",
               "refId": "A"
             }
           ],
-          "title": "Database Used Memory",
+          "title": "The Time Consumed Of Operation (100%)",
           "type": "timeseries"
-        }
-      ],
-      "targets": [
+        },
         {
           "datasource": {
             "type": "prometheus",
-            "uid": "lfuOmw1Vk"
-          },
-          "refId": "A"
-        }
-      ],
-      "title": "Overview",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "lfuOmw1Vk"
-      },
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 9
-      },
-      "id": 5,
-      "panels": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
+            "uid": "${DS_PROMETHEUS}"
           },
           "fieldConfig": {
             "defaults": {
@@ -511,7 +700,7 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
@@ -519,9 +708,9 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 50
+            "y": 58
           },
-          "id": 6,
+          "id": 9,
           "options": {
             "legend": {
               "calcs": [],
@@ -540,15 +729,16 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
+              "editorMode": "code",
               "exemplar": true,
-              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"0.5\"}",
-              "hide": false,
+              "expr": "rate(entry_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}/{{interface}}",
+              "legendFormat": "{{name}}",
+              "range": true,
               "refId": "A"
             }
           ],
-          "title": "The Time Consumed Of Operation (50%)",
+          "title": "The QPS Of Interface",
           "type": "timeseries"
         },
         {
@@ -608,9 +798,9 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 50
+            "y": 58
           },
-          "id": 55,
+          "id": 10,
           "options": {
             "legend": {
               "calcs": [],
@@ -629,15 +819,16 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
+              "editorMode": "code",
               "exemplar": true,
-              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"0.75\"}",
-              "hide": false,
+              "expr": "avg(rate(entry_seconds_sum{instance=~\"$instance\"}[1m])/rate(entry_seconds_count{instance=~\"$instance\"}[1m])) by (name,instance)",
               "interval": "",
-              "legendFormat": "{{type}}/{{interface}}",
+              "legendFormat": "{{name}}",
+              "range": true,
               "refId": "A"
             }
           ],
-          "title": "The Time Consumed Of Operation (75%)",
+          "title": "The Time Consumed Of Interface",
           "type": "timeseries"
         },
         {
@@ -681,6 +872,8 @@
                 }
               },
               "mappings": [],
+              "max": 1,
+              "min": 0,
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
@@ -689,7 +882,7 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "percentunit"
             },
             "overrides": []
           },
@@ -697,9 +890,9 @@
             "h": 8,
             "w": 8,
             "x": 16,
-            "y": 50
+            "y": 58
           },
-          "id": 56,
+          "id": 11,
           "options": {
             "legend": {
               "calcs": [],
@@ -712,6 +905,7 @@
               "sort": "desc"
             }
           },
+          "pluginVersion": "8.4.2",
           "targets": [
             {
               "datasource": {
@@ -719,14 +913,26 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "statement_execution_seconds{instance=~\"$instance\", quantile=\"1.0\"}",
-              "hide": false,
+              "expr": "avg(cache_total{instance=~\"$instance\", type=\"hit\"}) by (name) / avg(cache_total{instance=~\"$instance\", type=\"all\"}) by (name)",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{type}}/{{interface}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "exemplar": true,
+              "expr": "cache_hit{instance=~\"$instance\"} / 100",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "{{name}}",
+              "refId": "B"
             }
           ],
-          "title": "The Time Consumed Of Operation (100%)",
+          "title": "Cache Hit Rate",
           "type": "timeseries"
         },
         {
@@ -740,8 +946,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -786,9 +990,9 @@
             "h": 8,
             "w": 8,
             "x": 0,
-            "y": 58
+            "y": 66
           },
-          "id": 9,
+          "id": 12,
           "options": {
             "legend": {
               "calcs": [],
@@ -809,14 +1013,14 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "rate(entry_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "thrift_connections{instance=~\"$instance\"}",
               "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "The QPS Of Interface",
+          "title": "Thrift Connection",
           "type": "timeseries"
         },
         {
@@ -830,8 +1034,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -868,7 +1070,7 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
@@ -876,9 +1078,9 @@
             "h": 8,
             "w": 8,
             "x": 8,
-            "y": 58
+            "y": 66
           },
-          "id": 10,
+          "id": 13,
           "options": {
             "legend": {
               "calcs": [],
@@ -899,16 +1101,43 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "avg(rate(entry_seconds_sum{instance=~\"$instance\"}[1m])/rate(entry_seconds_count{instance=~\"$instance\"}[1m])) by (name,instance)",
+              "expr": "thrift_active_threads{instance=~\"$instance\"}",
               "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "The Time Consumed Of Interface",
+          "title": "Thrift Active Thread",
           "type": "timeseries"
-        },
+        }
+      ],
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "refId": "A"
+        }
+      ],
+      "title": "Interface",
+      "type": "row"
+    },
+    {
+      "collapsed": true,
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 10
+      },
+      "id": 14,
+      "panels": [
         {
           "datasource": {
             "type": "prometheus",
@@ -950,8 +1179,6 @@
                 }
               },
               "mappings": [],
-              "max": 1,
-              "min": 0,
               "thresholds": {
                 "mode": "absolute",
                 "steps": [
@@ -959,18 +1186,17 @@
                     "color": "green"
                   }
                 ]
-              },
-              "unit": "percentunit"
+              }
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 16,
-            "y": 58
+            "w": 12,
+            "x": 0,
+            "y": 11
           },
-          "id": 11,
+          "id": 15,
           "options": {
             "legend": {
               "calcs": [],
@@ -983,34 +1209,22 @@
               "sort": "desc"
             }
           },
-          "pluginVersion": "8.4.2",
           "targets": [
             {
               "datasource": {
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
+              "editorMode": "code",
               "exemplar": true,
-              "expr": "avg(cache_total{instance=~\"$instance\", type=\"hit\"}) by (name) / avg(cache_total{instance=~\"$instance\", type=\"all\"}) by (name)",
-              "format": "time_series",
+              "expr": "queue{instance=~\"$instance\"}",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{name}}-{{status}}",
+              "range": true,
               "refId": "A"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "exemplar": true,
-              "expr": "cache_hit{instance=~\"$instance\"} / 100",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "{{name}}",
-              "refId": "B"
             }
           ],
-          "title": "Cache Hit Rate",
+          "title": "Task Number",
           "type": "timeseries"
         },
         {
@@ -1024,6 +1238,8 @@
                 "mode": "palette-classic"
               },
               "custom": {
+                "axisCenteredZero": false,
+                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1060,17 +1276,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 0,
-            "y": 66
+            "w": 12,
+            "x": 12,
+            "y": 11
           },
-          "id": 12,
+          "id": 16,
           "options": {
             "legend": {
               "calcs": [],
@@ -1091,14 +1307,14 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "thrift_connections{instance=~\"$instance\"}",
+              "expr": "rate(cost_task_seconds_sum{instance=~\"$instance\"}[1m])/rate(cost_task_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
               "legendFormat": "{{name}}",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "Thrift Connection",
+          "title": "The Time Consumed of Task",
           "type": "timeseries"
         },
         {
@@ -1112,6 +1328,8 @@
                 "mode": "palette-classic"
               },
               "custom": {
+                "axisCenteredZero": false,
+                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -1148,17 +1366,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "bytes"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 8,
-            "x": 8,
-            "y": 66
+            "x": 0,
+            "y": 19
           },
-          "id": 13,
+          "id": 17,
           "options": {
             "legend": {
               "calcs": [],
@@ -1179,43 +1397,28 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "thrift_active_threads{instance=~\"$instance\"}",
+              "expr": "sum(rate(data_written_total{instance=~\"$instance\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "Write",
               "range": true,
               "refId": "A"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "expr": "sum(rate(data_read_total{instance=~\"$instance\"}[1m]))*60",
+              "hide": false,
+              "legendFormat": "Read",
+              "range": true,
+              "refId": "B"
             }
           ],
-          "title": "Thrift Active Thread",
+          "title": "Compaction Read And Write Per Minute",
           "type": "timeseries"
-        }
-      ],
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "lfuOmw1Vk"
-          },
-          "refId": "A"
-        }
-      ],
-      "title": "Interface",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "lfuOmw1Vk"
-      },
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 10
-      },
-      "id": 14,
-      "panels": [
+        },
         {
           "datasource": {
             "type": "prometheus",
@@ -1264,17 +1467,18 @@
                     "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 12,
-            "x": 0,
-            "y": 11
+            "w": 8,
+            "x": 8,
+            "y": 19
           },
-          "id": 15,
+          "id": 18,
           "options": {
             "legend": {
               "calcs": [],
@@ -1295,14 +1499,14 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "queue{instance=~\"$instance\"}",
+              "expr": "sum(rate(data_read_total{instance=~\"$instance\"}[1m]))*60 / sum(rate(data_written_total{instance=~\"$instance\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "{{name}}-{{status}}",
+              "legendFormat": "Ratio",
               "range": true,
               "refId": "A"
             }
           ],
-          "title": "Task Number",
+          "title": "Compaction R/W Ratio Per Minute",
           "type": "timeseries"
         },
         {
@@ -1354,17 +1558,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 12,
-            "x": 12,
-            "y": 11
+            "w": 8,
+            "x": 16,
+            "y": 19
           },
-          "id": 16,
+          "id": 19,
           "options": {
             "legend": {
               "calcs": [],
@@ -1385,14 +1589,42 @@
               },
               "editorMode": "code",
               "exemplar": true,
-              "expr": "rate(cost_task_seconds_sum{instance=~\"$instance\"}[1m])/rate(cost_task_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"inner_seq\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "sequence",
               "range": true,
               "refId": "A"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": true,
+              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"inner_unseq\"}[1m]))*60",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "unsequence",
+              "range": true,
+              "refId": "B"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "editorMode": "code",
+              "exemplar": true,
+              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"cross\"}[1m]))*60",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "cross",
+              "range": true,
+              "refId": "C"
             }
           ],
-          "title": "The Time Consumed of Task",
+          "title": "Compaction Number Per Minute",
           "type": "timeseries"
         },
         {
@@ -1443,18 +1675,17 @@
                     "color": "green"
                   }
                 ]
-              },
-              "unit": "bytes"
+              }
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
+            "w": 12,
             "x": 0,
-            "y": 19
+            "y": 27
           },
-          "id": 17,
+          "id": 169,
           "options": {
             "legend": {
               "calcs": [],
@@ -1463,8 +1694,8 @@
               "showLegend": true
             },
             "tooltip": {
-              "mode": "multi",
-              "sort": "desc"
+              "mode": "single",
+              "sort": "none"
             }
           },
           "targets": [
@@ -1473,12 +1704,10 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "sum(rate(data_written_total{instance=~\"$instance\"}[1m]))*60",
+              "expr": "sum(rate(Compacted_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "Write",
-              "range": true,
+              "legendFormat": "Compacted Chunk Num Per Min",
               "refId": "A"
             },
             {
@@ -1486,15 +1715,39 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
-              "expr": "sum(rate(data_read_total{instance=~\"$instance\"}[1m]))*60",
+              "exemplar": true,
+              "expr": "sum(rate(Deserialized_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
               "hide": false,
-              "legendFormat": "Read",
-              "range": true,
+              "interval": "",
+              "legendFormat": "Deserialized Chunk Num Per Min",
               "refId": "B"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "exemplar": true,
+              "expr": "sum(rate(Directly_Flush_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "Directly Flush Chunk Num Per Min",
+              "refId": "C"
+            },
+            {
+              "datasource": {
+                "type": "prometheus",
+                "uid": "${DS_PROMETHEUS}"
+              },
+              "exemplar": true,
+              "expr": "sum(rate(Merged_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
+              "hide": false,
+              "interval": "",
+              "legendFormat": "Merged Chunk Num Per Min",
+              "refId": "D"
             }
           ],
-          "title": "Compaction Read And Write Per Minute",
+          "title": "Compaction Process Chunk Status",
           "type": "timeseries"
         },
         {
@@ -1545,18 +1798,17 @@
                     "color": "green"
                   }
                 ]
-              },
-              "unit": "none"
+              }
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 8,
-            "y": 19
+            "w": 12,
+            "x": 12,
+            "y": 27
           },
-          "id": 18,
+          "id": 171,
           "options": {
             "legend": {
               "calcs": [],
@@ -1565,8 +1817,8 @@
               "showLegend": true
             },
             "tooltip": {
-              "mode": "multi",
-              "sort": "desc"
+              "mode": "single",
+              "sort": "none"
             }
           },
           "targets": [
@@ -1575,18 +1827,43 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "sum(rate(data_read_total{instance=~\"$instance\"}[1m]))*60 / sum(rate(data_written_total{instance=~\"$instance\"}[1m]))*60",
+              "expr": "sum(rate(Compacted_Point_Num_total{instance=~\"$instance\"}[1m]))*60",
               "interval": "",
-              "legendFormat": "Ratio",
-              "range": true,
+              "legendFormat": "Compacted Point Num Per Min",
               "refId": "A"
             }
           ],
-          "title": "Compaction R/W Ratio Per Minute",
+          "title": "Compacted Point Num Per Minute",
           "type": "timeseries"
-        },
+        }
+      ],
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "refId": "A"
+        }
+      ],
+      "title": "Engine",
+      "type": "row"
+    },
+    {
+      "collapsed": true,
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 11
+      },
+      "id": 58,
+      "panels": [
         {
           "datasource": {
             "type": "prometheus",
@@ -1636,17 +1913,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 16,
-            "y": 19
+            "w": 6,
+            "x": 0,
+            "y": 12
           },
-          "id": 19,
+          "id": 80,
           "options": {
             "legend": {
               "calcs": [],
@@ -1665,44 +1942,14 @@
                 "type": "prometheus",
                 "uid": "${DS_PROMETHEUS}"
               },
-              "editorMode": "code",
               "exemplar": true,
-              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"inner_seq\"}[1m]))*60",
+              "expr": "rate(query_plan_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(query_plan_cost_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "sequence",
-              "range": true,
+              "legendFormat": "{{stage}}",
               "refId": "A"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "code",
-              "exemplar": true,
-              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"inner_unseq\"}[1m]))*60",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "unsequence",
-              "range": true,
-              "refId": "B"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "editorMode": "code",
-              "exemplar": true,
-              "expr": "sum(rate(compaction_task_count{instance=\"$instance\", name = \"cross\"}[1m]))*60",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "cross",
-              "range": true,
-              "refId": "C"
             }
           ],
-          "title": "Compaction Number Per Minute",
+          "title": "The time consumed of query plan stages(avg)",
           "type": "timeseries"
         },
         {
@@ -1753,17 +2000,18 @@
                     "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 12,
-            "x": 0,
-            "y": 27
+            "w": 6,
+            "x": 6,
+            "y": 12
           },
-          "id": 169,
+          "id": 60,
           "options": {
             "legend": {
               "calcs": [],
@@ -1772,8 +2020,8 @@
               "showLegend": true
             },
             "tooltip": {
-              "mode": "single",
-              "sort": "none"
+              "mode": "multi",
+              "sort": "desc"
             }
           },
           "targets": [
@@ -1783,49 +2031,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(Compacted_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
+              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
-              "legendFormat": "Compacted Chunk Num Per Min",
+              "legendFormat": "{{stage}}",
               "refId": "A"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "exemplar": true,
-              "expr": "sum(rate(Deserialized_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "Deserialized Chunk Num Per Min",
-              "refId": "B"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "exemplar": true,
-              "expr": "sum(rate(Directly_Flush_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "Directly Flush Chunk Num Per Min",
-              "refId": "C"
-            },
-            {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "${DS_PROMETHEUS}"
-              },
-              "exemplar": true,
-              "expr": "sum(rate(Merged_Chunk_Num_total{instance=~\"$instance\"}[1m]))*60",
-              "hide": false,
-              "interval": "",
-              "legendFormat": "Merged Chunk Num Per Min",
-              "refId": "D"
             }
           ],
-          "title": "Compaction Process Chunk Status",
+          "title": "The time consumed of query plan stages(50%)",
           "type": "timeseries"
         },
         {
@@ -1876,17 +2088,18 @@
                     "color": "green"
                   }
                 ]
-              }
+              },
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 12,
+            "w": 6,
             "x": 12,
-            "y": 27
+            "y": 12
           },
-          "id": 171,
+          "id": 61,
           "options": {
             "legend": {
               "calcs": [],
@@ -1895,8 +2108,8 @@
               "showLegend": true
             },
             "tooltip": {
-              "mode": "single",
-              "sort": "none"
+              "mode": "multi",
+              "sort": "desc"
             }
           },
           "targets": [
@@ -1906,42 +2119,15 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(Compacted_Point_Num_total{instance=~\"$instance\"}[1m]))*60",
+              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
-              "legendFormat": "Compacted Point Num Per Min",
+              "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "Compacted Point Num Per Minute",
+          "title": "The time consumed of query plan stages(75%)",
           "type": "timeseries"
-        }
-      ],
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "lfuOmw1Vk"
-          },
-          "refId": "A"
-        }
-      ],
-      "title": "Engine",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "lfuOmw1Vk"
-      },
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 11
-      },
-      "id": 58,
-      "panels": [
+        },
         {
           "datasource": {
             "type": "prometheus",
@@ -1998,10 +2184,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 12
           },
-          "id": 80,
+          "id": 62,
           "options": {
             "legend": {
               "calcs": [],
@@ -2021,13 +2207,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(query_plan_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(query_plan_cost_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query plan stages(avg)",
+          "title": "The time consumed of query plan stages(100%)",
           "type": "timeseries"
         },
         {
@@ -2086,10 +2272,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 12
+            "x": 0,
+            "y": 20
           },
-          "id": 60,
+          "id": 63,
           "options": {
             "legend": {
               "calcs": [],
@@ -2109,13 +2295,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "rate(dispatcher_seconds_sum{instance=~\"$instance\"}[1m]) / rate(dispatcher_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query plan stages(50%)",
+          "title": "The time consumed of plan dispatch stages(avg)",
           "type": "timeseries"
         },
         {
@@ -2174,10 +2360,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 12
+            "x": 6,
+            "y": 20
           },
-          "id": 61,
+          "id": 81,
           "options": {
             "legend": {
               "calcs": [],
@@ -2197,13 +2383,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query plan stages(75%)",
+          "title": "The time consumed of plan dispatch stages(50%)",
           "type": "timeseries"
         },
         {
@@ -2262,10 +2448,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 12
+            "x": 12,
+            "y": 20
           },
-          "id": 62,
+          "id": 64,
           "options": {
             "legend": {
               "calcs": [],
@@ -2285,13 +2471,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_plan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query plan stages(100%)",
+          "title": "The time consumed of plan dispatch stages(75%)",
           "type": "timeseries"
         },
         {
@@ -2350,10 +2536,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 20
           },
-          "id": 63,
+          "id": 65,
           "options": {
             "legend": {
               "calcs": [],
@@ -2373,13 +2559,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(dispatcher_seconds_sum{instance=~\"$instance\"}[1m]) / rate(dispatcher_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of plan dispatch stages(avg)",
+          "title": "The time consumed of plan dispatch stages(100%)",
           "type": "timeseries"
         },
         {
@@ -2438,10 +2624,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 20
+            "x": 0,
+            "y": 28
           },
-          "id": 81,
+          "id": 83,
           "options": {
             "legend": {
               "calcs": [],
@@ -2461,13 +2647,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "rate(query_execution_seconds_sum{instance=~\"$instance\"}[1m]) / rate(query_execution_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of plan dispatch stages(50%)",
+          "title": "The time consumed of query execution stages(avg)",
           "type": "timeseries"
         },
         {
@@ -2526,10 +2712,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 20
+            "x": 6,
+            "y": 28
           },
-          "id": 64,
+          "id": 66,
           "options": {
             "legend": {
               "calcs": [],
@@ -2549,13 +2735,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of plan dispatch stages(75%)",
+          "title": "The time consumed of query execution stages(50%)",
           "type": "timeseries"
         },
         {
@@ -2614,10 +2800,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 20
+            "x": 12,
+            "y": 28
           },
-          "id": 65,
+          "id": 67,
           "options": {
             "legend": {
               "calcs": [],
@@ -2627,7 +2813,7 @@
             },
             "tooltip": {
               "mode": "multi",
-              "sort": "desc"
+              "sort": "asc"
             }
           },
           "targets": [
@@ -2637,13 +2823,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "dispatcher_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of plan dispatch stages(100%)",
+          "title": "The time consumed of query execution stages(75%)",
           "type": "timeseries"
         },
         {
@@ -2702,10 +2888,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 28
           },
-          "id": 83,
+          "id": 68,
           "options": {
             "legend": {
               "calcs": [],
@@ -2715,7 +2901,7 @@
             },
             "tooltip": {
               "mode": "multi",
-              "sort": "desc"
+              "sort": "asc"
             }
           },
           "targets": [
@@ -2725,13 +2911,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(query_execution_seconds_sum{instance=~\"$instance\"}[1m]) / rate(query_execution_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query execution stages(avg)",
+          "title": "The time consumed of query execution stages(100%)",
           "type": "timeseries"
         },
         {
@@ -2790,10 +2976,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 28
+            "x": 0,
+            "y": 36
           },
-          "id": 66,
+          "id": 82,
           "options": {
             "legend": {
               "calcs": [],
@@ -2813,13 +2999,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "rate(operator_execution_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(operator_execution_cost_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query execution stages(50%)",
+          "title": "The time consumed of operator execution stages(avg)",
           "type": "timeseries"
         },
         {
@@ -2878,10 +3064,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 28
+            "x": 6,
+            "y": 36
           },
-          "id": 67,
+          "id": 69,
           "options": {
             "legend": {
               "calcs": [],
@@ -2901,13 +3087,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query execution stages(75%)",
+          "title": "The time consumed of operator execution(50%)",
           "type": "timeseries"
         },
         {
@@ -2966,10 +3152,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 28
+            "x": 12,
+            "y": 36
           },
-          "id": 68,
+          "id": 70,
           "options": {
             "legend": {
               "calcs": [],
@@ -2979,7 +3165,7 @@
             },
             "tooltip": {
               "mode": "multi",
-              "sort": "asc"
+              "sort": "desc"
             }
           },
           "targets": [
@@ -2989,13 +3175,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_execution_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query execution stages(100%)",
+          "title": "The time consumed of operator execution(75%)",
           "type": "timeseries"
         },
         {
@@ -3054,10 +3240,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 36
           },
-          "id": 82,
+          "id": 71,
           "options": {
             "legend": {
               "calcs": [],
@@ -3077,13 +3263,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(operator_execution_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(operator_execution_cost_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of operator execution stages(avg)",
+          "title": "The time consumed of operator execution(100%)",
           "type": "timeseries"
         },
         {
@@ -3142,10 +3328,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 36
+            "x": 0,
+            "y": 44
           },
-          "id": 69,
+          "id": 72,
           "options": {
             "legend": {
               "calcs": [],
@@ -3155,7 +3341,7 @@
             },
             "tooltip": {
               "mode": "multi",
-              "sort": "asc"
+              "sort": "desc"
             }
           },
           "targets": [
@@ -3165,13 +3351,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "rate(aggregation_seconds_sum{instance=~\"$instance\"}[1m]) / rate(aggregation_seconds_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of operator execution(50%)",
+          "title": "The time consumed of query aggregation(avg)",
           "type": "timeseries"
         },
         {
@@ -3230,10 +3416,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 36
+            "x": 6,
+            "y": 44
           },
-          "id": 70,
+          "id": 84,
           "options": {
             "legend": {
               "calcs": [],
@@ -3253,13 +3439,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of operator execution(75%)",
+          "title": "The time consumed of query aggregation(50%)",
           "type": "timeseries"
         },
         {
@@ -3318,10 +3504,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 36
+            "x": 12,
+            "y": 44
           },
-          "id": 71,
+          "id": 73,
           "options": {
             "legend": {
               "calcs": [],
@@ -3341,13 +3527,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "operator_execution_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of operator execution(100%)",
+          "title": "The time consumed of query aggregation(75%)",
           "type": "timeseries"
         },
         {
@@ -3406,10 +3592,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 44
           },
-          "id": 72,
+          "id": 74,
           "options": {
             "legend": {
               "calcs": [],
@@ -3429,13 +3615,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(aggregation_seconds_sum{instance=~\"$instance\"}[1m]) / rate(aggregation_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query aggregation(avg)",
+          "title": "The time consumed of query aggregation(100%)",
           "type": "timeseries"
         },
         {
@@ -3494,10 +3680,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 44
+            "x": 0,
+            "y": 52
           },
-          "id": 84,
+          "id": 131,
           "options": {
             "legend": {
               "calcs": [],
@@ -3517,13 +3703,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "sum(rate(series_scan_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\"}[1m])) by (stage)",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query aggregation(50%)",
+          "title": "The time consumed of query scan(avg)",
           "type": "timeseries"
         },
         {
@@ -3582,10 +3769,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 44
+            "x": 6,
+            "y": 52
           },
-          "id": 73,
+          "id": 132,
           "options": {
             "legend": {
               "calcs": [],
@@ -3605,13 +3792,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"0.5\"}[1m])) by (stage)",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query aggregation(75%)",
+          "title": "The time consumed of query scan(50%)",
           "type": "timeseries"
         },
         {
@@ -3670,10 +3858,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 44
+            "x": 12,
+            "y": 52
           },
-          "id": 74,
+          "id": 133,
           "options": {
             "legend": {
               "calcs": [],
@@ -3693,13 +3881,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "aggregation_seconds{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"0.75\"}[1m])) by (stage)",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query aggregation(100%)",
+          "title": "The time consumed of query scan(75%)",
           "type": "timeseries"
         },
         {
@@ -3707,6 +3896,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -3758,10 +3948,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 52
           },
-          "id": 131,
+          "id": 134,
           "options": {
             "legend": {
               "calcs": [],
@@ -3781,14 +3971,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(series_scan_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\"}[1m])) by (stage)",
+              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"1.0\"}[1m])) by (stage)",
               "format": "time_series",
               "interval": "",
               "legendFormat": "{{stage}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query scan(avg)",
+          "title": "The time consumed of query scan(100%)",
           "type": "timeseries"
         },
         {
@@ -3840,17 +4030,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 52
+            "x": 0,
+            "y": 60
           },
-          "id": 132,
+          "id": 76,
           "options": {
             "legend": {
               "calcs": [],
@@ -3870,14 +4060,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"0.5\"}[1m])) by (stage)",
-              "format": "time_series",
+              "expr": "rate(query_resource_sum{instance=~\"$instance\"}[1m]) / rate(query_resource_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query scan(50%)",
+          "title": "The usage of query resource(avg)",
           "type": "timeseries"
         },
         {
@@ -3929,17 +4118,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 52
+            "x": 6,
+            "y": 60
           },
-          "id": 133,
+          "id": 128,
           "options": {
             "legend": {
               "calcs": [],
@@ -3959,14 +4148,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"0.75\"}[1m])) by (stage)",
-              "format": "time_series",
+              "expr": "query_resource{instance=~\"${instance}\", quantile=\"0.5\"}",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query scan(75%)",
+          "title": "The usage of query resource(50%)",
           "type": "timeseries"
         },
         {
@@ -3974,7 +4162,6 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -4019,17 +4206,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 52
+            "x": 12,
+            "y": 60
           },
-          "id": 134,
+          "id": 129,
           "options": {
             "legend": {
               "calcs": [],
@@ -4049,14 +4236,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(series_scan_cost_seconds{instance=~\"$instance\", quantile=\"1.0\"}[1m])) by (stage)",
-              "format": "time_series",
+              "expr": "query_resource{instance=~\"${instance}\", quantile=\"0.75\"}",
               "interval": "",
-              "legendFormat": "{{stage}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query scan(100%)",
+          "title": "The usage of query resource(75%)",
           "type": "timeseries"
         },
         {
@@ -4115,10 +4301,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 60
           },
-          "id": 76,
+          "id": 130,
           "options": {
             "legend": {
               "calcs": [],
@@ -4138,13 +4324,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(query_resource_sum{instance=~\"$instance\"}[1m]) / rate(query_resource_count{instance=~\"$instance\"}[1m])",
+              "expr": "query_resource{instance=~\"${instance}\", quantile=\"1.0\"}",
               "interval": "",
               "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The usage of query resource(avg)",
+          "title": "The usage of query resource(100%)",
           "type": "timeseries"
         },
         {
@@ -4196,17 +4382,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 60
+            "x": 0,
+            "y": 68
           },
-          "id": 128,
+          "id": 135,
           "options": {
             "legend": {
               "calcs": [],
@@ -4226,13 +4412,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_resource{instance=~\"${instance}\", quantile=\"0.5\"}",
+              "expr": "sum(rate(data_exchange_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(data_exchange_cost_seconds_count{instance=~\"$instance\"}[1m])) by (operation)",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{operation}}",
               "refId": "A"
             }
           ],
-          "title": "The usage of query resource(50%)",
+          "title": "The time consumed  of query data exchange(avg)",
           "type": "timeseries"
         },
         {
@@ -4284,17 +4470,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 60
+            "x": 6,
+            "y": 68
           },
-          "id": 129,
+          "id": 136,
           "options": {
             "legend": {
               "calcs": [],
@@ -4314,13 +4500,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_resource{instance=~\"${instance}\", quantile=\"0.75\"}",
+              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"0.5\"}[1m])) by (operation)",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{operation}}",
               "refId": "A"
             }
           ],
-          "title": "The usage of query resource(75%)",
+          "title": "The time consumed  of query data exchange(50%)",
           "type": "timeseries"
         },
         {
@@ -4372,17 +4558,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 60
+            "x": 12,
+            "y": 68
           },
-          "id": 130,
+          "id": 137,
           "options": {
             "legend": {
               "calcs": [],
@@ -4402,13 +4588,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "query_resource{instance=~\"${instance}\", quantile=\"1.0\"}",
+              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"0.75\"}[1m])) by (operation)",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{operation}}",
               "refId": "A"
             }
           ],
-          "title": "The usage of query resource(100%)",
+          "title": "The time consumed  of query data exchange(75%)",
           "type": "timeseries"
         },
         {
@@ -4467,10 +4653,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 68
           },
-          "id": 135,
+          "id": 138,
           "options": {
             "legend": {
               "calcs": [],
@@ -4490,13 +4676,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(data_exchange_cost_seconds_sum{instance=~\"$instance\"}[1m]) / rate(data_exchange_cost_seconds_count{instance=~\"$instance\"}[1m])) by (operation)",
+              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"1.0\"}[1m])) by (operation)",
               "interval": "",
               "legendFormat": "{{operation}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed  of query data exchange(avg)",
+          "title": "The time consumed  of query data exchange(100%)",
           "type": "timeseries"
         },
         {
@@ -4548,17 +4734,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 6,
-            "x": 6,
-            "y": 68
+            "w": 8,
+            "x": 0,
+            "y": 76
           },
-          "id": 136,
+          "id": 139,
           "options": {
             "legend": {
               "calcs": [],
@@ -4578,13 +4764,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"0.5\"}[1m])) by (operation)",
+              "expr": "rate(data_exchange_count_sum{instance=~\"$instance\"}[1m]) / rate(data_exchange_count_count{instance=~\"$instance\"}[1m])",
               "interval": "",
-              "legendFormat": "{{operation}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed  of query data exchange(50%)",
+          "title": "The count of Data Exchange(avg)",
           "type": "timeseries"
         },
         {
@@ -4636,17 +4822,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 6,
-            "x": 12,
-            "y": 68
+            "w": 8,
+            "x": 8,
+            "y": 76
           },
-          "id": 137,
+          "id": 140,
           "options": {
             "legend": {
               "calcs": [],
@@ -4666,13 +4852,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"0.75\"}[1m])) by (operation)",
+              "expr": "data_exchange_count{instance=~\"$instance\"}",
               "interval": "",
-              "legendFormat": "{{operation}}",
+              "legendFormat": "{{quantile}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed  of query data exchange(75%)",
+          "title": "The count of Data Exchange",
           "type": "timeseries"
         },
         {
@@ -4724,17 +4910,17 @@
                   }
                 ]
               },
-              "unit": "s"
+              "unit": "none"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 6,
-            "x": 18,
-            "y": 68
+            "w": 8,
+            "x": 16,
+            "y": 76
           },
-          "id": 138,
+          "id": 167,
           "options": {
             "legend": {
               "calcs": [],
@@ -4754,13 +4940,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "sum(rate(data_exchange_cost_seconds{instance=~\"$instance\", quantile=\"1.0\"}[1m])) by (operation)",
+              "expr": "driver_scheduler{instance=~\"$instance\"}",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{operation}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed  of query data exchange(100%)",
+          "title": "The number of query queue",
           "type": "timeseries"
         },
         {
@@ -4812,17 +4999,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
+            "w": 6,
             "x": 0,
-            "y": 76
+            "y": 84
           },
-          "id": 139,
+          "id": 163,
           "options": {
             "legend": {
               "calcs": [],
@@ -4842,13 +5029,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(data_exchange_count_sum{instance=~\"$instance\"}[1m]) / rate(data_exchange_count_count{instance=~\"$instance\"}[1m])",
+              "expr": "rate(driver_scheduler_seconds_sum{instance=~\"$instance\"}[1m]) / rate(driver_scheduler_seconds_count{instance=~\"$instance\"}[1m])",
+              "format": "time_series",
               "interval": "",
               "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The count of Data Exchange(avg)",
+          "title": "The time consumed of query schedule time(avg)",
           "type": "timeseries"
         },
         {
@@ -4900,17 +5088,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 8,
-            "y": 76
+            "w": 6,
+            "x": 6,
+            "y": 84
           },
-          "id": 140,
+          "id": 164,
           "options": {
             "legend": {
               "calcs": [],
@@ -4930,13 +5118,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "data_exchange_count{instance=~\"$instance\"}",
+              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"0.5\"}",
+              "format": "time_series",
               "interval": "",
-              "legendFormat": "{{quantile}}",
+              "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The count of Data Exchange",
+          "title": "The time consumed of query schedule time(50%)",
           "type": "timeseries"
         },
         {
@@ -4988,17 +5177,17 @@
                   }
                 ]
               },
-              "unit": "none"
+              "unit": "s"
             },
             "overrides": []
           },
           "gridPos": {
             "h": 8,
-            "w": 8,
-            "x": 16,
-            "y": 76
+            "w": 6,
+            "x": 12,
+            "y": 84
           },
-          "id": 167,
+          "id": 165,
           "options": {
             "legend": {
               "calcs": [],
@@ -5018,14 +5207,14 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "driver_scheduler{instance=~\"$instance\"}",
+              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"0.75\"}",
               "format": "time_series",
               "interval": "",
               "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The number of query queue",
+          "title": "The time consumed of query schedule time(75%)",
           "type": "timeseries"
         },
         {
@@ -5084,10 +5273,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 84
           },
-          "id": 163,
+          "id": 166,
           "options": {
             "legend": {
               "calcs": [],
@@ -5107,16 +5296,43 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(driver_scheduler_seconds_sum{instance=~\"$instance\"}[1m]) / rate(driver_scheduler_seconds_count{instance=~\"$instance\"}[1m])",
+              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"1.0\"}",
               "format": "time_series",
               "interval": "",
               "legendFormat": "{{name}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query schedule time(avg)",
+          "title": "The time consumed of query schedule time(100%)",
           "type": "timeseries"
-        },
+        }
+      ],
+      "targets": [
+        {
+          "datasource": {
+            "type": "prometheus",
+            "uid": "${DS_PROMETHEUS}"
+          },
+          "refId": "A"
+        }
+      ],
+      "title": "Query Engine",
+      "type": "row"
+    },
+    {
+      "collapsed": true,
+      "datasource": {
+        "type": "prometheus",
+        "uid": "${DS_PROMETHEUS}"
+      },
+      "gridPos": {
+        "h": 1,
+        "w": 24,
+        "x": 0,
+        "y": 12
+      },
+      "id": 100,
+      "panels": [
         {
           "datasource": {
             "type": "prometheus",
@@ -5173,10 +5389,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 84
+            "x": 0,
+            "y": 13
           },
-          "id": 164,
+          "id": 75,
           "options": {
             "legend": {
               "calcs": [],
@@ -5196,14 +5412,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"0.5\"}",
-              "format": "time_series",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"load_timeseries_metadata\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"load_timeseries_metadata\"}[1m])",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query schedule time(50%)",
+          "title": "The time consumed of load timeseries metadata(avg)",
           "type": "timeseries"
         },
         {
@@ -5262,10 +5477,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 84
+            "x": 6,
+            "y": 13
           },
-          "id": 165,
+          "id": 85,
           "options": {
             "legend": {
               "calcs": [],
@@ -5285,14 +5500,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"0.75\"}",
-              "format": "time_series",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"load_timeseries_metadata\"}",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query schedule time(75%)",
+          "title": "The time consumed of load timeseries metadata(50%)",
           "type": "timeseries"
         },
         {
@@ -5351,10 +5565,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 84
+            "x": 12,
+            "y": 13
           },
-          "id": 166,
+          "id": 77,
           "options": {
             "legend": {
               "calcs": [],
@@ -5374,43 +5588,15 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "driver_scheduler_seconds{instance=~\"$instance\", quantile=\"1.0\"}",
-              "format": "time_series",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"load_timeseries_metadata\"}",
               "interval": "",
-              "legendFormat": "{{name}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of query schedule time(100%)",
+          "title": "The time consumed of load timeseries metadata(75%)",
           "type": "timeseries"
-        }
-      ],
-      "targets": [
-        {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "lfuOmw1Vk"
-          },
-          "refId": "A"
-        }
-      ],
-      "title": "Query Engine",
-      "type": "row"
-    },
-    {
-      "collapsed": true,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "lfuOmw1Vk"
-      },
-      "gridPos": {
-        "h": 1,
-        "w": 24,
-        "x": 0,
-        "y": 12
-      },
-      "id": 100,
-      "panels": [
+        },
         {
           "datasource": {
             "type": "prometheus",
@@ -5467,10 +5653,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 13
           },
-          "id": 75,
+          "id": 78,
           "options": {
             "legend": {
               "calcs": [],
@@ -5490,13 +5676,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"load_timeseries_metadata\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"load_timeseries_metadata\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"load_timeseries_metadata\"}",
               "interval": "",
               "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load timeseries metadata(avg)",
+          "title": "The time consumed of load timeseries metadata(100%)",
           "type": "timeseries"
         },
         {
@@ -5555,10 +5741,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 13
+            "x": 0,
+            "y": 21
           },
-          "id": 85,
+          "id": 86,
           "options": {
             "legend": {
               "calcs": [],
@@ -5578,13 +5764,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"load_timeseries_metadata\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"read_timeseries_metadata\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"read_timeseries_metadata\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load timeseries metadata(50%)",
+          "title": "The time consumed of read timeseries metadata(avg)",
           "type": "timeseries"
         },
         {
@@ -5643,10 +5829,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 13
+            "x": 6,
+            "y": 21
           },
-          "id": 77,
+          "id": 87,
           "options": {
             "legend": {
               "calcs": [],
@@ -5666,13 +5852,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"load_timeseries_metadata\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"read_timeseries_metadata\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load timeseries metadata(75%)",
+          "title": "The time consumed of read timeseries metadata(50%)",
           "type": "timeseries"
         },
         {
@@ -5731,10 +5917,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 13
+            "x": 12,
+            "y": 21
           },
-          "id": 78,
+          "id": 88,
           "options": {
             "legend": {
               "calcs": [],
@@ -5754,13 +5940,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"load_timeseries_metadata\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"read_timeseries_metadata\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load timeseries metadata(100%)",
+          "title": "The time consumed of read timeseries metadata(75%)",
           "type": "timeseries"
         },
         {
@@ -5819,10 +6005,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 21
           },
-          "id": 86,
+          "id": 89,
           "options": {
             "legend": {
               "calcs": [],
@@ -5842,13 +6028,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"read_timeseries_metadata\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"read_timeseries_metadata\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"read_timeseries_metadata\"}",
               "interval": "",
               "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read timeseries metadata(avg)",
+          "title": "The time consumed of read timeseries metadata(100%)",
           "type": "timeseries"
         },
         {
@@ -5907,10 +6093,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 21
+            "x": 0,
+            "y": 29
           },
-          "id": 87,
+          "id": 90,
           "options": {
             "legend": {
               "calcs": [],
@@ -5930,13 +6116,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"read_timeseries_metadata\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"timeseries_metadata_modification\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"timeseries_metadata_modification\"}[1m])",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read timeseries metadata(50%)",
+          "title": "The time consumed of timeseries metadata modification(avg)",
           "type": "timeseries"
         },
         {
@@ -5995,10 +6181,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 21
+            "x": 6,
+            "y": 29
           },
-          "id": 88,
+          "id": 91,
           "options": {
             "legend": {
               "calcs": [],
@@ -6018,13 +6204,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"read_timeseries_metadata\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"timeseries_metadata_modification\"}",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read timeseries metadata(75%)",
+          "title": "The time consumed of timeseries metadata modification(50%)",
           "type": "timeseries"
         },
         {
@@ -6083,10 +6269,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 21
+            "x": 12,
+            "y": 29
           },
-          "id": 89,
+          "id": 92,
           "options": {
             "legend": {
               "calcs": [],
@@ -6106,13 +6292,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"read_timeseries_metadata\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"timeseries_metadata_modification\"}",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read timeseries metadata(100%)",
+          "title": "The time consumed of timeseries metadata modification(75%)",
           "type": "timeseries"
         },
         {
@@ -6171,10 +6357,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 29
           },
-          "id": 90,
+          "id": 93,
           "options": {
             "legend": {
               "calcs": [],
@@ -6194,13 +6380,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"timeseries_metadata_modification\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"timeseries_metadata_modification\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"timeseries_metadata_modification\"}",
               "interval": "",
               "legendFormat": "{{type}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of timeseries metadata modification(avg)",
+          "title": "The time consumed of timeseries metadata modification(100%)",
           "type": "timeseries"
         },
         {
@@ -6259,10 +6445,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 29
+            "x": 0,
+            "y": 37
           },
-          "id": 91,
+          "id": 94,
           "options": {
             "legend": {
               "calcs": [],
@@ -6282,13 +6468,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"timeseries_metadata_modification\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"load_chunk_metadata_list\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"load_chunk_metadata_list\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of timeseries metadata modification(50%)",
+          "title": "The time consumed of load chunk metadata list(avg)",
           "type": "timeseries"
         },
         {
@@ -6347,10 +6533,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 29
+            "x": 6,
+            "y": 37
           },
-          "id": 92,
+          "id": 95,
           "options": {
             "legend": {
               "calcs": [],
@@ -6370,13 +6556,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"timeseries_metadata_modification\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"load_chunk_metadata_list\"}",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of timeseries metadata modification(75%)",
+          "title": "The time consumed of load chunk metadata list(50%)",
           "type": "timeseries"
         },
         {
@@ -6435,10 +6621,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 29
+            "x": 12,
+            "y": 37
           },
-          "id": 93,
+          "id": 96,
           "options": {
             "legend": {
               "calcs": [],
@@ -6458,13 +6644,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"timeseries_metadata_modification\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"load_chunk_metadata_list\"}",
               "interval": "",
-              "legendFormat": "{{type}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of timeseries metadata modification(100%)",
+          "title": "The time consumed of load chunk metadata list(75%)",
           "type": "timeseries"
         },
         {
@@ -6523,10 +6709,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 37
           },
-          "id": 94,
+          "id": 97,
           "options": {
             "legend": {
               "calcs": [],
@@ -6546,13 +6732,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"load_chunk_metadata_list\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"load_chunk_metadata_list\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"load_chunk_metadata_list\"}",
               "interval": "",
               "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load chunk metadata list(avg)",
+          "title": "The time consumed of load chunk metadata list(100%)",
           "type": "timeseries"
         },
         {
@@ -6611,10 +6797,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 37
+            "x": 0,
+            "y": 45
           },
-          "id": 95,
+          "id": 98,
           "options": {
             "legend": {
               "calcs": [],
@@ -6634,13 +6820,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"load_chunk_metadata_list\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"chunk_metadata_modification\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"chunk_metadata_modification\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load chunk metadata list(50%)",
+          "title": "The time consumed of chunk metadata modification(avg)",
           "type": "timeseries"
         },
         {
@@ -6648,6 +6834,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -6699,10 +6886,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 37
+            "x": 6,
+            "y": 45
           },
-          "id": 96,
+          "id": 101,
           "options": {
             "legend": {
               "calcs": [],
@@ -6722,13 +6909,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"load_chunk_metadata_list\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"chunk_metadata_modification\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load chunk metadata list(75%)",
+          "title": "The time consumed of chunk metadata modification(50%)",
           "type": "timeseries"
         },
         {
@@ -6736,6 +6923,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -6787,10 +6975,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 37
+            "x": 12,
+            "y": 45
           },
-          "id": 97,
+          "id": 102,
           "options": {
             "legend": {
               "calcs": [],
@@ -6810,13 +6998,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"load_chunk_metadata_list\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"chunk_metadata_modification\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of load chunk metadata list(100%)",
+          "title": "The time consumed of chunk metadata modification(75%)",
           "type": "timeseries"
         },
         {
@@ -6824,6 +7012,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -6875,10 +7064,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 45
           },
-          "id": 98,
+          "id": 103,
           "options": {
             "legend": {
               "calcs": [],
@@ -6898,13 +7087,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"chunk_metadata_modification\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"chunk_metadata_modification\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"chunk_metadata_modification\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata modification(avg)",
+          "title": "The time consumed of chunk metadata modification(100%)",
           "type": "timeseries"
         },
         {
@@ -6912,7 +7101,6 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -6964,10 +7152,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 45
+            "x": 0,
+            "y": 53
           },
-          "id": 101,
+          "id": 104,
           "options": {
             "legend": {
               "calcs": [],
@@ -6987,13 +7175,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"chunk_metadata_modification\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"chunk_metadata_filter\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"chunk_metadata_filter\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata modification(50%)",
+          "title": "The time consumed of chunk metadata filter(avg)",
           "type": "timeseries"
         },
         {
@@ -7053,10 +7241,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 45
+            "x": 6,
+            "y": 53
           },
-          "id": 102,
+          "id": 105,
           "options": {
             "legend": {
               "calcs": [],
@@ -7076,13 +7264,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"chunk_metadata_modification\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"chunk_metadata_filter\"}",
               "interval": "",
               "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata modification(75%)",
+          "title": "The time consumed of chunk metadata filter(50%)",
           "type": "timeseries"
         },
         {
@@ -7142,10 +7330,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 45
+            "x": 12,
+            "y": 53
           },
-          "id": 103,
+          "id": 106,
           "options": {
             "legend": {
               "calcs": [],
@@ -7165,13 +7353,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"chunk_metadata_modification\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"chunk_metadata_filter\"}",
               "interval": "",
               "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata modification(100%)",
+          "title": "The time consumed of chunk metadata filter(75%)",
           "type": "timeseries"
         },
         {
@@ -7179,6 +7367,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -7230,10 +7419,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 53
           },
-          "id": 104,
+          "id": 107,
           "options": {
             "legend": {
               "calcs": [],
@@ -7253,13 +7442,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"chunk_metadata_filter\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"chunk_metadata_filter\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"chunk_metadata_filter\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata filter(avg)",
+          "title": "The time consumed of chunk metadata filter(100%)",
           "type": "timeseries"
         },
         {
@@ -7267,7 +7456,6 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -7319,10 +7507,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 53
+            "x": 0,
+            "y": 61
           },
-          "id": 105,
+          "id": 108,
           "options": {
             "legend": {
               "calcs": [],
@@ -7342,13 +7530,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"chunk_metadata_filter\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"construct_chunk_reader\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"construct_chunk_reader\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata filter(50%)",
+          "title": "The time consumed of construct chunk reader(avg)",
           "type": "timeseries"
         },
         {
@@ -7408,10 +7596,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 53
+            "x": 6,
+            "y": 61
           },
-          "id": 106,
+          "id": 109,
           "options": {
             "legend": {
               "calcs": [],
@@ -7431,13 +7619,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"chunk_metadata_filter\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"construct_chunk_reader\"}",
               "interval": "",
               "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata filter(75%)",
+          "title": "The time consumed of construct chunk reader(50%)",
           "type": "timeseries"
         },
         {
@@ -7497,10 +7685,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 53
+            "x": 12,
+            "y": 61
           },
-          "id": 107,
+          "id": 110,
           "options": {
             "legend": {
               "calcs": [],
@@ -7520,13 +7708,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"chunk_metadata_filter\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"construct_chunk_reader\"}",
               "interval": "",
               "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of chunk metadata filter(100%)",
+          "title": "The time consumed of construct chunk reader(75%)",
           "type": "timeseries"
         },
         {
@@ -7534,6 +7722,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -7585,10 +7774,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 61
           },
-          "id": 108,
+          "id": 111,
           "options": {
             "legend": {
               "calcs": [],
@@ -7608,13 +7797,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"construct_chunk_reader\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"construct_chunk_reader\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"construct_chunk_reader\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of construct chunk reader(avg)",
+          "title": "The time consumed of construct chunk reader(100%)",
           "type": "timeseries"
         },
         {
@@ -7622,15 +7811,12 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -7674,10 +7860,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 61
+            "x": 0,
+            "y": 69
           },
-          "id": 109,
+          "id": 112,
           "options": {
             "legend": {
               "calcs": [],
@@ -7697,13 +7883,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"construct_chunk_reader\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"read_chunk\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"read_chunk\"}[1m])",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of construct chunk reader(50%)",
+          "title": "The time consumed of read chunk(avg)",
           "type": "timeseries"
         },
         {
@@ -7718,8 +7904,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -7763,10 +7947,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 61
+            "x": 6,
+            "y": 69
           },
-          "id": 110,
+          "id": 113,
           "options": {
             "legend": {
               "calcs": [],
@@ -7786,13 +7970,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"construct_chunk_reader\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"read_chunk\"}",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of construct chunk reader(75%)",
+          "title": "The time consumed of read chunk(50%)",
           "type": "timeseries"
         },
         {
@@ -7807,8 +7991,6 @@
                 "mode": "palette-classic"
               },
               "custom": {
-                "axisCenteredZero": false,
-                "axisColorMode": "text",
                 "axisLabel": "",
                 "axisPlacement": "auto",
                 "barAlignment": 0,
@@ -7852,10 +8034,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 61
+            "x": 12,
+            "y": 69
           },
-          "id": 111,
+          "id": 114,
           "options": {
             "legend": {
               "calcs": [],
@@ -7875,13 +8057,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"construct_chunk_reader\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"read_chunk\"}",
               "interval": "",
-              "legendFormat": "{{type}}-{{from}}",
+              "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of construct chunk reader(100%)",
+          "title": "The time consumed of read chunk(75%)",
           "type": "timeseries"
         },
         {
@@ -7889,6 +8071,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -7938,10 +8121,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 69
           },
-          "id": 112,
+          "id": 115,
           "options": {
             "legend": {
               "calcs": [],
@@ -7961,13 +8144,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"read_chunk\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"read_chunk\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"read_chunk\"}",
               "interval": "",
               "legendFormat": "{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read chunk(avg)",
+          "title": "The time consumed of read chunk(100%)",
           "type": "timeseries"
         },
         {
@@ -7975,7 +8158,6 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
-          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -8025,10 +8207,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 6,
-            "y": 69
+            "x": 0,
+            "y": 77
           },
-          "id": 113,
+          "id": 116,
           "options": {
             "legend": {
               "calcs": [],
@@ -8048,13 +8230,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"read_chunk\"}",
+              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"init_chunk_reader\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"init_chunk_reader\"}[1m])",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}_{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read chunk(50%)",
+          "title": "The time consumed of init chunk reader(avg)",
           "type": "timeseries"
         },
         {
@@ -8112,10 +8294,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 12,
-            "y": 69
+            "x": 6,
+            "y": 77
           },
-          "id": 114,
+          "id": 117,
           "options": {
             "legend": {
               "calcs": [],
@@ -8135,13 +8317,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"read_chunk\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.5\", stage=\"init_chunk_reader\"}",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read chunk(75%)",
+          "title": "The time consumed of init chunk reader(50%)",
           "type": "timeseries"
         },
         {
@@ -8199,10 +8381,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 18,
-            "y": 69
+            "x": 12,
+            "y": 77
           },
-          "id": 115,
+          "id": 118,
           "options": {
             "legend": {
               "calcs": [],
@@ -8222,13 +8404,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"read_chunk\"}",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"0.75\", stage=\"init_chunk_reader\"}",
               "interval": "",
-              "legendFormat": "{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of read chunk(100%)",
+          "title": "The time consumed of init chunk reader(75%)",
           "type": "timeseries"
         },
         {
@@ -8236,6 +8418,7 @@
             "type": "prometheus",
             "uid": "${DS_PROMETHEUS}"
           },
+          "description": "",
           "fieldConfig": {
             "defaults": {
               "color": {
@@ -8285,10 +8468,10 @@
           "gridPos": {
             "h": 8,
             "w": 6,
-            "x": 0,
+            "x": 18,
             "y": 77
           },
-          "id": 116,
+          "id": 119,
           "options": {
             "legend": {
               "calcs": [],
@@ -8308,13 +8491,13 @@
                 "uid": "${DS_PROMETHEUS}"
               },
               "exemplar": true,
-              "expr": "rate(series_scan_cost_seconds_sum{instance=~\"$instance\", stage=\"init_chunk_reader\"}[1m]) / rate(series_scan_cost_seconds_count{instance=~\"$instance\", stage=\"init_chunk_reader\"}[1m])",
+              "expr": "series_scan_cost_seconds{instance=~\"${instance}\", quantile=\"1.0\", stage=\"init_chunk_reader\"}",
               "interval": "",
-              "legendFormat": "{{type}}_{{from}}",
+              "legendFormat": "{{type}}-{{from}}",
               "refId": "A"
             }
           ],
-          "title": "The time consumed of init chunk reader(avg)",
... 10102 lines suppressed ...


[iotdb] 03/13: [IOTDB-5682] Fix the update of nodeId in Metrics (#9344) (#9346)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit aadf1073e56d05ba00eb070da4a5e8eae8073c04
Author: ZhangHongYin <46...@users.noreply.github.com>
AuthorDate: Thu Mar 16 21:06:34 2023 +0800

    [IOTDB-5682] Fix the update of nodeId in Metrics (#9344) (#9346)
    
    (cherry picked from commit d14f37af8686dd7f8cdfb8cde60d422fe524688d)
---
 .../iotdb/confignode/conf/ConfigNodeDescriptor.java    |  2 +-
 .../apache/iotdb/confignode/service/ConfigNode.java    | 18 ++++++++++++++----
 .../org/apache/iotdb/metrics/config/MetricConfig.java  |  7 +++++--
 .../java/org/apache/iotdb/db/conf/IoTDBDescriptor.java |  2 +-
 .../java/org/apache/iotdb/db/service/DataNode.java     |  7 ++++---
 5 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
index 4aa8d54522..6e508da618 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeDescriptor.java
@@ -134,7 +134,7 @@ public class ConfigNodeDescriptor {
         MetricConfigDescriptor.getInstance().loadProps(commonProperties);
         MetricConfigDescriptor.getInstance()
             .getMetricConfig()
-            .updateRpcInstance(conf.getClusterName(), conf.getConfigNodeId(), NodeType.CONFIGNODE);
+            .updateRpcInstance(conf.getClusterName(), NodeType.CONFIGNODE);
       }
     } else {
       LOGGER.warn(
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index e0d85b9b46..090d1f4bb0 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -42,6 +42,7 @@ import org.apache.iotdb.confignode.service.thrift.ConfigNodeRPCService;
 import org.apache.iotdb.confignode.service.thrift.ConfigNodeRPCServiceProcessor;
 import org.apache.iotdb.db.service.metrics.ProcessMetrics;
 import org.apache.iotdb.db.service.metrics.SystemMetrics;
+import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
 import org.apache.iotdb.metrics.metricsets.disk.DiskMetrics;
 import org.apache.iotdb.metrics.metricsets.jvm.JvmMetrics;
 import org.apache.iotdb.metrics.metricsets.logback.LogbackMetrics;
@@ -114,6 +115,9 @@ public class ConfigNode implements ConfigNodeMBean {
         }
 
         configManager.initConsensusManager();
+        setUpMetricService();
+        // Notice: We always set up Seed-ConfigNode's RPC service lastly to ensure
+        // that the external service is not provided until ConfigNode is fully available
         setUpRPCService();
         LOGGER.info(
             "{} has successfully restarted and joined the cluster: {}.",
@@ -144,8 +148,9 @@ public class ConfigNode implements ConfigNodeMBean {
                     SEED_CONFIG_NODE_ID,
                     new TEndPoint(CONF.getInternalAddress(), CONF.getInternalPort()),
                     new TEndPoint(CONF.getInternalAddress(), CONF.getConsensusPort())));
-        // We always set up Seed-ConfigNode's RPC service lastly to ensure that
-        // the external service is not provided until Seed-ConfigNode is fully initialized
+        setUpMetricService();
+        // Notice: We always set up Seed-ConfigNode's RPC service lastly to ensure
+        // that the external service is not provided until Seed-ConfigNode is fully initialized
         setUpRPCService();
         // The initial startup of Seed-ConfigNode finished
 
@@ -168,6 +173,7 @@ public class ConfigNode implements ConfigNodeMBean {
           ConfigNodeConstant.GLOBAL_NAME,
           CONF.getConfigNodeId(),
           CONF.getClusterName());
+      setUpMetricService();
 
       boolean isJoinedCluster = false;
       for (int retry = 0; retry < SCHEDULE_WAITING_RETRY_NUM; retry++) {
@@ -184,6 +190,7 @@ public class ConfigNode implements ConfigNodeMBean {
           TimeUnit.MILLISECONDS.sleep(STARTUP_RETRY_INTERVAL_IN_MS);
         } catch (InterruptedException e) {
           LOGGER.warn("Waiting leader's scheduling is interrupted.");
+          Thread.currentThread().interrupt();
         }
       }
 
@@ -210,6 +217,11 @@ public class ConfigNode implements ConfigNodeMBean {
     registerManager.register(new JMXService());
     JMXService.registerMBean(this, mbeanName);
 
+    LOGGER.info("Successfully setup internal services.");
+  }
+
+  private void setUpMetricService() throws StartupException {
+    MetricConfigDescriptor.getInstance().getMetricConfig().setNodeId(CONF.getConfigNodeId());
     registerManager.register(MetricService.getInstance());
     // bind predefined metric sets
     MetricService.getInstance().addMetricSet(new JvmMetrics());
@@ -217,8 +229,6 @@ public class ConfigNode implements ConfigNodeMBean {
     MetricService.getInstance().addMetricSet(new ProcessMetrics());
     MetricService.getInstance().addMetricSet(new SystemMetrics(false));
     MetricService.getInstance().addMetricSet(new DiskMetrics(IoTDBConstant.CN_ROLE));
-
-    LOGGER.info("Successfully setup internal services.");
   }
 
   private void initConfigManager() {
diff --git a/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfig.java b/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfig.java
index 9d9b061847..2d551495d2 100644
--- a/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfig.java
+++ b/metrics/interface/src/main/java/org/apache/iotdb/metrics/config/MetricConfig.java
@@ -156,12 +156,15 @@ public class MetricConfig {
   }
 
   /** Update rpc address and rpc port of monitored node. */
-  public void updateRpcInstance(String clusterName, int nodeId, NodeType nodeType) {
+  public void updateRpcInstance(String clusterName, NodeType nodeType) {
     this.clusterName = clusterName;
-    this.nodeId = nodeId;
     this.nodeType = nodeType;
   }
 
+  public void setNodeId(int nodeId) {
+    this.nodeId = nodeId;
+  }
+
   /** Copy properties from another metric config. */
   public void copy(MetricConfig newMetricConfig) {
     metricFrameType = newMetricConfig.getMetricFrameType();
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index c708d6e402..29a9caf080 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -189,7 +189,7 @@ public class IoTDBDescriptor {
         MetricConfigDescriptor.getInstance().loadProps(commonProperties);
         MetricConfigDescriptor.getInstance()
             .getMetricConfig()
-            .updateRpcInstance(conf.getClusterName(), conf.getDataNodeId(), NodeType.DATANODE);
+            .updateRpcInstance(conf.getClusterName(), NodeType.DATANODE);
       }
     } else {
       logger.warn(
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 31e89349fe..45959def26 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -168,12 +168,12 @@ public class DataNode implements DataNodeMBean {
       // Active DataNode
       active();
 
-      // Setup rpc service
-      setUpRPCService();
-
       // Setup metric service
       setUpMetricService();
 
+      // Setup rpc service
+      setUpRPCService();
+
       // Serialize mutable system properties
       IoTDBStartCheck.getInstance().serializeMutableSystemPropertiesIfNecessary();
 
@@ -555,6 +555,7 @@ public class DataNode implements DataNodeMBean {
   }
 
   private void setUpMetricService() throws StartupException {
+    MetricConfigDescriptor.getInstance().getMetricConfig().setNodeId(config.getDataNodeId());
     registerManager.register(MetricService.getInstance());
 
     // init metric service


[iotdb] 07/13: [To rel/1.1][IOTDB-5685] Fix error msg of failing to create a timeseries on an existing path when ReadOnly state (#9354)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 2a238150d7caca5fb312e8b1166371ab878aaa5b
Author: Marcos_Zyk <38...@users.noreply.github.com>
AuthorDate: Fri Mar 17 10:04:26 2023 +0800

    [To rel/1.1][IOTDB-5685] Fix error msg of failing to create a timeseries on an existing path when ReadOnly state (#9354)
---
 .../db/mpp/execution/executor/RegionWriteExecutor.java    | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
index 69ca7a4f3b..1d4d1a7c1c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/executor/RegionWriteExecutor.java
@@ -20,6 +20,7 @@
 package org.apache.iotdb.db.mpp.execution.executor;
 
 import org.apache.iotdb.common.rpc.thrift.TSStatus;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
 import org.apache.iotdb.commons.consensus.ConsensusGroupId;
 import org.apache.iotdb.commons.consensus.DataRegionId;
 import org.apache.iotdb.commons.consensus.SchemaRegionId;
@@ -147,6 +148,16 @@ public class RegionWriteExecutor {
     public RegionExecutionResult visitPlan(PlanNode node, WritePlanNodeExecutionContext context) {
       RegionExecutionResult response = new RegionExecutionResult();
 
+      if (CommonDescriptor.getInstance().getConfig().isReadOnly()) {
+        response.setAccepted(false);
+        response.setMessage("Fail to do non-query operations because system is read-only.");
+        response.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.SYSTEM_READ_ONLY,
+                "Fail to do non-query operations because system is read-only."));
+        return response;
+      }
+
       ConsensusWriteResponse writeResponse =
           executePlanNodeInConsensusLayer(context.getRegionId(), node);
       // TODO need consider more status
@@ -161,7 +172,9 @@ public class RegionWriteExecutor {
             writeResponse.getException());
         response.setAccepted(false);
         response.setMessage(writeResponse.getException().toString());
-        response.setStatus(RpcUtils.getStatus(TSStatusCode.EXECUTE_STATEMENT_ERROR));
+        response.setStatus(
+            RpcUtils.getStatus(
+                TSStatusCode.EXECUTE_STATEMENT_ERROR, writeResponse.getErrorMessage()));
       }
       return response;
     }


[iotdb] 05/13: [To rel/1.1][IOTDB-5688] ShcemaFile mode lost template schema after reboot in SimpleConsensus (#9351)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b82b9d9eed767ff1dc86af22cc96e7cf742ab30f
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Thu Mar 16 22:06:55 2023 +0800

    [To rel/1.1][IOTDB-5688] ShcemaFile mode lost template schema after reboot in SimpleConsensus (#9351)
---
 .../db/metadata/mtree/MTreeBelowSGCachedImpl.java  | 41 +++++++++++
 .../schemaregion/SchemaRegionSchemaFileImpl.java   | 85 ++++++++++++++++++++++
 2 files changed, 126 insertions(+)

diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
index a0644e00cb..d70d235512 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/mtree/MTreeBelowSGCachedImpl.java
@@ -69,6 +69,9 @@ import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
 import org.apache.iotdb.tsfile.utils.Pair;
 import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -103,6 +106,8 @@ import java.util.function.Function;
  */
 public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
 
+  private static final Logger logger = LoggerFactory.getLogger(MTreeBelowSGCachedImpl.class);
+
   private final CachedMTreeStore store;
   private volatile IStorageGroupMNode storageGroupMNode;
   private final IMNode rootNode;
@@ -855,6 +860,42 @@ public class MTreeBelowSGCachedImpl implements IMTreeBelowSG {
     }
   }
 
+  public void activateTemplateWithoutCheck(
+      PartialPath activatePath, int templateId, boolean isAligned) throws MetadataException {
+    String[] nodes = activatePath.getNodes();
+    IMNode cur = storageGroupMNode;
+    IMNode child;
+    IEntityMNode entityMNode;
+
+    try {
+      for (int i = levelOfSG + 1; i < nodes.length; i++) {
+        child = store.getChild(cur, nodes[i]);
+        if (child == null) {
+          throw new PathNotExistException(activatePath.getFullPath());
+        }
+        cur = child;
+      }
+      if (cur.isEntity()) {
+        entityMNode = cur.getAsEntityMNode();
+      } else {
+        entityMNode = store.setToEntity(cur);
+        if (entityMNode.isStorageGroup()) {
+          replaceStorageGroupMNode(entityMNode.getAsStorageGroupMNode());
+        }
+      }
+
+      if (!entityMNode.isAligned()) {
+        entityMNode.setAligned(isAligned);
+      }
+      entityMNode.setUseTemplate(true);
+      entityMNode.setSchemaTemplateId(templateId);
+
+      store.updateMNode(entityMNode);
+    } finally {
+      unPinPath(cur);
+    }
+  }
+
   @Override
   public Map<PartialPath, List<Integer>> constructSchemaBlackListWithTemplate(
       Map<PartialPath, List<Integer>> templateSetInfo) throws MetadataException {
diff --git a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
index 7968407c14..2c91340ad3 100644
--- a/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/metadata/schemaregion/SchemaRegionSchemaFileImpl.java
@@ -64,7 +64,9 @@ import org.apache.iotdb.db.metadata.plan.schemaregion.write.ICreateTimeSeriesPla
 import org.apache.iotdb.db.metadata.plan.schemaregion.write.IDeactivateTemplatePlan;
 import org.apache.iotdb.db.metadata.plan.schemaregion.write.IDeleteTimeSeriesPlan;
 import org.apache.iotdb.db.metadata.plan.schemaregion.write.IPreDeactivateTemplatePlan;
+import org.apache.iotdb.db.metadata.plan.schemaregion.write.IPreDeleteTimeSeriesPlan;
 import org.apache.iotdb.db.metadata.plan.schemaregion.write.IRollbackPreDeactivateTemplatePlan;
+import org.apache.iotdb.db.metadata.plan.schemaregion.write.IRollbackPreDeleteTimeSeriesPlan;
 import org.apache.iotdb.db.metadata.query.info.IDeviceSchemaInfo;
 import org.apache.iotdb.db.metadata.query.info.INodeSchemaInfo;
 import org.apache.iotdb.db.metadata.query.info.ITimeSeriesSchemaInfo;
@@ -847,6 +849,10 @@ public class SchemaRegionSchemaFileImpl implements ISchemaRegion {
     return preDeletedNum;
   }
 
+  private void recoverPreDeleteTimeseries(PartialPath path) throws MetadataException {
+    mtree.constructSchemaBlackList(path);
+  }
+
   @Override
   public void rollbackSchemaBlackList(PathPatternTree patternTree) throws MetadataException {
     for (PartialPath pathPattern : patternTree.getAllPathPatterns()) {
@@ -900,6 +906,10 @@ public class SchemaRegionSchemaFileImpl implements ISchemaRegion {
     }
   }
 
+  private void recoverRollbackPreDeleteTimeseries(PartialPath path) throws MetadataException {
+    mtree.rollbackSchemaBlackList(path);
+  }
+
   /** @param path full path from root to leaf node */
   private void deleteOneTimeseriesUpdateStatistics(PartialPath path)
       throws MetadataException, IOException {
@@ -1224,6 +1234,12 @@ public class SchemaRegionSchemaFileImpl implements ISchemaRegion {
     }
   }
 
+  private void recoverActivatingSchemaTemplate(IActivateTemplateInClusterPlan plan)
+      throws MetadataException {
+    mtree.activateTemplateWithoutCheck(
+        plan.getActivatePath(), plan.getTemplateId(), plan.isAligned());
+  }
+
   @Override
   public long constructSchemaBlackListWithTemplate(IPreDeactivateTemplatePlan plan)
       throws MetadataException {
@@ -1401,5 +1417,74 @@ public class SchemaRegionSchemaFileImpl implements ISchemaRegion {
         return new RecoverOperationResult(e);
       }
     }
+
+    @Override
+    public RecoverOperationResult visitActivateTemplateInCluster(
+        IActivateTemplateInClusterPlan activateTemplateInClusterPlan,
+        SchemaRegionSchemaFileImpl context) {
+      try {
+        recoverActivatingSchemaTemplate(activateTemplateInClusterPlan);
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
+
+    @Override
+    public RecoverOperationResult visitPreDeleteTimeSeries(
+        IPreDeleteTimeSeriesPlan preDeleteTimeSeriesPlan, SchemaRegionSchemaFileImpl context) {
+      try {
+        recoverPreDeleteTimeseries(preDeleteTimeSeriesPlan.getPath());
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
+
+    @Override
+    public RecoverOperationResult visitRollbackPreDeleteTimeSeries(
+        IRollbackPreDeleteTimeSeriesPlan rollbackPreDeleteTimeSeriesPlan,
+        SchemaRegionSchemaFileImpl context) {
+      try {
+        recoverRollbackPreDeleteTimeseries(rollbackPreDeleteTimeSeriesPlan.getPath());
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
+
+    @Override
+    public RecoverOperationResult visitPreDeactivateTemplate(
+        IPreDeactivateTemplatePlan preDeactivateTemplatePlan, SchemaRegionSchemaFileImpl context) {
+      try {
+        constructSchemaBlackListWithTemplate(preDeactivateTemplatePlan);
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
+
+    @Override
+    public RecoverOperationResult visitRollbackPreDeactivateTemplate(
+        IRollbackPreDeactivateTemplatePlan rollbackPreDeactivateTemplatePlan,
+        SchemaRegionSchemaFileImpl context) {
+      try {
+        rollbackSchemaBlackListWithTemplate(rollbackPreDeactivateTemplatePlan);
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
+
+    @Override
+    public RecoverOperationResult visitDeactivateTemplate(
+        IDeactivateTemplatePlan deactivateTemplatePlan, SchemaRegionSchemaFileImpl context) {
+      try {
+        deactivateTemplateInBlackList(deactivateTemplatePlan);
+        return RecoverOperationResult.SUCCESS;
+      } catch (MetadataException e) {
+        return new RecoverOperationResult(e);
+      }
+    }
   }
 }


[iotdb] 01/13: [IOTDB-5676] Improve ConfigurationException description and analyzing of cluster parameters (#9334) (#9340)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 7b77a4a797f58311a6a98fd70085b31e172959fd
Author: YongzaoDan <33...@users.noreply.github.com>
AuthorDate: Thu Mar 16 16:09:03 2023 +0800

    [IOTDB-5676] Improve ConfigurationException description and analyzing of cluster parameters (#9334) (#9340)
---
 .../confignode/conf/ConfigNodeStartupCheck.java    | 58 +++++++++++++++-------
 .../confignode/conf/SystemPropertiesUtils.java     | 32 ++++++++----
 .../resources/conf/iotdb-common.properties         |  6 +--
 .../commons/exception/ConfigurationException.java  | 27 +++++-----
 .../org/apache/iotdb/db/conf/IoTDBDescriptor.java  | 35 ++++++++-----
 .../org/apache/iotdb/db/conf/IoTDBStartCheck.java  |  5 +-
 6 files changed, 105 insertions(+), 58 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index 27efcc534a..f889c131e1 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -60,27 +60,40 @@ public class ConfigNodeStartupCheck {
       throw new ConfigurationException(
           IoTDBConstant.CN_TARGET_CONFIG_NODE_LIST,
           CONF.getTargetConfigNode().getIp() + ":" + CONF.getTargetConfigNode().getPort(),
-          CONF.getInternalAddress() + ":" + CONF.getInternalPort());
+          CONF.getInternalAddress() + ":" + CONF.getInternalPort(),
+          "the config_node_consensus_protocol_class is set to" + ConsensusFactory.SIMPLE_CONSENSUS);
     }
 
-    // When the data region consensus protocol is set to SIMPLE_CONSENSUS,
-    // the data replication factor must be 1
-    if (CONF.getDataRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
-        && CONF.getDataReplicationFactor() != 1) {
+    // The replication factor should be positive
+    if (CONF.getSchemaReplicationFactor() <= 0) {
+      throw new ConfigurationException("The schema_replication_factor should be positive");
+    }
+    if (CONF.getDataReplicationFactor() <= 0) {
+      throw new ConfigurationException("The data_replication_factor should be positive");
+    }
+
+    // When the schema_replication_factor is greater than 1
+    // the schema_region_consensus_protocol can't be set to SIMPLE_CONSENSUS
+    if (CONF.getSchemaReplicationFactor() > 1
+        && ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getSchemaRegionConsensusProtocolClass())) {
       throw new ConfigurationException(
-          "data_replication_factor",
-          String.valueOf(CONF.getDataReplicationFactor()),
-          String.valueOf(1));
+          "schema_region_consensus_protocol_class",
+          CONF.getSchemaRegionConsensusProtocolClass(),
+          ConsensusFactory.RATIS_CONSENSUS,
+          ConsensusFactory.SIMPLE_CONSENSUS
+              + "available only when schema_replication_factor is set to 1");
     }
 
-    // When the schema region consensus protocol is set to SIMPLE_CONSENSUS,
-    // the schema replication factor must be 1
-    if (CONF.getSchemaRegionConsensusProtocolClass().equals(ConsensusFactory.SIMPLE_CONSENSUS)
-        && CONF.getSchemaReplicationFactor() != 1) {
+    // When the data_replication_factor is greater than 1
+    // the data_region_consensus_protocol can't be set to SIMPLE_CONSENSUS
+    if (CONF.getDataReplicationFactor() > 1
+        && ConsensusFactory.SIMPLE_CONSENSUS.equals(CONF.getDataRegionConsensusProtocolClass())) {
       throw new ConfigurationException(
-          "schema_replication_factor",
-          String.valueOf(CONF.getSchemaReplicationFactor()),
-          String.valueOf(1));
+          "data_region_consensus_protocol_class",
+          CONF.getDataRegionConsensusProtocolClass(),
+          ConsensusFactory.IOT_CONSENSUS + "or" + ConsensusFactory.RATIS_CONSENSUS,
+          ConsensusFactory.SIMPLE_CONSENSUS
+              + "available only when data_replication_factor is set to 1");
     }
 
     // When the schema region consensus protocol is set to IoTConsensus,
@@ -90,21 +103,28 @@ public class ConfigNodeStartupCheck {
           "schema_region_consensus_protocol_class",
           String.valueOf(CONF.getSchemaRegionConsensusProtocolClass()),
           String.format(
-              "%s or %s", ConsensusFactory.SIMPLE_CONSENSUS, ConsensusFactory.RATIS_CONSENSUS));
+              "%s or %s", ConsensusFactory.SIMPLE_CONSENSUS, ConsensusFactory.RATIS_CONSENSUS),
+          "the SchemaRegion doesn't support org.apache.iotdb.consensus.iot.IoTConsensus");
     }
 
     // The leader distribution policy is limited
     if (!ILeaderBalancer.GREEDY_POLICY.equals(CONF.getLeaderDistributionPolicy())
         && !ILeaderBalancer.MIN_COST_FLOW_POLICY.equals(CONF.getLeaderDistributionPolicy())) {
       throw new ConfigurationException(
-          "leader_distribution_policy", CONF.getRoutePriorityPolicy(), "GREEDY or MIN_COST_FLOW");
+          "leader_distribution_policy",
+          CONF.getRoutePriorityPolicy(),
+          "GREEDY or MIN_COST_FLOW",
+          "an unrecognized leader_distribution_policy is set");
     }
 
     // The route priority policy is limited
     if (!CONF.getRoutePriorityPolicy().equals(IPriorityBalancer.LEADER_POLICY)
         && !CONF.getRoutePriorityPolicy().equals(IPriorityBalancer.GREEDY_POLICY)) {
       throw new ConfigurationException(
-          "route_priority_policy", CONF.getRoutePriorityPolicy(), "LEADER or GREEDY");
+          "route_priority_policy",
+          CONF.getRoutePriorityPolicy(),
+          "LEADER or GREEDY",
+          "an unrecognized route_priority_policy is set");
     }
 
     // The ip of target ConfigNode couldn't be 0.0.0.0
@@ -113,7 +133,7 @@ public class ConfigNodeStartupCheck {
           "The ip address of any target_config_node_list couldn't be 0.0.0.0");
     }
 
-    // The least RegionGroupNum should be positive
+    // The default RegionGroupNum should be positive
     if (CONF.getDefaultSchemaRegionGroupNumPerDatabase() <= 0) {
       throw new ConfigurationException("The default_schema_region_group_num should be positive");
     }
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
index a5aa7e7dfc..7d4a7c45d1 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/conf/SystemPropertiesUtils.java
@@ -73,7 +73,11 @@ public class SystemPropertiesUtils {
     // Startup configuration
     String clusterName = systemProperties.getProperty(CLUSTER_NAME, null);
     if (clusterName != null && !clusterName.equals(conf.getClusterName())) {
-      throw new ConfigurationException(CLUSTER_NAME, conf.getClusterName(), clusterName);
+      throw new ConfigurationException(
+          CLUSTER_NAME,
+          conf.getClusterName(),
+          clusterName,
+          "cluster_name can't be modified after first startup");
     }
 
     String internalAddress = systemProperties.getProperty("cn_internal_address", null);
@@ -81,7 +85,10 @@ public class SystemPropertiesUtils {
       needReWrite = true;
     } else if (!internalAddress.equals(conf.getInternalAddress())) {
       throw new ConfigurationException(
-          "cn_internal_address", conf.getInternalAddress(), internalAddress);
+          "cn_internal_address",
+          conf.getInternalAddress(),
+          internalAddress,
+          "cn_internal_address can't be modified after first startup");
     }
 
     if (systemProperties.getProperty("cn_internal_port", null) == null) {
@@ -92,7 +99,8 @@ public class SystemPropertiesUtils {
         throw new ConfigurationException(
             "cn_internal_port",
             String.valueOf(conf.getInternalPort()),
-            String.valueOf(internalPort));
+            String.valueOf(internalPort),
+            "cn_internal_port can't be modified after first startup");
       }
     }
 
@@ -104,7 +112,8 @@ public class SystemPropertiesUtils {
         throw new ConfigurationException(
             "cn_consensus_port",
             String.valueOf(conf.getConsensusPort()),
-            String.valueOf(consensusPort));
+            String.valueOf(consensusPort),
+            "cn_consensus_port can't be modified after first startup");
       }
     }
 
@@ -118,7 +127,8 @@ public class SystemPropertiesUtils {
       throw new ConfigurationException(
           "config_node_consensus_protocol_class",
           conf.getConfigNodeConsensusProtocolClass(),
-          configNodeConsensusProtocolClass);
+          configNodeConsensusProtocolClass,
+          "config_node_consensus_protocol_class can't be modified after first startup");
     }
 
     String dataRegionConsensusProtocolClass =
@@ -130,7 +140,8 @@ public class SystemPropertiesUtils {
       throw new ConfigurationException(
           "data_region_consensus_protocol_class",
           conf.getDataRegionConsensusProtocolClass(),
-          dataRegionConsensusProtocolClass);
+          dataRegionConsensusProtocolClass,
+          "data_region_consensus_protocol_class can't be modified after first startup");
     }
 
     String schemaRegionConsensusProtocolClass =
@@ -142,7 +153,8 @@ public class SystemPropertiesUtils {
       throw new ConfigurationException(
           "schema_region_consensus_protocol_class",
           conf.getSchemaRegionConsensusProtocolClass(),
-          schemaRegionConsensusProtocolClass);
+          schemaRegionConsensusProtocolClass,
+          "schema_region_consensus_protocol_class can't be modified after first startup");
     }
 
     // PartitionSlot configuration
@@ -155,7 +167,8 @@ public class SystemPropertiesUtils {
         throw new ConfigurationException(
             "series_partition_slot_num",
             String.valueOf(conf.getSeriesSlotNum()),
-            String.valueOf(seriesPartitionSlotNum));
+            String.valueOf(seriesPartitionSlotNum),
+            "series_partition_slot_num can't be modified after first startup");
       }
     }
 
@@ -168,7 +181,8 @@ public class SystemPropertiesUtils {
       throw new ConfigurationException(
           "series_partition_executor_class",
           conf.getSeriesPartitionExecutorClass(),
-          seriesPartitionSlotExecutorClass);
+          seriesPartitionSlotExecutorClass,
+          "series_partition_executor_class can't be modified after first startup");
     }
 
     if (needReWrite) {
diff --git a/node-commons/src/assembly/resources/conf/iotdb-common.properties b/node-commons/src/assembly/resources/conf/iotdb-common.properties
index 05a496dc89..3f42740fa1 100644
--- a/node-commons/src/assembly/resources/conf/iotdb-common.properties
+++ b/node-commons/src/assembly/resources/conf/iotdb-common.properties
@@ -32,7 +32,7 @@ cluster_name=defaultCluster
 # This parameter is unmodifiable after ConfigNode starts for the first time.
 # These consensus protocols are currently supported:
 # 1. org.apache.iotdb.consensus.ratis.RatisConsensus
-# 2. org.apache.iotdb.consensus.simple.SimpleConsensus
+# 2. org.apache.iotdb.consensus.simple.SimpleConsensus   (Only 1 ConfigNode can be deployed)
 # Datatype: string
 # config_node_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
 
@@ -45,7 +45,7 @@ cluster_name=defaultCluster
 # This parameter is unmodifiable after ConfigNode starts for the first time.
 # These consensus protocols are currently supported:
 # 1. org.apache.iotdb.consensus.ratis.RatisConsensus
-# 2. org.apache.iotdb.consensus.simple.SimpleConsensus
+# 2. org.apache.iotdb.consensus.simple.SimpleConsensus   (The schema_replication_factor can only be set to 1)
 # Datatype: string
 # schema_region_consensus_protocol_class=org.apache.iotdb.consensus.ratis.RatisConsensus
 
@@ -57,7 +57,7 @@ cluster_name=defaultCluster
 # DataRegion 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
+# 1. org.apache.iotdb.consensus.simple.SimpleConsensus   (The data_replication_factor can only be set to 1)
 # 2. org.apache.iotdb.consensus.iot.IoTConsensus
 # 3. org.apache.iotdb.consensus.ratis.RatisConsensus
 # Datatype: string
diff --git a/node-commons/src/main/java/org/apache/iotdb/commons/exception/ConfigurationException.java b/node-commons/src/main/java/org/apache/iotdb/commons/exception/ConfigurationException.java
index a71e42cd86..b6cde39eb7 100644
--- a/node-commons/src/main/java/org/apache/iotdb/commons/exception/ConfigurationException.java
+++ b/node-commons/src/main/java/org/apache/iotdb/commons/exception/ConfigurationException.java
@@ -19,6 +19,7 @@
 
 package org.apache.iotdb.commons.exception;
 
+import org.apache.iotdb.commons.utils.TestOnly;
 import org.apache.iotdb.rpc.TSStatusCode;
 
 public class ConfigurationException extends IoTDBException {
@@ -26,37 +27,35 @@ public class ConfigurationException extends IoTDBException {
   private String correctValue;
 
   /**
+   * Notice: The error reason should always be set for ease of use.
+   *
    * @param parameter The error parameter
    * @param badValue The bad value
    * @param correctValue The correct value (if it could be listed)
+   * @param reason The reason why lead to the exception
    */
-  public ConfigurationException(String parameter, String badValue, String correctValue) {
+  public ConfigurationException(
+      String parameter, String badValue, String correctValue, String reason) {
     super(
         String.format(
-            "Parameter %s can not be %s, please set to: %s", parameter, badValue, correctValue),
+            "Parameter %s can not be %s, please set to: %s. Because %s",
+            parameter, badValue, correctValue, reason),
         TSStatusCode.CONFIGURATION_ERROR.getStatusCode());
     this.parameter = parameter;
     this.correctValue = correctValue;
   }
 
-  /**
-   * @param parameter The error parameter
-   * @param badValue The bad value
-   */
-  public ConfigurationException(String parameter, String badValue) {
-    super(
-        String.format("Parameter %s can not be %s", parameter, badValue),
-        TSStatusCode.CONFIGURATION_ERROR.getStatusCode());
-  }
-
-  public ConfigurationException(String errorStr) {
-    super(errorStr, TSStatusCode.CONFIGURATION_ERROR.getStatusCode());
+  /** Notice: The error reason should always be set for ease of use. */
+  public ConfigurationException(String reason) {
+    super(reason, TSStatusCode.CONFIGURATION_ERROR.getStatusCode());
   }
 
+  @TestOnly
   public String getParameter() {
     return parameter;
   }
 
+  @TestOnly
   public String getCorrectValue() {
     return correctValue;
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
index 5efca9f11d..c708d6e402 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBDescriptor.java
@@ -1798,6 +1798,7 @@ public class IoTDBDescriptor {
     String configNodeUrls = properties.getProperty(IoTDBConstant.DN_TARGET_CONFIG_NODE_LIST);
     if (configNodeUrls != null) {
       try {
+        configNodeUrls = configNodeUrls.trim();
         conf.setTargetConfigNodeList(NodeUrlUtils.parseTEndPointUrls(configNodeUrls));
       } catch (BadNodeUrlException e) {
         logger.error(
@@ -1806,29 +1807,39 @@ public class IoTDBDescriptor {
     }
 
     conf.setInternalAddress(
-        properties.getProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, conf.getInternalAddress()));
+        properties
+            .getProperty(IoTDBConstant.DN_INTERNAL_ADDRESS, conf.getInternalAddress())
+            .trim());
 
     conf.setInternalPort(
         Integer.parseInt(
-            properties.getProperty(
-                IoTDBConstant.DN_INTERNAL_PORT, Integer.toString(conf.getInternalPort()))));
+            properties
+                .getProperty(
+                    IoTDBConstant.DN_INTERNAL_PORT, Integer.toString(conf.getInternalPort()))
+                .trim()));
 
     conf.setDataRegionConsensusPort(
         Integer.parseInt(
-            properties.getProperty(
-                "dn_data_region_consensus_port",
-                Integer.toString(conf.getDataRegionConsensusPort()))));
+            properties
+                .getProperty(
+                    "dn_data_region_consensus_port",
+                    Integer.toString(conf.getDataRegionConsensusPort()))
+                .trim()));
 
     conf.setSchemaRegionConsensusPort(
         Integer.parseInt(
-            properties.getProperty(
-                "dn_schema_region_consensus_port",
-                Integer.toString(conf.getSchemaRegionConsensusPort()))));
+            properties
+                .getProperty(
+                    "dn_schema_region_consensus_port",
+                    Integer.toString(conf.getSchemaRegionConsensusPort()))
+                .trim()));
     conf.setJoinClusterRetryIntervalMs(
         Long.parseLong(
-            properties.getProperty(
-                "dn_join_cluster_retry_interval_ms",
-                Long.toString(conf.getJoinClusterRetryIntervalMs()))));
+            properties
+                .getProperty(
+                    "dn_join_cluster_retry_interval_ms",
+                    Long.toString(conf.getJoinClusterRetryIntervalMs()))
+                .trim()));
   }
 
   public void loadShuffleProps(Properties properties) {
diff --git a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
index 27b04be1bd..88f27c912d 100644
--- a/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
+++ b/server/src/main/java/org/apache/iotdb/db/conf/IoTDBStartCheck.java
@@ -449,7 +449,10 @@ public class IoTDBStartCheck {
 
   private void throwException(String parameter, Object badValue) throws ConfigurationException {
     throw new ConfigurationException(
-        parameter, String.valueOf(badValue), properties.getProperty(parameter));
+        parameter,
+        String.valueOf(badValue),
+        properties.getProperty(parameter),
+        parameter + "can't be modified after first startup");
   }
 
   // reload properties from system.properties


[iotdb] 08/13: [To rel/1.1][IOTDB-5651] Fix compaction UT

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 63796d5fafc2ebb718c0fa30f3dc43ab559e0b93
Author: 周沛辰 <45...@users.noreply.github.com>
AuthorDate: Fri Mar 17 16:15:24 2023 +0800

    [To rel/1.1][IOTDB-5651] Fix compaction UT
---
 .../execute/task/CrossSpaceCompactionTask.java     |   7 +-
 .../execute/task/InnerSpaceCompactionTask.java     | 264 ++++++++++-----------
 2 files changed, 135 insertions(+), 136 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/CrossSpaceCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/CrossSpaceCompactionTask.java
index 887b930406..e29c083c70 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/CrossSpaceCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/CrossSpaceCompactionTask.java
@@ -213,10 +213,6 @@ public class CrossSpaceCompactionTask extends AbstractCompactionTask {
         long unsequenceFileSize = deleteOldFiles(selectedUnsequenceFiles);
         CompactionUtils.deleteCompactionModsFile(selectedSequenceFiles, selectedUnsequenceFiles);
 
-        if (logFile.exists()) {
-          FileUtils.delete(logFile);
-        }
-
         // update the metrics finally in case of any exception occurs
         for (TsFileResource targetResource : targetTsfileResourceList) {
           if (!targetResource.isDeleted()) {
@@ -246,6 +242,9 @@ public class CrossSpaceCompactionTask extends AbstractCompactionTask {
             (selectedSeqFileSize + selectedUnseqFileSize) / 1024 / 1024 / costTime,
             summary);
       }
+      if (logFile.exists()) {
+        FileUtils.delete(logFile);
+      }
     } catch (Throwable throwable) {
       // catch throwable to handle OOM errors
       if (!(throwable instanceof InterruptedException)) {
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/InnerSpaceCompactionTask.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/InnerSpaceCompactionTask.java
index a9f7aca321..4c871843fa 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/InnerSpaceCompactionTask.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/execute/task/InnerSpaceCompactionTask.java
@@ -59,6 +59,7 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
   protected int sumOfCompactionCount;
   protected long maxFileVersion;
   protected int maxCompactionCount;
+  private File logFile;
 
   protected TsFileResourceList tsFileResourceList;
   protected List<TsFileResource> targetTsFileList;
@@ -116,153 +117,152 @@ public class InnerSpaceCompactionTask extends AbstractCompactionTask {
         sequence ? "Sequence" : "Unsequence",
         selectedTsFileResourceList.size(),
         selectedFileSize / 1024 / 1024);
+
     try {
       targetTsFileResource =
           TsFileNameGenerator.getInnerCompactionTargetFileResource(
               selectedTsFileResourceList, sequence);
-    } catch (IOException e) {
-      LOGGER.error("Failed to get target file for {}", selectedTsFileResourceList, e);
-      return;
-    }
-    File logFile =
-        new File(
-            dataDirectory
-                + File.separator
-                + targetTsFileResource.getTsFile().getName()
-                + CompactionLogger.INNER_COMPACTION_LOG_NAME_SUFFIX);
-    try (CompactionLogger compactionLogger = new CompactionLogger(logFile)) {
-      // Here is tmpTargetFile, which is xxx.target
-      targetTsFileList = new ArrayList<>(Collections.singletonList(targetTsFileResource));
-      compactionLogger.logFiles(selectedTsFileResourceList, CompactionLogger.STR_SOURCE_FILES);
-      compactionLogger.logFiles(targetTsFileList, CompactionLogger.STR_TARGET_FILES);
-
-      LOGGER.info(
-          "{}-{} [Compaction] compaction with {}",
-          storageGroupName,
-          dataRegionId,
-          selectedTsFileResourceList);
-
-      // carry out the compaction
-      performer.setSourceFiles(selectedTsFileResourceList);
-      // As elements in targetFiles may be removed in ReadPointCompactionPerformer, we should use a
-      // mutable list instead of Collections.singletonList()
-      performer.setTargetFiles(targetTsFileList);
-      performer.setSummary(summary);
-      performer.perform();
-
-      CompactionUtils.moveTargetFile(targetTsFileList, true, storageGroupName + "-" + dataRegionId);
-
-      LOGGER.info(
-          "{}-{} [InnerSpaceCompactionTask] start to rename mods file",
-          storageGroupName,
-          dataRegionId);
-      CompactionUtils.combineModsInInnerCompaction(
-          selectedTsFileResourceList, targetTsFileResource);
-
-      if (Thread.currentThread().isInterrupted() || summary.isCancel()) {
-        throw new InterruptedException(
-            String.format("%s-%s [Compaction] abort", storageGroupName, dataRegionId));
-      }
+      logFile =
+          new File(
+              dataDirectory
+                  + File.separator
+                  + targetTsFileResource.getTsFile().getName()
+                  + CompactionLogger.INNER_COMPACTION_LOG_NAME_SUFFIX);
+      try (CompactionLogger compactionLogger = new CompactionLogger(logFile)) {
+        // Here is tmpTargetFile, which is xxx.target
+        targetTsFileList = new ArrayList<>(Collections.singletonList(targetTsFileResource));
+        compactionLogger.logFiles(selectedTsFileResourceList, CompactionLogger.STR_SOURCE_FILES);
+        compactionLogger.logFiles(targetTsFileList, CompactionLogger.STR_TARGET_FILES);
+
+        LOGGER.info(
+            "{}-{} [Compaction] compaction with {}",
+            storageGroupName,
+            dataRegionId,
+            selectedTsFileResourceList);
+
+        // carry out the compaction
+        performer.setSourceFiles(selectedTsFileResourceList);
+        // As elements in targetFiles may be removed in ReadPointCompactionPerformer, we should use
+        // a
+        // mutable list instead of Collections.singletonList()
+        performer.setTargetFiles(targetTsFileList);
+        performer.setSummary(summary);
+        performer.perform();
+
+        CompactionUtils.moveTargetFile(
+            targetTsFileList, true, storageGroupName + "-" + dataRegionId);
+
+        LOGGER.info(
+            "{}-{} [InnerSpaceCompactionTask] start to rename mods file",
+            storageGroupName,
+            dataRegionId);
+        CompactionUtils.combineModsInInnerCompaction(
+            selectedTsFileResourceList, targetTsFileResource);
 
-      // replace the old files with new file, the new is in same position as the old
-      if (sequence) {
-        tsFileManager.replace(
-            selectedTsFileResourceList,
-            Collections.emptyList(),
-            targetTsFileList,
-            timePartition,
-            true);
-      } else {
-        tsFileManager.replace(
-            Collections.emptyList(),
-            selectedTsFileResourceList,
-            targetTsFileList,
-            timePartition,
-            false);
-      }
+        if (Thread.currentThread().isInterrupted() || summary.isCancel()) {
+          throw new InterruptedException(
+              String.format("%s-%s [Compaction] abort", storageGroupName, dataRegionId));
+        }
 
-      if (targetTsFileResource.isDeleted()) {
-        compactionLogger.logFile(targetTsFileResource, CompactionLogger.STR_DELETED_TARGET_FILES);
-      }
+        // replace the old files with new file, the new is in same position as the old
+        if (sequence) {
+          tsFileManager.replace(
+              selectedTsFileResourceList,
+              Collections.emptyList(),
+              targetTsFileList,
+              timePartition,
+              true);
+        } else {
+          tsFileManager.replace(
+              Collections.emptyList(),
+              selectedTsFileResourceList,
+              targetTsFileList,
+              timePartition,
+              false);
+        }
 
-      if (IoTDBDescriptor.getInstance().getConfig().isEnableCompactionValidation()
-          && !CompactionUtils.validateTsFileResources(
-              tsFileManager, storageGroupName, timePartition)) {
-        LOGGER.error(
-            "Failed to pass compaction validation, source files is: {}, target files is {}",
-            selectedTsFileResourceList,
-            targetTsFileList);
-        throw new RuntimeException("Failed to pass compaction validation");
-      }
+        if (targetTsFileResource.isDeleted()) {
+          compactionLogger.logFile(targetTsFileResource, CompactionLogger.STR_DELETED_TARGET_FILES);
+        }
 
-      LOGGER.info(
-          "{}-{} [Compaction] Compacted target files, try to get the write lock of source files",
-          storageGroupName,
-          dataRegionId);
+        if (IoTDBDescriptor.getInstance().getConfig().isEnableCompactionValidation()
+            && !CompactionUtils.validateTsFileResources(
+                tsFileManager, storageGroupName, timePartition)) {
+          LOGGER.error(
+              "Failed to pass compaction validation, source files is: {}, target files is {}",
+              selectedTsFileResourceList,
+              targetTsFileList);
+          throw new RuntimeException("Failed to pass compaction validation");
+        }
 
-      // release the read lock of all source files, and get the write lock of them to delete them
-      for (int i = 0; i < selectedTsFileResourceList.size(); ++i) {
-        selectedTsFileResourceList.get(i).readUnlock();
-        isHoldingReadLock[i] = false;
-        selectedTsFileResourceList.get(i).writeLock();
-        isHoldingWriteLock[i] = true;
-      }
+        LOGGER.info(
+            "{}-{} [Compaction] Compacted target files, try to get the write lock of source files",
+            storageGroupName,
+            dataRegionId);
+
+        // release the read lock of all source files, and get the write lock of them to delete them
+        for (int i = 0; i < selectedTsFileResourceList.size(); ++i) {
+          selectedTsFileResourceList.get(i).readUnlock();
+          isHoldingReadLock[i] = false;
+          selectedTsFileResourceList.get(i).writeLock();
+          isHoldingWriteLock[i] = true;
+        }
 
-      if (targetTsFileResource.getTsFile().exists()
-          && targetTsFileResource.getTsFile().length()
-              < TSFileConfig.MAGIC_STRING.getBytes().length * 2L + Byte.BYTES) {
-        // the file size is smaller than magic string and version number
-        throw new TsFileNotCompleteException(
-            String.format(
-                "target file %s is smaller than magic string and version number size",
-                targetTsFileResource));
-      }
+        if (targetTsFileResource.getTsFile().exists()
+            && targetTsFileResource.getTsFile().length()
+                < TSFileConfig.MAGIC_STRING.getBytes().length * 2L + Byte.BYTES) {
+          // the file size is smaller than magic string and version number
+          throw new TsFileNotCompleteException(
+              String.format(
+                  "target file %s is smaller than magic string and version number size",
+                  targetTsFileResource));
+        }
 
-      LOGGER.info(
-          "{}-{} [Compaction] compaction finish, start to delete old files",
-          storageGroupName,
-          dataRegionId);
-      // delete the old files
-      long totalSizeOfDeletedFile = 0L;
-      for (TsFileResource resource : selectedTsFileResourceList) {
-        totalSizeOfDeletedFile += resource.getTsFileSize();
-      }
-      CompactionUtils.deleteTsFilesInDisk(
-          selectedTsFileResourceList, storageGroupName + "-" + dataRegionId);
-      CompactionUtils.deleteModificationForSourceFile(
-          selectedTsFileResourceList, storageGroupName + "-" + dataRegionId);
+        LOGGER.info(
+            "{}-{} [Compaction] compaction finish, start to delete old files",
+            storageGroupName,
+            dataRegionId);
+        // delete the old files
+        long totalSizeOfDeletedFile = 0L;
+        for (TsFileResource resource : selectedTsFileResourceList) {
+          totalSizeOfDeletedFile += resource.getTsFileSize();
+        }
+        CompactionUtils.deleteTsFilesInDisk(
+            selectedTsFileResourceList, storageGroupName + "-" + dataRegionId);
+        CompactionUtils.deleteModificationForSourceFile(
+            selectedTsFileResourceList, storageGroupName + "-" + dataRegionId);
+
+        // inner space compaction task has only one target file
+        if (!targetTsFileResource.isDeleted()) {
+          TsFileMetricManager.getInstance()
+              .addFile(targetTsFileResource.getTsFile().length(), sequence);
+
+          // set target resource to CLOSED, so that it can be selected to compact
+          targetTsFileResource.setStatus(TsFileResourceStatus.CLOSED);
+        } else {
+          // target resource is empty after compaction, then delete it
+          targetTsFileResource.remove();
+        }
+        TsFileMetricManager.getInstance()
+            .deleteFile(totalSizeOfDeletedFile, sequence, selectedTsFileResourceList.size());
+
+        CompactionMetricsManager.getInstance().updateSummary(summary);
 
+        double costTime = (System.currentTimeMillis() - startTime) / 1000.0d;
+        LOGGER.info(
+            "{}-{} [Compaction] {} InnerSpaceCompaction task finishes successfully, target file is {},"
+                + "time cost is {} s, compaction speed is {} MB/s, {}",
+            storageGroupName,
+            dataRegionId,
+            sequence ? "Sequence" : "Unsequence",
+            targetTsFileResource.getTsFile().getName(),
+            costTime,
+            selectedFileSize / 1024.0d / 1024.0d / costTime,
+            summary);
+      }
       if (logFile.exists()) {
         FileUtils.delete(logFile);
       }
-
-      // inner space compaction task has only one target file
-      if (!targetTsFileResource.isDeleted()) {
-        TsFileMetricManager.getInstance()
-            .addFile(targetTsFileResource.getTsFile().length(), sequence);
-
-        // set target resource to CLOSED, so that it can be selected to compact
-        targetTsFileResource.setStatus(TsFileResourceStatus.CLOSED);
-      } else {
-        // target resource is empty after compaction, then delete it
-        targetTsFileResource.remove();
-      }
-      TsFileMetricManager.getInstance()
-          .deleteFile(totalSizeOfDeletedFile, sequence, selectedTsFileResourceList.size());
-
-      CompactionMetricsManager.getInstance().updateSummary(summary);
-
-      double costTime = (System.currentTimeMillis() - startTime) / 1000.0d;
-      LOGGER.info(
-          "{}-{} [Compaction] {} InnerSpaceCompaction task finishes successfully, target file is {},"
-              + "time cost is {} s, compaction speed is {} MB/s, {}",
-          storageGroupName,
-          dataRegionId,
-          sequence ? "Sequence" : "Unsequence",
-          targetTsFileResource.getTsFile().getName(),
-          costTime,
-          selectedFileSize / 1024.0d / 1024.0d / costTime,
-          summary);
     } catch (Throwable throwable) {
       // catch throwable to handle OOM errors
       if (!(throwable instanceof InterruptedException)) {


[iotdb] 10/13: [To rel/1.1][IOTDB-5689] Close Isink when ISourceHandle is closed

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit a632bfb05e3fc15e09d68f32daf01625edae1b86
Author: Liao Lanyu <14...@qq.com>
AuthorDate: Sun Mar 19 18:17:31 2023 +0800

    [To rel/1.1][IOTDB-5689] Close Isink when ISourceHandle is closed
---
 .../iotdb/db/mpp/execution/driver/Driver.java      |  13 +-
 .../execution/exchange/MPPDataExchangeManager.java |  67 ++-
 .../mpp/execution/exchange/SharedTsBlockQueue.java |   6 +-
 .../db/mpp/execution/exchange/sink/ISink.java      |   4 +
 .../mpp/execution/exchange/sink/ISinkHandle.java   |   3 +
 .../execution/exchange/sink/LocalSinkChannel.java  |   7 +
 .../execution/exchange/sink/ShuffleSinkHandle.java |  24 +-
 .../mpp/execution/exchange/sink/SinkChannel.java   |  11 +-
 .../execution/exchange/source/SourceHandle.java    |  59 ++-
 .../iotdb/db/mpp/execution/operator/Operator.java  |  10 +-
 .../process/AbstractConsumeAllOperator.java        |   4 +-
 .../operator/process/AbstractIntoOperator.java     |   7 +-
 .../operator/process/AggregationOperator.java      |   6 +-
 .../operator/process/DeviceMergeOperator.java      |   6 +-
 .../operator/process/DeviceViewOperator.java       |  17 +-
 .../execution/operator/process/FillOperator.java   |   6 +-
 .../operator/process/FilterAndProjectOperator.java |   6 +-
 .../execution/operator/process/LimitOperator.java  |   6 +-
 .../operator/process/LinearFillOperator.java       |   8 +-
 .../operator/process/MergeSortOperator.java        |   8 +-
 .../execution/operator/process/OffsetOperator.java |   6 +-
 .../process/RawDataAggregationOperator.java        |   9 +-
 .../operator/process/SingleDeviceViewOperator.java |   6 +-
 .../process/SingleInputAggregationOperator.java    |   6 +-
 .../process/SlidingWindowAggregationOperator.java  |   4 +-
 .../execution/operator/process/SortOperator.java   |   6 +-
 .../operator/process/TagAggregationOperator.java   |   8 +-
 .../operator/process/TransformOperator.java        |  16 +-
 .../process/join/HorizontallyConcatOperator.java   |   8 +-
 .../process/join/RowBasedTimeJoinOperator.java     |  11 +-
 .../operator/process/join/TimeJoinOperator.java    |   9 +-
 .../last/AbstractUpdateLastCacheOperator.java      |   4 +-
 .../last/AlignedUpdateLastCacheOperator.java       |   2 +-
 .../process/last/LastQueryCollectOperator.java     |   6 +-
 .../process/last/LastQueryMergeOperator.java       |  12 +-
 .../operator/process/last/LastQueryOperator.java   |   7 +-
 .../process/last/LastQuerySortOperator.java        |   7 +-
 .../process/last/UpdateLastCacheOperator.java      |   2 +-
 .../schema/CountGroupByLevelMergeOperator.java     |   6 +-
 .../schema/CountGroupByLevelScanOperator.java      |   6 +-
 .../operator/schema/CountMergeOperator.java        |   7 +-
 .../schema/NodeManageMemoryMergeOperator.java      |   6 +-
 .../operator/schema/NodePathsConvertOperator.java  |   6 +-
 .../operator/schema/NodePathsCountOperator.java    |   6 +-
 .../operator/schema/SchemaCountOperator.java       |   6 +-
 .../operator/schema/SchemaFetchMergeOperator.java  |   6 +-
 .../operator/schema/SchemaFetchScanOperator.java   |   6 +-
 .../operator/schema/SchemaQueryMergeOperator.java  |   6 +-
 .../schema/SchemaQueryOrderByHeatOperator.java     |   6 +-
 .../operator/schema/SchemaQueryScanOperator.java   |   6 +-
 .../operator/sink/IdentitySinkOperator.java        |  34 +-
 .../operator/sink/ShuffleHelperOperator.java       |  39 +-
 .../AbstractSeriesAggregationScanOperator.java     |   6 +-
 .../operator/source/AlignedSeriesScanOperator.java |   6 +-
 .../operator/source/ExchangeOperator.java          |   6 +-
 .../operator/source/LastCacheScanOperator.java     |   6 +-
 .../operator/source/SeriesScanOperator.java        |   6 +-
 .../operator/source/ShowQueriesOperator.java       |   6 +-
 .../db/mpp/transformation/api/YieldableReader.java |   6 +-
 .../transformation/dag/input/IUDFInputDataSet.java |   2 +-
 .../dag/input/QueryDataSetInputLayer.java          |   4 +-
 .../dag/input/TsBlockInputDataSet.java             |   2 +-
 .../MultiInputColumnIntermediateLayer.java         |  10 +-
 ...InputColumnMultiReferenceIntermediateLayer.java |  12 +-
 ...nputColumnSingleReferenceIntermediateLayer.java |  10 +-
 .../dag/transformer/Transformer.java               |   4 +-
 .../dag/transformer/binary/BinaryTransformer.java  |   4 +-
 .../transformer/binary/LogicBinaryTransformer.java |   2 +-
 .../multi/MappableUDFQueryRowTransformer.java      |   2 +-
 .../transformer/multi/UDFQueryRowTransformer.java  |   2 +-
 .../multi/UDFQueryRowWindowTransformer.java        |   2 +-
 .../multi/UniversalUDFQueryTransformer.java        |   4 +-
 .../transformer/ternary/TernaryTransformer.java    |   4 +-
 .../transformer/unary/DiffFunctionTransformer.java |   2 +-
 .../dag/transformer/unary/IsNullTransformer.java   |   2 +-
 .../dag/transformer/unary/UnaryTransformer.java    |   2 +-
 .../transformation/dag/util/LayerCacheUtils.java   |  10 +-
 .../iotdb/db/mpp/execution/exchange/StubSink.java  |   5 +
 .../operator/AggregationOperatorTest.java          |  26 +-
 .../AlignedSeriesAggregationScanOperatorTest.java  |  38 +-
 .../operator/AlignedSeriesScanOperatorTest.java    |   6 +-
 .../operator/DeviceMergeOperatorTest.java          | 565 ---------------------
 .../execution/operator/DeviceViewOperatorTest.java |   3 +-
 .../mpp/execution/operator/FillOperatorTest.java   |  16 +-
 .../operator/HorizontallyConcatOperatorTest.java   |   2 +-
 .../operator/LastQueryMergeOperatorTest.java       |  38 +-
 .../execution/operator/LastQueryOperatorTest.java  |   4 +-
 .../operator/LastQuerySortOperatorTest.java        |   5 +-
 .../mpp/execution/operator/LimitOperatorTest.java  |   2 +-
 .../execution/operator/LinearFillOperatorTest.java |  56 +-
 .../execution/operator/MergeSortOperatorTest.java  |  38 +-
 .../mpp/execution/operator/OffsetOperatorTest.java |   6 +-
 .../operator/RawDataAggregationOperatorTest.java   |  54 +-
 .../SeriesAggregationScanOperatorTest.java         |  65 ++-
 .../execution/operator/SeriesScanOperatorTest.java |   2 +-
 .../operator/SingleDeviceViewOperatorTest.java     |   3 +-
 .../SlidingWindowAggregationOperatorTest.java      |   3 +-
 .../execution/operator/TimeJoinOperatorTest.java   |   6 +-
 .../operator/UpdateLastCacheOperatorTest.java      |   6 +-
 .../operator/schema/SchemaCountOperatorTest.java   |   4 +-
 .../schema/SchemaQueryScanOperatorTest.java        |   4 +-
 thrift/src/main/thrift/datanode.thrift             |  12 +-
 102 files changed, 674 insertions(+), 970 deletions(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/driver/Driver.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/driver/Driver.java
index 2fd9a56911..c3be5e1bbf 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/driver/Driver.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/driver/Driver.java
@@ -190,7 +190,16 @@ public abstract class Driver implements IDriver {
   private boolean isFinishedInternal() {
     checkLockHeld("Lock must be held to call isFinishedInternal");
 
-    boolean finished = state.get() != State.ALIVE || driverContext.isDone() || root.isFinished();
+    boolean finished;
+    try {
+      finished =
+          state.get() != State.ALIVE
+              || driverContext.isDone()
+              || root.isFinished()
+              || sink.isClosed();
+    } catch (Exception e) {
+      throw new RuntimeException(e);
+    }
     if (finished) {
       state.compareAndSet(State.ALIVE, State.NEED_DESTRUCTION);
     }
@@ -219,7 +228,7 @@ public abstract class Driver implements IDriver {
       List<StackTraceElement> interrupterStack = exclusiveLock.getInterrupterStack();
       if (interrupterStack == null) {
         driverContext.failed(t);
-        throw t;
+        throw new RuntimeException(t);
       }
 
       // Driver thread was interrupted which should only happen if the task is already finished.
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeManager.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeManager.java
index 39cf36a5c0..501781b408 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/MPPDataExchangeManager.java
@@ -40,6 +40,7 @@ import org.apache.iotdb.db.mpp.metric.QueryMetricsManager;
 import org.apache.iotdb.db.utils.SetThreadName;
 import org.apache.iotdb.mpp.rpc.thrift.MPPDataExchangeService;
 import org.apache.iotdb.mpp.rpc.thrift.TAcknowledgeDataBlockEvent;
+import org.apache.iotdb.mpp.rpc.thrift.TCloseSinkChannelEvent;
 import org.apache.iotdb.mpp.rpc.thrift.TEndOfDataBlockEvent;
 import org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId;
 import org.apache.iotdb.mpp.rpc.thrift.TGetDataBlockRequest;
@@ -54,6 +55,7 @@ import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -96,22 +98,16 @@ public class MPPDataExchangeManager implements IMPPDataExchangeManager {
             "[ProcessGetTsBlockRequest] sequence ID in [{}, {})",
             req.getStartSequenceId(),
             req.getEndSequenceId());
-        if (!shuffleSinkHandles.containsKey(req.getSourceFragmentInstanceId())) {
-          throw new TException(
-              "Source fragment instance not found. Fragment instance ID: "
-                  + req.getSourceFragmentInstanceId()
-                  + ".");
+        TGetDataBlockResponse resp = new TGetDataBlockResponse(new ArrayList<>());
+        ISinkHandle sinkHandle = shuffleSinkHandles.get(req.getSourceFragmentInstanceId());
+        if (sinkHandle == null) {
+          return resp;
         }
-        TGetDataBlockResponse resp = new TGetDataBlockResponse();
         // index of the channel must be a SinkChannel
-        SinkChannel sinkChannelHandle =
-            (SinkChannel)
-                (shuffleSinkHandles
-                    .get(req.getSourceFragmentInstanceId())
-                    .getChannel(req.getIndex()));
+        SinkChannel sinkChannel = (SinkChannel) (sinkHandle.getChannel(req.getIndex()));
         for (int i = req.getStartSequenceId(); i < req.getEndSequenceId(); i++) {
           try {
-            ByteBuffer serializedTsBlock = sinkChannelHandle.getSerializedTsBlock(i);
+            ByteBuffer serializedTsBlock = sinkChannel.getSerializedTsBlock(i);
             resp.addToTsBlocks(serializedTsBlock);
           } catch (IllegalStateException | IOException e) {
             throw new TException(e);
@@ -140,15 +136,15 @@ public class MPPDataExchangeManager implements IMPPDataExchangeManager {
             e.getStartSequenceId(),
             e.getEndSequenceId(),
             e.getSourceFragmentInstanceId());
-        if (!shuffleSinkHandles.containsKey(e.getSourceFragmentInstanceId())) {
+        ISinkHandle sinkHandle = shuffleSinkHandles.get(e.getSourceFragmentInstanceId());
+        if (sinkHandle == null) {
           LOGGER.debug(
               "received ACK event but target FragmentInstance[{}] is not found.",
               e.getSourceFragmentInstanceId());
           return;
         }
         // index of the channel must be a SinkChannel
-        ((SinkChannel)
-                (shuffleSinkHandles.get(e.getSourceFragmentInstanceId()).getChannel(e.getIndex())))
+        ((SinkChannel) (sinkHandle.getChannel(e.getIndex())))
             .acknowledgeTsBlock(e.getStartSequenceId(), e.getEndSequenceId());
       } catch (Throwable t) {
         LOGGER.warn(
@@ -162,6 +158,36 @@ public class MPPDataExchangeManager implements IMPPDataExchangeManager {
       }
     }
 
+    @Override
+    public void onCloseSinkChannelEvent(TCloseSinkChannelEvent e) throws TException {
+      try (SetThreadName fragmentInstanceName =
+          new SetThreadName(
+              createFullId(
+                  e.sourceFragmentInstanceId.queryId,
+                  e.sourceFragmentInstanceId.fragmentId,
+                  e.sourceFragmentInstanceId.instanceId))) {
+        LOGGER.debug(
+            "Closed source handle of ShuffleSinkHandle {}, channel index: {}.",
+            e.getSourceFragmentInstanceId(),
+            e.getIndex());
+        ISinkHandle sinkHandle = shuffleSinkHandles.get(e.getSourceFragmentInstanceId());
+        if (sinkHandle == null) {
+          LOGGER.debug(
+              "received CloseSinkChannelEvent but target FragmentInstance[{}] is not found.",
+              e.getSourceFragmentInstanceId());
+          return;
+        }
+        sinkHandle.getChannel(e.getIndex()).close();
+      } catch (Throwable t) {
+        LOGGER.warn(
+            "Close channel of ShuffleSinkHandle {}, index {} failed.",
+            e.getSourceFragmentInstanceId(),
+            e.getIndex(),
+            t);
+        throw t;
+      }
+    }
+
     @Override
     public void onNewDataBlockEvent(TNewDataBlockEvent e) throws TException {
       long startTime = System.nanoTime();
@@ -465,9 +491,7 @@ public class MPPDataExchangeManager implements IMPPDataExchangeManager {
         sourceHandleMap == null ? null : (LocalSourceHandle) sourceHandleMap.get(remotePlanNodeId);
     if (localSourceHandle != null) {
       LOGGER.debug("Get SharedTsBlockQueue from local source handle");
-      queue =
-          ((LocalSourceHandle) sourceHandles.get(remoteFragmentInstanceId).get(remotePlanNodeId))
-              .getSharedTsBlockQueue();
+      queue = localSourceHandle.getSharedTsBlockQueue();
     } else {
       LOGGER.debug("Create SharedTsBlockQueue");
       queue = new SharedTsBlockQueue(localFragmentInstanceId, localPlanNodeId, localMemoryManager);
@@ -623,11 +647,10 @@ public class MPPDataExchangeManager implements IMPPDataExchangeManager {
         localPlanNodeId,
         localFragmentInstanceId);
     SharedTsBlockQueue queue;
-    if (shuffleSinkHandles.containsKey(remoteFragmentInstanceId)) {
+    ISinkHandle sinkHandle = shuffleSinkHandles.get(remoteFragmentInstanceId);
+    if (sinkHandle != null) {
       LOGGER.debug("Get SharedTsBlockQueue from local sink handle");
-      queue =
-          ((LocalSinkChannel) shuffleSinkHandles.get(remoteFragmentInstanceId).getChannel(index))
-              .getSharedTsBlockQueue();
+      queue = ((LocalSinkChannel) (sinkHandle.getChannel(index))).getSharedTsBlockQueue();
     } else {
       LOGGER.debug("Create SharedTsBlockQueue");
       queue =
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SharedTsBlockQueue.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SharedTsBlockQueue.java
index b62fffc8c6..53d668cc86 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SharedTsBlockQueue.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/SharedTsBlockQueue.java
@@ -131,6 +131,10 @@ public class SharedTsBlockQueue {
     return queue.isEmpty();
   }
 
+  public boolean isClosed() {
+    return closed;
+  }
+
   public int getNumOfBufferedTsBlocks() {
     return queue.size();
   }
@@ -147,7 +151,7 @@ public class SharedTsBlockQueue {
   public void setNoMoreTsBlocks(boolean noMoreTsBlocks) {
     LOGGER.debug("[SignalNoMoreTsBlockOnQueue]");
     if (closed) {
-      LOGGER.warn("queue has been destroyed");
+      LOGGER.debug("The queue has been destroyed when calling setNoMoreTsBlocks.");
       return;
     }
     this.noMoreTsBlocks = noMoreTsBlocks;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISink.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISink.java
index 5af20abf60..961f49fb70 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISink.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISink.java
@@ -18,6 +18,7 @@
  */
 package org.apache.iotdb.db.mpp.execution.exchange.sink;
 
+import org.apache.iotdb.db.mpp.execution.driver.Driver;
 import org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId;
 import org.apache.iotdb.tsfile.read.common.block.TsBlock;
 
@@ -78,6 +79,9 @@ public interface ISink {
    */
   void close();
 
+  /** Return true if this ISink has been closed. Used in {@link Driver#isFinishedInternal()} */
+  boolean isClosed();
+
   /** Set max bytes this ISink can reserve from memory pool */
   void setMaxBytesCanReserve(long maxBytesCanReserve);
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISinkHandle.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISinkHandle.java
index c600f60eb6..5fb511e402 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISinkHandle.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ISinkHandle.java
@@ -33,4 +33,7 @@ public interface ISinkHandle extends ISink {
 
   /** Open specified channel of ISinkHandle. */
   void tryOpenChannel(int channelIndex);
+
+  /** Return true if the specified channel is closed. */
+  boolean isChannelClosed(int index);
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/LocalSinkChannel.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/LocalSinkChannel.java
index 29ff8b7a12..afd043c9af 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/LocalSinkChannel.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/LocalSinkChannel.java
@@ -225,5 +225,12 @@ public class LocalSinkChannel implements ISinkChannel {
     }
   }
 
+  @Override
+  public boolean isClosed() {
+    synchronized (queue) {
+      return queue.isClosed();
+    }
+  }
+
   // end region
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ShuffleSinkHandle.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ShuffleSinkHandle.java
index 12a438d845..7060541acc 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ShuffleSinkHandle.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/ShuffleSinkHandle.java
@@ -26,12 +26,14 @@ import org.apache.iotdb.db.mpp.metric.QueryMetricsManager;
 import org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId;
 import org.apache.iotdb.tsfile.read.common.block.TsBlock;
 
+import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.ListenableFuture;
 import org.apache.commons.lang3.Validate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import java.util.List;
+import java.util.Set;
 
 import static org.apache.iotdb.db.mpp.metric.DataExchangeCostMetricSet.SINK_HANDLE_SEND_TSBLOCK_REMOTE;
 
@@ -46,6 +48,8 @@ public class ShuffleSinkHandle implements ISinkHandle {
 
   private final boolean[] channelOpened;
 
+  private final Set<Integer> closedChannel = Sets.newConcurrentHashSet();
+
   private final DownStreamChannelIndex downStreamChannelIndex;
 
   private final int channelNum;
@@ -141,6 +145,11 @@ public class ShuffleSinkHandle implements ISinkHandle {
     }
   }
 
+  @Override
+  public boolean isClosed() {
+    return closedChannel.size() == downStreamChannelList.size();
+  }
+
   @Override
   public synchronized boolean isAborted() {
     return aborted;
@@ -235,6 +244,19 @@ public class ShuffleSinkHandle implements ISinkHandle {
     }
   }
 
+  @Override
+  public boolean isChannelClosed(int index) {
+    if (closedChannel.contains(index)) {
+      return true;
+    } else {
+      if (downStreamChannelList.get(index).isClosed()) {
+        closedChannel.add(index);
+        return true;
+      }
+      return false;
+    }
+  }
+
   // region ============ Shuffle Related ============
   public enum ShuffleStrategyEnum {
     PLAIN,
@@ -281,7 +303,7 @@ public class ShuffleSinkHandle implements ISinkHandle {
     private boolean satisfy(int channelIndex) {
       // downStreamChannel is always an ISinkChannel
       ISinkChannel channel = downStreamChannelList.get(channelIndex);
-      if (channel.isNoMoreTsBlocks()) {
+      if (channel.isNoMoreTsBlocks() || channel.isClosed()) {
         return false;
       }
       return channel.getBufferRetainedSizeInBytes() <= channelMemoryThreshold
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/SinkChannel.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/SinkChannel.java
index fbcdaf2e0c..5cd28de462 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/SinkChannel.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/sink/SinkChannel.java
@@ -157,6 +157,10 @@ public class SinkChannel implements ISinkChannel {
     long startTime = System.nanoTime();
     try {
       Validate.notNull(tsBlock, "tsBlocks is null");
+      if (closed) {
+        // SinkChannel may have been closed by its downstream SourceHandle
+        return;
+      }
       checkState();
       if (!blocked.isDone()) {
         throw new IllegalStateException("Sink handle is blocked.");
@@ -254,6 +258,11 @@ public class SinkChannel implements ISinkChannel {
     LOGGER.debug("[EndCloseSinkChannel]");
   }
 
+  @Override
+  public boolean isClosed() {
+    return closed;
+  }
+
   @Override
   public synchronized boolean isAborted() {
     return aborted;
@@ -353,8 +362,6 @@ public class SinkChannel implements ISinkChannel {
   private void checkState() {
     if (aborted) {
       throw new IllegalStateException("SinkChannel is aborted.");
-    } else if (closed) {
-      throw new IllegalStateException("SinkChannel is closed.");
     }
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/source/SourceHandle.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/source/SourceHandle.java
index db462721d0..b66dd4bce4 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/source/SourceHandle.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/exchange/source/SourceHandle.java
@@ -30,6 +30,7 @@ import org.apache.iotdb.db.mpp.execution.memory.LocalMemoryManager;
 import org.apache.iotdb.db.mpp.metric.QueryMetricsManager;
 import org.apache.iotdb.db.utils.SetThreadName;
 import org.apache.iotdb.mpp.rpc.thrift.TAcknowledgeDataBlockEvent;
+import org.apache.iotdb.mpp.rpc.thrift.TCloseSinkChannelEvent;
 import org.apache.iotdb.mpp.rpc.thrift.TFragmentInstanceId;
 import org.apache.iotdb.mpp.rpc.thrift.TGetDataBlockRequest;
 import org.apache.iotdb.mpp.rpc.thrift.TGetDataBlockResponse;
@@ -373,6 +374,7 @@ public class SourceHandle implements ISourceHandle {
           .clearMemoryReservationMap(
               localFragmentInstanceId.getQueryId(), fullFragmentInstanceId, localPlanNodeId);
       closed = true;
+      executorService.submit(new SendCloseSinkChannelEventTask());
       currSequenceId = lastSequenceId + 1;
       sourceHandleListener.onFinished(this);
     }
@@ -490,8 +492,20 @@ public class SourceHandle implements ISourceHandle {
           try (SyncDataNodeMPPDataExchangeServiceClient client =
               mppDataExchangeServiceClientManager.borrowClient(remoteEndpoint)) {
             TGetDataBlockResponse resp = client.getDataBlock(req);
-
             int tsBlockNum = resp.getTsBlocks().size();
+            if (tsBlockNum == 0) {
+              if (!closed) {
+                // failed to pull TsBlocks
+                LOGGER.warn(
+                    "{} failed to pull TsBlocks [{}] to [{}] from SinkHandle {}, channel index {},",
+                    localFragmentInstanceId,
+                    startSequenceId,
+                    endSequenceId,
+                    remoteFragmentInstanceId,
+                    indexOfUpstreamSinkHandle);
+              }
+              return;
+            }
             List<ByteBuffer> tsBlocks = new ArrayList<>(tsBlockNum);
             tsBlocks.addAll(resp.getTsBlocks());
 
@@ -620,4 +634,47 @@ public class SourceHandle implements ISourceHandle {
       }
     }
   }
+
+  class SendCloseSinkChannelEventTask implements Runnable {
+
+    @Override
+    public void run() {
+      try (SetThreadName sourceHandleName = new SetThreadName(threadName)) {
+        LOGGER.debug(
+            "[SendCloseSinkChanelEvent] to [ShuffleSinkHandle: {}, index: {}]).",
+            remoteFragmentInstanceId,
+            indexOfUpstreamSinkHandle);
+        int attempt = 0;
+        TCloseSinkChannelEvent closeSinkChannelEvent =
+            new TCloseSinkChannelEvent(remoteFragmentInstanceId, indexOfUpstreamSinkHandle);
+        while (attempt < MAX_ATTEMPT_TIMES) {
+          attempt += 1;
+          long startTime = System.nanoTime();
+          try (SyncDataNodeMPPDataExchangeServiceClient client =
+              mppDataExchangeServiceClientManager.borrowClient(remoteEndpoint)) {
+            client.onCloseSinkChannelEvent(closeSinkChannelEvent);
+            break;
+          } catch (Throwable e) {
+            LOGGER.warn(
+                "[SendCloseSinkChanelEvent] to [ShuffleSinkHandle: {}, index: {}] failed.).",
+                remoteFragmentInstanceId,
+                indexOfUpstreamSinkHandle);
+            if (attempt == MAX_ATTEMPT_TIMES) {
+              synchronized (SourceHandle.this) {
+                sourceHandleListener.onFailure(SourceHandle.this, e);
+              }
+            }
+            try {
+              Thread.sleep(retryIntervalInMs);
+            } catch (InterruptedException ex) {
+              Thread.currentThread().interrupt();
+              synchronized (SourceHandle.this) {
+                sourceHandleListener.onFailure(SourceHandle.this, e);
+              }
+            }
+          }
+        }
+      }
+    }
+  }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/Operator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/Operator.java
index aaf404d467..d762220da3 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/Operator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/Operator.java
@@ -38,7 +38,7 @@ public interface Operator extends AutoCloseable {
     return NOT_BLOCKED;
   }
 
-  default TsBlock nextWithTimer() {
+  default TsBlock nextWithTimer() throws Exception {
     OperatorContext context = getOperatorContext();
     long startTime = System.nanoTime();
 
@@ -51,9 +51,9 @@ public interface Operator extends AutoCloseable {
   }
 
   /** Gets next tsBlock from this operator. If no data is currently available, return null. */
-  TsBlock next();
+  TsBlock next() throws Exception;
 
-  default boolean hasNextWithTimer() {
+  default boolean hasNextWithTimer() throws Exception {
     OperatorContext context = getOperatorContext();
     long startTime = System.nanoTime();
 
@@ -65,7 +65,7 @@ public interface Operator extends AutoCloseable {
   }
 
   /** @return true if the operator has more data, otherwise false */
-  boolean hasNext();
+  boolean hasNext() throws Exception;
 
   /** This method will always be called before releasing the Operator reference. */
   @Override
@@ -74,7 +74,7 @@ public interface Operator extends AutoCloseable {
   /**
    * Is this operator completely finished processing and no more output TsBlock will be produced.
    */
-  boolean isFinished();
+  boolean isFinished() throws Exception;
 
   /**
    * We should also consider the memory used by its children operator, so the calculation logic may
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractConsumeAllOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractConsumeAllOperator.java
index 1ae0fbf801..7c33664327 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractConsumeAllOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractConsumeAllOperator.java
@@ -82,7 +82,7 @@ public abstract class AbstractConsumeAllOperator extends AbstractOperator
    * @return true if results of all children are ready. Return false if some children is blocked or
    *     return null.
    */
-  protected boolean prepareInput() {
+  protected boolean prepareInput() throws Exception {
     boolean allReady = true;
     for (int i = 0; i < inputOperatorsCount; i++) {
       if (!isEmpty(i)) {
@@ -120,7 +120,7 @@ public abstract class AbstractConsumeAllOperator extends AbstractOperator
     }
   }
 
-  protected TsBlock getNextTsBlock(int childIndex) {
+  protected TsBlock getNextTsBlock(int childIndex) throws Exception {
     return children.get(childIndex).nextWithTimer();
   }
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
index 0b5c189c76..3d65c1659c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AbstractIntoOperator.java
@@ -131,19 +131,18 @@ public abstract class AbstractIntoOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !finished;
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     checkLastWriteOperation();
 
     if (!processTsBlock(cachedTsBlock)) {
       return null;
     }
     cachedTsBlock = null;
-
     if (child.hasNextWithTimer()) {
       TsBlock inputTsBlock = child.nextWithTimer();
       processTsBlock(inputTsBlock);
@@ -293,7 +292,7 @@ public abstract class AbstractIntoOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return finished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
index 364086c4fb..0102c0be07 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/AggregationOperator.java
@@ -94,12 +94,12 @@ public class AggregationOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return curTimeRange != null || timeRangeIterator.hasNextTimeRange();
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // start stopwatch
     long maxRuntime = operatorContext.getMaxRunTime().roundTo(TimeUnit.NANOSECONDS);
     long start = System.nanoTime();
@@ -135,7 +135,7 @@ public class AggregationOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !this.hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceMergeOperator.java
index 888db23336..cb7630dea2 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceMergeOperator.java
@@ -113,7 +113,7 @@ public class DeviceMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // get new input TsBlock
     for (int i = 0; i < inputOperatorsCount; i++) {
       if (!noMoreTsBlocks[i] && isTsBlockEmpty(i) && deviceOperators.get(i).hasNextWithTimer()) {
@@ -197,7 +197,7 @@ public class DeviceMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -224,7 +224,7 @@ public class DeviceMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceViewOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceViewOperator.java
index 242586a78e..c0af80f7fe 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceViewOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/DeviceViewOperator.java
@@ -31,6 +31,7 @@ import org.apache.iotdb.tsfile.read.common.block.column.RunLengthEncodedColumn;
 import org.apache.iotdb.tsfile.utils.Binary;
 
 import com.google.common.util.concurrent.ListenableFuture;
+import org.apache.commons.lang3.Validate;
 
 import java.util.List;
 
@@ -107,11 +108,16 @@ public class DeviceViewOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!getCurDeviceOperator().hasNextWithTimer()) {
+      // close finished child
+      getCurDeviceOperator().close();
+      deviceOperators.set(deviceIndex, null);
+      // increment index, move to next child
       deviceIndex++;
       return null;
     }
+
     TsBlock tsBlock = getCurDeviceOperator().nextWithTimer();
     if (tsBlock == null) {
       return null;
@@ -138,19 +144,20 @@ public class DeviceViewOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return deviceIndex < devices.size();
   }
 
   @Override
   public void close() throws Exception {
-    for (Operator child : deviceOperators) {
-      child.close();
+    for (int i = deviceIndex, n = deviceOperators.size(); i < n; i++) {
+      Validate.notNull(deviceOperators.get(i));
+      deviceOperators.get(i).close();
     }
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !this.hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FillOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FillOperator.java
index 92ec771f32..c88ab34483 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FillOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FillOperator.java
@@ -57,7 +57,7 @@ public class FillOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock block = child.nextWithTimer();
     if (block == null) {
       return null;
@@ -78,7 +78,7 @@ public class FillOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return child.hasNextWithTimer();
   }
 
@@ -88,7 +88,7 @@ public class FillOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FilterAndProjectOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FilterAndProjectOperator.java
index c08fcfd27d..0016c7255c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FilterAndProjectOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/FilterAndProjectOperator.java
@@ -94,7 +94,7 @@ public class FilterAndProjectOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock input = inputOperator.nextWithTimer();
     if (input == null) {
       return null;
@@ -192,12 +192,12 @@ public class FilterAndProjectOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return inputOperator.hasNextWithTimer();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return inputOperator.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LimitOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LimitOperator.java
index 68604cd1ce..b208e551b1 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LimitOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LimitOperator.java
@@ -51,7 +51,7 @@ public class LimitOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock block = child.nextWithTimer();
     if (block == null) {
       return null;
@@ -67,7 +67,7 @@ public class LimitOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return remainingLimit > 0 && child.hasNextWithTimer();
   }
 
@@ -77,7 +77,7 @@ public class LimitOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return remainingLimit == 0 || child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LinearFillOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LinearFillOperator.java
index 3792829196..2d785311a6 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LinearFillOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/LinearFillOperator.java
@@ -82,7 +82,7 @@ public class LinearFillOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
 
     // make sure we call child.next() at most once
     if (cachedTsBlock.isEmpty()) {
@@ -142,7 +142,7 @@ public class LinearFillOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     // if child.hasNext() return false, it means that there is no more tsBlocks
     noMoreTsBlock = !child.hasNextWithTimer();
     // if there is more tsBlock, we can call child.next() once
@@ -156,7 +156,7 @@ public class LinearFillOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return cachedTsBlock.isEmpty() && child.isFinished();
   }
 
@@ -208,7 +208,7 @@ public class LinearFillOperator implements ProcessOperator {
   /**
    * @return true if we succeed to get next TsBlock and add it into cachedTsBlock, otherwise false
    */
-  private boolean tryToGetNextTsBlock() {
+  private boolean tryToGetNextTsBlock() throws Exception {
     if (canCallNext) { // if we can call child.next(), we call that and cache it in
       // cachedTsBlock
       canCallNext = false;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/MergeSortOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/MergeSortOperator.java
index 2235bc7c91..a8f413acb6 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/MergeSortOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/MergeSortOperator.java
@@ -82,7 +82,7 @@ public class MergeSortOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // 1. fill consumed up TsBlock
     if (!prepareInput()) {
       return null;
@@ -135,7 +135,7 @@ public class MergeSortOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -155,7 +155,7 @@ public class MergeSortOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
@@ -208,7 +208,7 @@ public class MergeSortOperator extends AbstractConsumeAllOperator {
    *     some children is blocked or return null.
    */
   @Override
-  protected boolean prepareInput() {
+  protected boolean prepareInput() throws Exception {
     boolean allReady = true;
     for (int i = 0; i < inputOperatorsCount; i++) {
       if (noMoreTsBlocks[i] || !isEmpty(i)) {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/OffsetOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/OffsetOperator.java
index e6f146eac1..37127e82aa 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/OffsetOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/OffsetOperator.java
@@ -51,7 +51,7 @@ public class OffsetOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock block = child.nextWithTimer();
     if (block == null) {
       return null;
@@ -66,7 +66,7 @@ public class OffsetOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return child.hasNextWithTimer();
   }
 
@@ -76,7 +76,7 @@ public class OffsetOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/RawDataAggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/RawDataAggregationOperator.java
index 97e6f6d93c..ed765d9b47 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/RawDataAggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/RawDataAggregationOperator.java
@@ -73,19 +73,19 @@ public class RawDataAggregationOperator extends SingleInputAggregationOperator {
     this.resultTsBlockBuilder = windowManager.createResultTsBlockBuilder(aggregators);
   }
 
-  private boolean hasMoreData() {
+  private boolean hasMoreData() throws Exception {
     return !(inputTsBlock == null || inputTsBlock.isEmpty())
         || child.hasNextWithTimer()
         || hasCachedDataInAggregator;
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return windowManager.hasNext(hasMoreData());
   }
 
   @Override
-  protected boolean calculateNextAggregationResult() {
+  protected boolean calculateNextAggregationResult() throws Exception {
 
     // if needSkip is true, just get the tsBlock directly.
     while (needSkip || !calculateFromRawData()) {
@@ -107,7 +107,8 @@ public class RawDataAggregationOperator extends SingleInputAggregationOperator {
         if (windowManager.notInitializedLastTimeWindow()) {
           initWindowAndAggregators();
         }
-        // If the window is not initialized, it just returns to avoid invoking updateResultTsBlock()
+        // If the window is not initialized, it just returns to avoid invoking
+        // updateResultTsBlock()
         // but if it's skipping the last window, just break and keep skipping.
         if (needSkip || windowManager.isCurWindowInit()) break;
         return false;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleDeviceViewOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleDeviceViewOperator.java
index a22d52c9e2..51464b742c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleDeviceViewOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleDeviceViewOperator.java
@@ -81,7 +81,7 @@ public class SingleDeviceViewOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock tsBlock = deviceOperator.nextWithTimer();
     if (tsBlock == null) {
       return null;
@@ -103,7 +103,7 @@ public class SingleDeviceViewOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return deviceOperator.hasNextWithTimer();
   }
 
@@ -113,7 +113,7 @@ public class SingleDeviceViewOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !this.hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleInputAggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleInputAggregationOperator.java
index 0fb561e1e3..40938e335e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleInputAggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SingleInputAggregationOperator.java
@@ -72,7 +72,7 @@ public abstract class SingleInputAggregationOperator implements ProcessOperator
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // start stopwatch
     long maxRuntime = operatorContext.getMaxRunTime().roundTo(TimeUnit.NANOSECONDS);
     long start = System.nanoTime();
@@ -97,7 +97,7 @@ public abstract class SingleInputAggregationOperator implements ProcessOperator
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !this.hasNextWithTimer();
   }
 
@@ -106,7 +106,7 @@ public abstract class SingleInputAggregationOperator implements ProcessOperator
     child.close();
   }
 
-  protected abstract boolean calculateNextAggregationResult();
+  protected abstract boolean calculateNextAggregationResult() throws Exception;
 
   protected abstract void updateResultTsBlock();
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SlidingWindowAggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SlidingWindowAggregationOperator.java
index 3fb0dca85a..3e8871da00 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SlidingWindowAggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SlidingWindowAggregationOperator.java
@@ -71,12 +71,12 @@ public class SlidingWindowAggregationOperator extends SingleInputAggregationOper
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return curTimeRange != null || timeRangeIterator.hasNextTimeRange();
   }
 
   @Override
-  protected boolean calculateNextAggregationResult() {
+  protected boolean calculateNextAggregationResult() throws Exception {
     if (curTimeRange == null && timeRangeIterator.hasNextTimeRange()) {
       // move to next time window
       curTimeRange = timeRangeIterator.nextTimeRange();
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SortOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SortOperator.java
index 16c190a25e..ae61601063 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SortOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/SortOperator.java
@@ -64,7 +64,7 @@ public class SortOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock tsBlock = inputOperator.nextWithTimer();
     if (tsBlock == null) {
       return null;
@@ -103,7 +103,7 @@ public class SortOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return inputOperator.hasNextWithTimer();
   }
 
@@ -113,7 +113,7 @@ public class SortOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return cachedData == null;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TagAggregationOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TagAggregationOperator.java
index 9cc3e37a63..0360028c2b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TagAggregationOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TagAggregationOperator.java
@@ -81,7 +81,7 @@ public class TagAggregationOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     long maxRuntime = operatorContext.getMaxRunTime().roundTo(TimeUnit.NANOSECONDS);
     long start = System.nanoTime();
     while (System.nanoTime() - start < maxRuntime && !tsBlockBuilder.isFull()) {
@@ -145,12 +145,12 @@ public class TagAggregationOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !isEmpty(readyChildIndex) || children.get(readyChildIndex).hasNextWithTimer();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !this.hasNextWithTimer();
   }
 
@@ -176,7 +176,7 @@ public class TagAggregationOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  protected TsBlock getNextTsBlock(int childIndex) {
+  protected TsBlock getNextTsBlock(int childIndex) throws Exception {
     consumedIndices[childIndex] = 0;
     return children.get(childIndex).nextWithTimer();
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TransformOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TransformOperator.java
index 9f0a0113f5..751c121911 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TransformOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/TransformOperator.java
@@ -140,8 +140,7 @@ public class TransformOperator implements ProcessOperator {
     }
   }
 
-  protected YieldableState iterateAllColumnsToNextValid()
-      throws QueryProcessException, IOException {
+  protected YieldableState iterateAllColumnsToNextValid() throws Exception {
     for (int i = 0, n = shouldIterateReadersToNextValid.length; i < n; ++i) {
       if (shouldIterateReadersToNextValid[i]) {
         final YieldableState yieldableState = iterateReaderToNextValid(transformers[i]);
@@ -154,8 +153,7 @@ public class TransformOperator implements ProcessOperator {
     return YieldableState.YIELDABLE;
   }
 
-  protected YieldableState iterateReaderToNextValid(LayerPointReader reader)
-      throws QueryProcessException, IOException {
+  protected YieldableState iterateReaderToNextValid(LayerPointReader reader) throws Exception {
     // Since a constant operand is not allowed to be a result column, the reader will not be
     // a ConstantLayerPointReader.
     // If keepNull is false, we must iterate the reader until a non-null row is returned.
@@ -172,7 +170,7 @@ public class TransformOperator implements ProcessOperator {
   }
 
   @Override
-  public final boolean hasNext() {
+  public final boolean hasNext() throws Exception {
     if (!timeHeap.isEmpty()) {
       return true;
     }
@@ -188,7 +186,7 @@ public class TransformOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
 
     try {
       YieldableState yieldableState = iterateAllColumnsToNextValid();
@@ -255,7 +253,7 @@ public class TransformOperator implements ProcessOperator {
   }
 
   protected boolean collectReaderAppendIsNull(LayerPointReader reader, long currentTime)
-      throws QueryProcessException, IOException {
+      throws Exception {
     final YieldableState yieldableState = reader.yield();
 
     if (yieldableState == YieldableState.NOT_YIELDABLE_NO_MORE_DATA) {
@@ -275,7 +273,7 @@ public class TransformOperator implements ProcessOperator {
 
   protected YieldableState collectDataPoint(
       LayerPointReader reader, ColumnBuilder writer, long currentTime, int readerIndex)
-      throws QueryProcessException, IOException {
+      throws Exception {
     final YieldableState yieldableState = reader.yield();
     if (yieldableState == YieldableState.NOT_YIELDABLE_NO_MORE_DATA) {
       writer.appendNull();
@@ -336,7 +334,7 @@ public class TransformOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     // call hasNext first, or data of inputOperator could be missing
     boolean flag = !hasNextWithTimer();
     return timeHeap.isEmpty() && (flag || inputOperator.isFinished());
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/HorizontallyConcatOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/HorizontallyConcatOperator.java
index dadd3760af..f26fb7dfb6 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/HorizontallyConcatOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/HorizontallyConcatOperator.java
@@ -63,7 +63,7 @@ public class HorizontallyConcatOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!prepareInput()) {
       return null;
     }
@@ -106,7 +106,7 @@ public class HorizontallyConcatOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -121,7 +121,7 @@ public class HorizontallyConcatOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
@@ -173,7 +173,7 @@ public class HorizontallyConcatOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  protected TsBlock getNextTsBlock(int childIndex) {
+  protected TsBlock getNextTsBlock(int childIndex) throws Exception {
     inputIndex[childIndex] = 0;
     return children.get(childIndex).nextWithTimer();
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/RowBasedTimeJoinOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/RowBasedTimeJoinOperator.java
index aca522cc57..0cc36c5e51 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/RowBasedTimeJoinOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/RowBasedTimeJoinOperator.java
@@ -120,7 +120,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (retainedTsBlock != null) {
       return getResultFromRetainedTsBlock();
     }
@@ -184,7 +184,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -207,7 +207,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
@@ -269,7 +269,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
    *     some children is blocked or return null.
    */
   @Override
-  protected boolean prepareInput() {
+  protected boolean prepareInput() throws Exception {
     boolean allReady = true;
     for (int i = 0; i < inputOperatorsCount; i++) {
       if (noMoreTsBlocks[i] || !isEmpty(i)) {
@@ -288,6 +288,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
           noMoreTsBlocks[i] = true;
           inputTsBlocks[i] = null;
         }
+
       } else {
         allReady = false;
       }
@@ -301,7 +302,7 @@ public class RowBasedTimeJoinOperator extends AbstractConsumeAllOperator {
   }
 
   @Override
-  protected TsBlock getNextTsBlock(int childIndex) {
+  protected TsBlock getNextTsBlock(int childIndex) throws Exception {
     inputIndex[childIndex] = 0;
     return children.get(childIndex).nextWithTimer();
   }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/TimeJoinOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/TimeJoinOperator.java
index f945b700e4..2b60ad6d3d 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/TimeJoinOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/join/TimeJoinOperator.java
@@ -119,7 +119,7 @@ public class TimeJoinOperator extends AbstractOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (retainedTsBlock != null) {
       return getResultFromRetainedTsBlock();
     }
@@ -147,7 +147,8 @@ public class TimeJoinOperator extends AbstractOperator {
             // In such case, TimeJoinOperator can't go on calculating, so we just return null.
             // We can also use the while loop here to continuously call the hasNext() and next()
             // methods of the child operator until its hasNext() returns false or the next() gets
-            // the data that is not empty, but this will cause the execution time of the while loop
+            // the data that is not empty, but this will cause the execution time of the while
+            // loop
             // to be uncontrollable and may exceed all allocated time slice
             return null;
           }
@@ -198,7 +199,7 @@ public class TimeJoinOperator extends AbstractOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -228,7 +229,7 @@ public class TimeJoinOperator extends AbstractOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AbstractUpdateLastCacheOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AbstractUpdateLastCacheOperator.java
index 60095e9365..f0b1ffc49a 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AbstractUpdateLastCacheOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AbstractUpdateLastCacheOperator.java
@@ -81,12 +81,12 @@ public abstract class AbstractUpdateLastCacheOperator implements ProcessOperator
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return child.hasNextWithTimer();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AlignedUpdateLastCacheOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AlignedUpdateLastCacheOperator.java
index f78c19e4fe..a75581eb03 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AlignedUpdateLastCacheOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/AlignedUpdateLastCacheOperator.java
@@ -50,7 +50,7 @@ public class AlignedUpdateLastCacheOperator extends AbstractUpdateLastCacheOpera
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock res = child.nextWithTimer();
     if (res == null) {
       return null;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryCollectOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryCollectOperator.java
index b69ecfa388..199d12b467 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryCollectOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryCollectOperator.java
@@ -60,7 +60,7 @@ public class LastQueryCollectOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (children.get(currentIndex).hasNextWithTimer()) {
       return children.get(currentIndex).nextWithTimer();
     } else {
@@ -70,7 +70,7 @@ public class LastQueryCollectOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return currentIndex < inputOperatorsCount;
   }
 
@@ -82,7 +82,7 @@ public class LastQueryCollectOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryMergeOperator.java
index fcc074b024..af4517d246 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryMergeOperator.java
@@ -104,7 +104,7 @@ public class LastQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
 
     // end time series for returned TsBlock this time, it's the min/max end time series among all
     // the children
@@ -133,10 +133,12 @@ public class LastQueryMergeOperator implements ProcessOperator {
           } else {
             // child operator has next but return an empty TsBlock which means that it may not
             // finish calculation in given time slice.
-            // In such case, LastQueryMergeOperator can't go on calculating, so we just return null.
+            // In such case, LastQueryMergeOperator can't go on calculating, so we just return
+            // null.
             // We can also use the while loop here to continuously call the hasNext() and next()
             // methods of the child operator until its hasNext() returns false or the next() gets
-            // the data that is not empty, but this will cause the execution time of the while loop
+            // the data that is not empty, but this will cause the execution time of the while
+            // loop
             // to be uncontrollable and may exceed all allocated time slice
             return null;
           }
@@ -179,7 +181,7 @@ public class LastQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (finished) {
       return false;
     }
@@ -207,7 +209,7 @@ public class LastQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     if (finished) {
       return true;
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryOperator.java
index c0f825e02a..db4a7e95dd 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQueryOperator.java
@@ -85,7 +85,7 @@ public class LastQueryOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
 
     // we have consumed up data from children Operator, just return all remaining cached data in
     // tsBlockBuilder
@@ -112,6 +112,7 @@ public class LastQueryOperator implements ProcessOperator {
           LastQueryUtil.appendLastValue(tsBlockBuilder, tsBlock);
         }
       }
+
       currentIndex++;
     }
 
@@ -121,12 +122,12 @@ public class LastQueryOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return currentIndex < inputOperatorsCount || !tsBlockBuilder.isEmpty();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQuerySortOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQuerySortOperator.java
index 09779cf106..5a4fbd7c0c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQuerySortOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/LastQuerySortOperator.java
@@ -110,7 +110,7 @@ public class LastQuerySortOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // we have consumed up data from children Operator, just return all remaining cached data in
     // cachedTsBlock, tsBlockBuilder and previousTsBlock
     if (currentIndex >= inputOperatorsCount) {
@@ -152,6 +152,7 @@ public class LastQuerySortOperator implements ProcessOperator {
             return null;
           }
         }
+
         currentIndex++;
       }
       if (previousTsBlockIndex < previousTsBlock.getPositionCount()) {
@@ -169,7 +170,7 @@ public class LastQuerySortOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return currentIndex < inputOperatorsCount
         || cachedTsBlockRowIndex < cachedTsBlockSize
         || !tsBlockBuilder.isEmpty()
@@ -185,7 +186,7 @@ public class LastQuerySortOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/UpdateLastCacheOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/UpdateLastCacheOperator.java
index 69972a40e2..7bcc5a61e5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/UpdateLastCacheOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/process/last/UpdateLastCacheOperator.java
@@ -52,7 +52,7 @@ public class UpdateLastCacheOperator extends AbstractUpdateLastCacheOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock res = child.nextWithTimer();
     if (res == null) {
       return null;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelMergeOperator.java
index c70264a549..a1ec71f1a1 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelMergeOperator.java
@@ -85,7 +85,7 @@ public class CountGroupByLevelMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -146,12 +146,12 @@ public class CountGroupByLevelMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return resultTsBlockList == null || currentIndex < resultTsBlockList.size();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelScanOperator.java
index 0e3746e7b3..f852492778 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountGroupByLevelScanOperator.java
@@ -80,7 +80,7 @@ public class CountGroupByLevelScanOperator<T extends ISchemaInfo> implements Sou
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -88,7 +88,7 @@ public class CountGroupByLevelScanOperator<T extends ISchemaInfo> implements Sou
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (schemaReader == null) {
       schemaReader = createTimeSeriesReader();
     }
@@ -140,7 +140,7 @@ public class CountGroupByLevelScanOperator<T extends ISchemaInfo> implements Sou
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountMergeOperator.java
index 5042ab3460..ba62cb6d01 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/CountMergeOperator.java
@@ -76,10 +76,11 @@ public class CountMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
+
     if (resultTsBlockList != null) {
       currentIndex++;
       return resultTsBlockList.get(currentIndex - 1);
@@ -122,12 +123,12 @@ public class CountMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return resultTsBlockList == null || currentIndex < resultTsBlockList.size();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodeManageMemoryMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodeManageMemoryMergeOperator.java
index d9315fcdbc..f5331f8c57 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodeManageMemoryMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodeManageMemoryMergeOperator.java
@@ -74,7 +74,7 @@ public class NodeManageMemoryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (isReadingMemory) {
       isReadingMemory = false;
       return transferToTsBlock(data);
@@ -125,7 +125,7 @@ public class NodeManageMemoryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return isReadingMemory || child.hasNextWithTimer();
   }
 
@@ -135,7 +135,7 @@ public class NodeManageMemoryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !isReadingMemory && child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsConvertOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsConvertOperator.java
index 4d04a62e86..10b1d2bf30 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsConvertOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsConvertOperator.java
@@ -69,7 +69,7 @@ public class NodePathsConvertOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock block = child.nextWithTimer();
     if (block == null || block.isEmpty()) {
       return null;
@@ -94,7 +94,7 @@ public class NodePathsConvertOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return child.hasNextWithTimer();
   }
 
@@ -104,7 +104,7 @@ public class NodePathsConvertOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return child.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsCountOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsCountOperator.java
index 3a662afe13..a68cc9b6b5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsCountOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/NodePathsCountOperator.java
@@ -64,7 +64,7 @@ public class NodePathsCountOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     while (!child.isFinished()) {
       // read as much child result as possible
       ListenableFuture<?> blocked = child.isBlocked();
@@ -91,7 +91,7 @@ public class NodePathsCountOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !child.isFinished() || !isFinished;
   }
 
@@ -106,7 +106,7 @@ public class NodePathsCountOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return isFinished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperator.java
index 5e313e9fea..d91caee311 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperator.java
@@ -69,7 +69,7 @@ public class SchemaCountOperator<T extends ISchemaInfo> implements SourceOperato
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -94,12 +94,12 @@ public class SchemaCountOperator<T extends ISchemaInfo> implements SourceOperato
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !isFinished;
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return isFinished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchMergeOperator.java
index 977cd388df..6be4893d4c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchMergeOperator.java
@@ -66,7 +66,7 @@ public class SchemaFetchMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (isReadingStorageGroupInfo) {
       isReadingStorageGroupInfo = false;
       return generateStorageGroupInfo();
@@ -81,7 +81,7 @@ public class SchemaFetchMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return isReadingStorageGroupInfo || currentIndex < childrenCount;
   }
 
@@ -93,7 +93,7 @@ public class SchemaFetchMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchScanOperator.java
index 0f406e1385..79ee0c381e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaFetchScanOperator.java
@@ -81,7 +81,7 @@ public class SchemaFetchScanOperator implements SourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -95,12 +95,12 @@ public class SchemaFetchScanOperator implements SourceOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !isFinished;
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return isFinished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryMergeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryMergeOperator.java
index 0ad36268a5..58ce3b2d2f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryMergeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryMergeOperator.java
@@ -50,7 +50,7 @@ public class SchemaQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (children.get(currentIndex).hasNextWithTimer()) {
       return children.get(currentIndex).nextWithTimer();
     } else {
@@ -60,7 +60,7 @@ public class SchemaQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return currentIndex < children.size();
   }
 
@@ -70,7 +70,7 @@ public class SchemaQueryMergeOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryOrderByHeatOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryOrderByHeatOperator.java
index 5fc7a1b681..64ba3314e5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryOrderByHeatOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryOrderByHeatOperator.java
@@ -70,7 +70,7 @@ public class SchemaQueryOrderByHeatOperator implements ProcessOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -187,7 +187,7 @@ public class SchemaQueryOrderByHeatOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return resultTsBlockList == null || currentIndex < resultTsBlockList.size();
   }
 
@@ -199,7 +199,7 @@ public class SchemaQueryOrderByHeatOperator implements ProcessOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperator.java
index ee27182135..2c261dbb2b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperator.java
@@ -126,7 +126,7 @@ public class SchemaQueryScanOperator<T extends ISchemaInfo> implements SourceOpe
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (!hasNext()) {
       throw new NoSuchElementException();
     }
@@ -146,7 +146,7 @@ public class SchemaQueryScanOperator<T extends ISchemaInfo> implements SourceOpe
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (schemaReader == null) {
       schemaReader = createSchemaReader();
     }
@@ -154,7 +154,7 @@ public class SchemaQueryScanOperator<T extends ISchemaInfo> implements SourceOpe
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
index 01ecb7f71b..e4b44508d5 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/IdentitySinkOperator.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.db.mpp.execution.operator.OperatorContext;
 import org.apache.iotdb.tsfile.read.common.block.TsBlock;
 
 import com.google.common.util.concurrent.ListenableFuture;
+import org.apache.commons.lang3.Validate;
 
 import java.util.List;
 
@@ -54,13 +55,22 @@ public class IdentitySinkOperator implements Operator {
   }
 
   @Override
-  public boolean hasNext() {
-    if (children.get(downStreamChannelIndex.getCurrentIndex()).hasNext()) {
+  public boolean hasNext() throws Exception {
+    int currentIndex = downStreamChannelIndex.getCurrentIndex();
+    boolean currentChannelClosed = sinkHandle.isChannelClosed(currentIndex);
+    if (!currentChannelClosed && children.get(currentIndex).hasNext()) {
       return true;
+    } else if (currentChannelClosed) {
+      // we close the child directly. The child could be an ExchangeOperator which is the downstream
+      // of an ISinkChannel of a pipeline driver.
+      closeCurrentChild(currentIndex);
+    } else {
+      // current child has no more data
+      closeCurrentChild(currentIndex);
+      sinkHandle.setNoMoreTsBlocksOfOneChannel(downStreamChannelIndex.getCurrentIndex());
     }
-    int currentIndex = downStreamChannelIndex.getCurrentIndex();
-    // current channel have no more data
-    sinkHandle.setNoMoreTsBlocksOfOneChannel(downStreamChannelIndex.getCurrentIndex());
+
+    // increment the index
     currentIndex++;
     if (currentIndex >= children.size()) {
       isFinished = true;
@@ -76,8 +86,13 @@ public class IdentitySinkOperator implements Operator {
     return true;
   }
 
+  private void closeCurrentChild(int index) throws Exception {
+    children.get(index).close();
+    children.set(index, null);
+  }
+
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (needToReturnNull) {
       needToReturnNull = false;
       return null;
@@ -91,7 +106,7 @@ public class IdentitySinkOperator implements Operator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return isFinished;
   }
 
@@ -102,8 +117,9 @@ public class IdentitySinkOperator implements Operator {
 
   @Override
   public void close() throws Exception {
-    for (Operator child : children) {
-      child.close();
+    for (int i = downStreamChannelIndex.getCurrentIndex(), n = children.size(); i < n; i++) {
+      Validate.notNull(children.get(i));
+      children.get(i).close();
     }
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/ShuffleHelperOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/ShuffleHelperOperator.java
index 2e7863eb0f..1a8790b661 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/ShuffleHelperOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/sink/ShuffleHelperOperator.java
@@ -59,13 +59,20 @@ public class ShuffleHelperOperator implements Operator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     int currentIndex = downStreamChannelIndex.getCurrentIndex();
-    if (children.get(currentIndex).hasNext()) {
+    boolean currentChannelClosed = sinkHandle.isChannelClosed(currentIndex);
+    if (!currentChannelClosed && children.get(currentIndex).hasNext()) {
       return true;
+    } else if (currentChannelClosed) {
+      // we close the child directly. The child could be an ExchangeOperator which is the downstream
+      // of an ISinkChannel of a pipeline driver.
+      closeCurrentChild(currentIndex);
+    } else {
+      // current channel has no more data
+      closeCurrentChild(currentIndex);
+      sinkHandle.setNoMoreTsBlocksOfOneChannel(currentIndex);
     }
-    // current channel have no more data
-    sinkHandle.setNoMoreTsBlocksOfOneChannel(currentIndex);
     unfinishedChildren.remove(currentIndex);
     currentIndex = (currentIndex + 1) % children.size();
     downStreamChannelIndex.setCurrentIndex(currentIndex);
@@ -78,8 +85,13 @@ public class ShuffleHelperOperator implements Operator {
     return true;
   }
 
+  private void closeCurrentChild(int index) throws Exception {
+    children.get(index).close();
+    children.set(index, null);
+  }
+
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (needToReturnNull) {
       needToReturnNull = false;
       return null;
@@ -89,11 +101,20 @@ public class ShuffleHelperOperator implements Operator {
 
   @Override
   public ListenableFuture<?> isBlocked() {
-    return children.get(downStreamChannelIndex.getCurrentIndex()).isBlocked();
+    int steps = 0;
+    int currentIndex = downStreamChannelIndex.getCurrentIndex();
+    // skip closed children
+    while (children.get(currentIndex) == null && steps < children.size()) {
+      currentIndex = (currentIndex + 1) % children.size();
+      steps++;
+    }
+    downStreamChannelIndex.setCurrentIndex(currentIndex);
+    Operator child = children.get(currentIndex);
+    return child == null ? NOT_BLOCKED : child.isBlocked();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return unfinishedChildren.isEmpty();
   }
 
@@ -105,7 +126,9 @@ public class ShuffleHelperOperator implements Operator {
   @Override
   public void close() throws Exception {
     for (Operator child : children) {
-      child.close();
+      if (child != null) {
+        child.close();
+      }
     }
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
index afb2957f93..67b42a4319 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AbstractSeriesAggregationScanOperator.java
@@ -113,12 +113,12 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return timeRangeIterator.hasNextTimeRange();
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     // start stopwatch
     long maxRuntime = operatorContext.getMaxRunTime().roundTo(TimeUnit.NANOSECONDS);
     long start = System.nanoTime();
@@ -148,7 +148,7 @@ public abstract class AbstractSeriesAggregationScanOperator extends AbstractData
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return finished || (finished = !hasNextWithTimer());
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AlignedSeriesScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AlignedSeriesScanOperator.java
index 47830d42ed..ebc407ea97 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AlignedSeriesScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/AlignedSeriesScanOperator.java
@@ -62,7 +62,7 @@ public class AlignedSeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (retainedTsBlock != null) {
       return getResultFromRetainedTsBlock();
     }
@@ -72,7 +72,7 @@ public class AlignedSeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (retainedTsBlock != null) {
       return true;
     }
@@ -117,7 +117,7 @@ public class AlignedSeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return finished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ExchangeOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ExchangeOperator.java
index 8699c3e135..27ef9a3022 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ExchangeOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ExchangeOperator.java
@@ -69,17 +69,17 @@ public class ExchangeOperator implements SourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     return sourceHandle.receive();
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return !sourceHandle.isFinished();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return sourceHandle.isFinished();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/LastCacheScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/LastCacheScanOperator.java
index 6c5185fbf2..eb975d3469 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/LastCacheScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/LastCacheScanOperator.java
@@ -41,19 +41,19 @@ public class LastCacheScanOperator implements SourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock res = tsBlock;
     tsBlock = null;
     return res;
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     return tsBlock != null && !tsBlock.isEmpty();
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return !hasNextWithTimer();
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/SeriesScanOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/SeriesScanOperator.java
index 4032dea5e2..2a315920f2 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/SeriesScanOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/SeriesScanOperator.java
@@ -129,7 +129,7 @@ public class SeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     if (retainedTsBlock != null) {
       return getResultFromRetainedTsBlock();
     }
@@ -139,7 +139,7 @@ public class SeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (retainedTsBlock != null) {
       return true;
     }
@@ -184,7 +184,7 @@ public class SeriesScanOperator extends AbstractDataSourceOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return finished;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ShowQueriesOperator.java b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ShowQueriesOperator.java
index 0a9c86d0c2..ef930f8400 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ShowQueriesOperator.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/execution/operator/source/ShowQueriesOperator.java
@@ -60,7 +60,7 @@ public class ShowQueriesOperator implements SourceOperator {
   }
 
   @Override
-  public TsBlock next() {
+  public TsBlock next() throws Exception {
     TsBlock res = tsBlock;
     hasConsumed = true;
     tsBlock = null;
@@ -68,7 +68,7 @@ public class ShowQueriesOperator implements SourceOperator {
   }
 
   @Override
-  public boolean hasNext() {
+  public boolean hasNext() throws Exception {
     if (hasConsumed) {
       return false;
     }
@@ -79,7 +79,7 @@ public class ShowQueriesOperator implements SourceOperator {
   }
 
   @Override
-  public boolean isFinished() {
+  public boolean isFinished() throws Exception {
     return hasConsumed;
   }
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/api/YieldableReader.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/api/YieldableReader.java
index 263254a5f3..f61dd44114 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/api/YieldableReader.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/api/YieldableReader.java
@@ -19,11 +19,7 @@
 
 package org.apache.iotdb.db.mpp.transformation.api;
 
-import org.apache.iotdb.db.exception.query.QueryProcessException;
-
-import java.io.IOException;
-
 public interface YieldableReader {
 
-  YieldableState yield() throws IOException, QueryProcessException;
+  YieldableState yield() throws Exception;
 }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/IUDFInputDataSet.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/IUDFInputDataSet.java
index 4f640e384c..db1272cffd 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/IUDFInputDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/IUDFInputDataSet.java
@@ -35,7 +35,7 @@ public interface IUDFInputDataSet {
   boolean hasNextRowInObjects() throws IOException;
 
   /** Whether the data set has next row. */
-  default YieldableState canYieldNextRowInObjects() throws IOException {
+  default YieldableState canYieldNextRowInObjects() throws Exception {
     return hasNextRowInObjects()
         ? YieldableState.YIELDABLE
         : YieldableState.NOT_YIELDABLE_NO_MORE_DATA;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/QueryDataSetInputLayer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/QueryDataSetInputLayer.java
index 1aadf50b09..7825b2f423 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/QueryDataSetInputLayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/QueryDataSetInputLayer.java
@@ -113,7 +113,7 @@ public class QueryDataSetInputLayer {
     }
 
     @Override
-    public YieldableState yield() throws IOException, QueryProcessException {
+    public YieldableState yield() throws Exception {
       if (hasCachedRowRecord) {
         return YieldableState.YIELDABLE;
       }
@@ -231,7 +231,7 @@ public class QueryDataSetInputLayer {
   private class TimePointReader extends AbstractLayerPointReader {
 
     @Override
-    public YieldableState yield() throws IOException, QueryProcessException {
+    public YieldableState yield() throws Exception {
       if (hasCachedRowRecord) {
         return YieldableState.YIELDABLE;
       }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/TsBlockInputDataSet.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/TsBlockInputDataSet.java
index 8f6629aba3..9bb3593441 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/TsBlockInputDataSet.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/input/TsBlockInputDataSet.java
@@ -50,7 +50,7 @@ public class TsBlockInputDataSet implements IUDFInputDataSet {
   }
 
   @Override
-  public YieldableState canYieldNextRowInObjects() {
+  public YieldableState canYieldNextRowInObjects() throws Exception {
     if (tsBlockRowIterator == null) {
       if (operator.isBlocked() != Operator.NOT_BLOCKED) {
         return YieldableState.NOT_YIELDABLE_WAITING_FOR_DATA;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java
index b2c9c731f0..9c16557c5e 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/MultiInputColumnIntermediateLayer.java
@@ -165,7 +165,7 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer
   }
 
   @Override
-  public YieldableState canYieldNextRowInObjects() throws IOException {
+  public YieldableState canYieldNextRowInObjects() throws Exception {
     if (cachedRow != null) {
       return YieldableState.YIELDABLE;
     }
@@ -301,7 +301,7 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer
       private boolean currentNull = false;
 
       @Override
-      public YieldableState yield() throws IOException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -384,7 +384,7 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer
       private int beginIndex = -slidingStep;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -517,7 +517,7 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer
       private int nextIndexBegin = 0;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (rowRecordList.size() == 0 && nextWindowTimeBegin == Long.MIN_VALUE) {
             final YieldableState yieldableState =
@@ -694,7 +694,7 @@ public class MultiInputColumnIntermediateLayer extends IntermediateLayer
       private int nextIndexEnd = 1;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (rowRecordList.size() == 0) {
             final YieldableState yieldableState =
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnMultiReferenceIntermediateLayer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnMultiReferenceIntermediateLayer.java
index 165a079120..38e474aaba 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnMultiReferenceIntermediateLayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnMultiReferenceIntermediateLayer.java
@@ -90,7 +90,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       }
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -192,7 +192,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       private int currentRowIndex = -1;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -273,7 +273,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       private int beginIndex = -slidingStep;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -402,7 +402,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       private boolean hasAtLeastOneRow;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
@@ -583,7 +583,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       private int nextIndexEnd = 1;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
@@ -701,7 +701,7 @@ public class SingleInputColumnMultiReferenceIntermediateLayer extends Intermedia
       private ValueRecorder valueRecorder = new ValueRecorder();
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnSingleReferenceIntermediateLayer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnSingleReferenceIntermediateLayer.java
index d6bd270c41..0ff38822d9 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnSingleReferenceIntermediateLayer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/intermediate/SingleInputColumnSingleReferenceIntermediateLayer.java
@@ -78,7 +78,7 @@ public class SingleInputColumnSingleReferenceIntermediateLayer extends Intermedi
       private boolean isCurrentNull = false;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (!hasCached) {
           final YieldableState yieldableState = parentLayerPointReader.yield();
           if (yieldableState == YieldableState.NOT_YIELDABLE_WAITING_FOR_DATA) {
@@ -151,7 +151,7 @@ public class SingleInputColumnSingleReferenceIntermediateLayer extends Intermedi
       private int beginIndex = -slidingStep;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (hasCached) {
           return YieldableState.YIELDABLE;
         }
@@ -277,7 +277,7 @@ public class SingleInputColumnSingleReferenceIntermediateLayer extends Intermedi
       private int nextIndexBegin = 0;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
@@ -457,7 +457,7 @@ public class SingleInputColumnSingleReferenceIntermediateLayer extends Intermedi
       private int nextIndexEnd = 1;
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
@@ -575,7 +575,7 @@ public class SingleInputColumnSingleReferenceIntermediateLayer extends Intermedi
       private ValueRecorder valueRecorder = new ValueRecorder();
 
       @Override
-      public YieldableState yield() throws IOException, QueryProcessException {
+      public YieldableState yield() throws Exception {
         if (isFirstIteration) {
           if (tvList.size() == 0) {
             final YieldableState yieldableState =
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/Transformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/Transformer.java
index 28fb5f9cae..d99a5c8404 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/Transformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/Transformer.java
@@ -56,7 +56,7 @@ public abstract class Transformer implements LayerPointReader {
   protected abstract boolean cacheValue() throws QueryProcessException, IOException;
 
   @Override
-  public final YieldableState yield() throws IOException, QueryProcessException {
+  public final YieldableState yield() throws Exception {
     if (hasCachedValue) {
       return YieldableState.YIELDABLE;
     }
@@ -71,7 +71,7 @@ public abstract class Transformer implements LayerPointReader {
   /**
    * if this method returns YieldableState.YIELDABLE, at least one of the cached field should be set
    */
-  protected abstract YieldableState yieldValue() throws QueryProcessException, IOException;
+  protected abstract YieldableState yieldValue() throws Exception;
 
   @Override
   public final void readyForNext() {
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/BinaryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/BinaryTransformer.java
index 761c78fcc7..fbfaad56bc 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/BinaryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/BinaryTransformer.java
@@ -59,7 +59,7 @@ public abstract class BinaryTransformer extends Transformer {
   }
 
   @Override
-  public YieldableState yieldValue() throws IOException, QueryProcessException {
+  public YieldableState yieldValue() throws Exception {
     final YieldableState leftYieldableState = leftPointReader.yield();
     final YieldableState rightYieldableState = rightPointReader.yield();
 
@@ -89,7 +89,7 @@ public abstract class BinaryTransformer extends Transformer {
     return YieldableState.YIELDABLE;
   }
 
-  private YieldableState yieldTime() throws IOException, QueryProcessException {
+  private YieldableState yieldTime() throws Exception {
     if (isCurrentConstant) {
       return YieldableState.YIELDABLE;
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/LogicBinaryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/LogicBinaryTransformer.java
index 6440e39585..839f729cf4 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/LogicBinaryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/binary/LogicBinaryTransformer.java
@@ -43,7 +43,7 @@ public abstract class LogicBinaryTransformer extends BinaryTransformer {
   }
 
   @Override
-  public YieldableState yieldValue() throws QueryProcessException, IOException {
+  public YieldableState yieldValue() throws Exception {
     final YieldableState leftYieldableState = leftPointReader.yield();
     final YieldableState rightYieldableState = rightPointReader.yield();
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/MappableUDFQueryRowTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/MappableUDFQueryRowTransformer.java
index c783d32294..7be1849b9b 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/MappableUDFQueryRowTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/MappableUDFQueryRowTransformer.java
@@ -63,7 +63,7 @@ public class MappableUDFQueryRowTransformer extends UDFQueryTransformer {
   }
 
   @Override
-  protected YieldableState yieldValue() throws QueryProcessException, IOException {
+  protected YieldableState yieldValue() throws Exception {
     final YieldableState yieldableState = layerRowReader.yield();
     if (!YieldableState.YIELDABLE.equals(yieldableState)) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowTransformer.java
index 9128d9a1c6..4fc9953d28 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowTransformer.java
@@ -36,7 +36,7 @@ public class UDFQueryRowTransformer extends UniversalUDFQueryTransformer {
   }
 
   @Override
-  protected YieldableState tryExecuteUDFOnce() throws QueryProcessException, IOException {
+  protected YieldableState tryExecuteUDFOnce() throws Exception {
     final YieldableState yieldableState = layerRowReader.yield();
     if (yieldableState != YieldableState.YIELDABLE) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowWindowTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowWindowTransformer.java
index 9776390953..fb045b710f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowWindowTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UDFQueryRowWindowTransformer.java
@@ -37,7 +37,7 @@ public class UDFQueryRowWindowTransformer extends UniversalUDFQueryTransformer {
   }
 
   @Override
-  protected YieldableState tryExecuteUDFOnce() throws QueryProcessException, IOException {
+  protected YieldableState tryExecuteUDFOnce() throws Exception {
     final YieldableState yieldableState = layerRowWindowReader.yield();
     if (yieldableState != YieldableState.YIELDABLE) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
index d19f0d2740..4e60a3e4b7 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/multi/UniversalUDFQueryTransformer.java
@@ -39,7 +39,7 @@ public abstract class UniversalUDFQueryTransformer extends UDFQueryTransformer {
   }
 
   @Override
-  protected final YieldableState yieldValue() throws QueryProcessException, IOException {
+  protected final YieldableState yieldValue() throws Exception {
     while (!cacheValueFromUDFOutput()) {
       final YieldableState udfYieldableState = tryExecuteUDFOnce();
       if (udfYieldableState == YieldableState.NOT_YIELDABLE_WAITING_FOR_DATA) {
@@ -62,7 +62,7 @@ public abstract class UniversalUDFQueryTransformer extends UDFQueryTransformer {
     return true;
   }
 
-  protected abstract YieldableState tryExecuteUDFOnce() throws QueryProcessException, IOException;
+  protected abstract YieldableState tryExecuteUDFOnce() throws Exception;
 
   protected abstract boolean executeUDFOnce() throws QueryProcessException, IOException;
 
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/ternary/TernaryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/ternary/TernaryTransformer.java
index 1e72272cfc..07c7d6911f 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/ternary/TernaryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/ternary/TernaryTransformer.java
@@ -45,7 +45,7 @@ public abstract class TernaryTransformer extends Transformer {
   protected final boolean isCurrentConstant;
 
   @Override
-  protected YieldableState yieldValue() throws QueryProcessException, IOException {
+  protected YieldableState yieldValue() throws Exception {
     final YieldableState firstYieldableState = firstPointReader.yield();
     final YieldableState secondYieldableState = secondPointReader.yield();
     final YieldableState thirdYieldableState = thirdPointReader.yield();
@@ -81,7 +81,7 @@ public abstract class TernaryTransformer extends Transformer {
     return YieldableState.YIELDABLE;
   }
 
-  private YieldableState yieldTime() throws IOException, QueryProcessException {
+  private YieldableState yieldTime() throws Exception {
     if (isCurrentConstant) {
       return YieldableState.YIELDABLE;
     }
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/DiffFunctionTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/DiffFunctionTransformer.java
index 8ed9b02c9d..4dca6ad271 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/DiffFunctionTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/DiffFunctionTransformer.java
@@ -46,7 +46,7 @@ public class DiffFunctionTransformer extends UnaryTransformer {
   }
 
   @Override
-  public final YieldableState yieldValue() throws IOException, QueryProcessException {
+  public final YieldableState yieldValue() throws Exception {
     final YieldableState yieldableState = layerPointReader.yield();
     if (!YieldableState.YIELDABLE.equals(yieldableState)) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/IsNullTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/IsNullTransformer.java
index f772276566..56281a315c 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/IsNullTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/IsNullTransformer.java
@@ -40,7 +40,7 @@ public class IsNullTransformer extends UnaryTransformer {
   }
 
   @Override
-  public final YieldableState yieldValue() throws IOException, QueryProcessException {
+  public final YieldableState yieldValue() throws Exception {
     final YieldableState yieldableState = layerPointReader.yield();
     if (!YieldableState.YIELDABLE.equals(yieldableState)) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/UnaryTransformer.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/UnaryTransformer.java
index 65d6a52776..72079689cb 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/UnaryTransformer.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/transformer/unary/UnaryTransformer.java
@@ -45,7 +45,7 @@ public abstract class UnaryTransformer extends Transformer {
   }
 
   @Override
-  public YieldableState yieldValue() throws IOException, QueryProcessException {
+  public YieldableState yieldValue() throws Exception {
     final YieldableState yieldableState = layerPointReader.yield();
     if (!YieldableState.YIELDABLE.equals(yieldableState)) {
       return yieldableState;
diff --git a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/util/LayerCacheUtils.java b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/util/LayerCacheUtils.java
index 791628ec7b..2725af36a7 100644
--- a/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/util/LayerCacheUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/mpp/transformation/dag/util/LayerCacheUtils.java
@@ -39,7 +39,7 @@ public class LayerCacheUtils {
       LayerPointReader source,
       ElasticSerializableTVList target,
       int pointNumber)
-      throws QueryProcessException, IOException {
+      throws Exception {
     int count = 0;
     while (count < pointNumber) {
       final YieldableState yieldableState = yieldPoint(dataType, source, target);
@@ -53,7 +53,7 @@ public class LayerCacheUtils {
 
   public static YieldableState yieldPoint(
       TSDataType dataType, LayerPointReader source, ElasticSerializableTVList target)
-      throws IOException, QueryProcessException {
+      throws Exception {
     final YieldableState yieldableState = source.yield();
     if (yieldableState != YieldableState.YIELDABLE) {
       return yieldableState;
@@ -96,7 +96,7 @@ public class LayerCacheUtils {
   /** @return number of actually collected, which may be less than or equals to rowsNumber */
   public static YieldableState yieldRows(
       IUDFInputDataSet source, ElasticSerializableRowRecordList target, int rowsNumber)
-      throws QueryProcessException, IOException {
+      throws Exception {
     int count = 0;
     while (count < rowsNumber) {
       final YieldableState yieldableState = yieldRow(source, target);
@@ -109,9 +109,9 @@ public class LayerCacheUtils {
   }
 
   public static YieldableState yieldRow(
-      IUDFInputDataSet source, ElasticSerializableRowRecordList target)
-      throws IOException, QueryProcessException {
+      IUDFInputDataSet source, ElasticSerializableRowRecordList target) throws Exception {
     final YieldableState yieldableState = source.canYieldNextRowInObjects();
+
     if (yieldableState == YieldableState.YIELDABLE) {
       target.put(source.nextRowInObjects());
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/StubSink.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/StubSink.java
index 2ccc9bf8ee..7b28462fe6 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/StubSink.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/exchange/StubSink.java
@@ -73,6 +73,11 @@ public class StubSink implements ISink {
     instanceContext.transitionToFlushing();
   }
 
+  @Override
+  public boolean isClosed() {
+    return closed;
+  }
+
   @Override
   public boolean isAborted() {
     return closed;
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AggregationOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AggregationOperatorTest.java
index ca119a07ee..0147d33c3a 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AggregationOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AggregationOperatorTest.java
@@ -59,7 +59,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 
@@ -97,8 +96,7 @@ public class AggregationOperatorTest {
 
   /** Try to aggregate unary intermediate result of one time series without group by interval. */
   @Test
-  public void testAggregateIntermediateResult1()
-      throws IllegalPathException, ExecutionException, InterruptedException {
+  public void testAggregateIntermediateResult1() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.COUNT);
     aggregationTypes.add(TAggregationType.SUM);
@@ -122,7 +120,9 @@ public class AggregationOperatorTest {
       if (!aggregationOperator.hasNext()) {
         break;
       }
-      TsBlock resultTsBlock = aggregationOperator.next();
+      TsBlock resultTsBlock = null;
+      resultTsBlock = aggregationOperator.next();
+
       if (resultTsBlock == null) {
         continue;
       }
@@ -139,8 +139,7 @@ public class AggregationOperatorTest {
 
   /** Try to aggregate binary intermediate result of one time series without group by interval. */
   @Test
-  public void testAggregateIntermediateResult2()
-      throws IllegalPathException, ExecutionException, InterruptedException {
+  public void testAggregateIntermediateResult2() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.AVG);
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
@@ -163,7 +162,8 @@ public class AggregationOperatorTest {
       if (!aggregationOperator.hasNext()) {
         break;
       }
-      TsBlock resultTsBlock = aggregationOperator.next();
+      TsBlock resultTsBlock = null;
+      resultTsBlock = aggregationOperator.next();
       if (resultTsBlock == null) {
         continue;
       }
@@ -176,8 +176,7 @@ public class AggregationOperatorTest {
   }
 
   @Test
-  public void testGroupByIntermediateResult1()
-      throws IllegalPathException, ExecutionException, InterruptedException {
+  public void testGroupByIntermediateResult1() throws Exception {
     int[][] result =
         new int[][] {
           {100, 100, 100, 99},
@@ -211,7 +210,8 @@ public class AggregationOperatorTest {
       if (!aggregationOperator.hasNext()) {
         break;
       }
-      TsBlock resultTsBlock = aggregationOperator.next();
+      TsBlock resultTsBlock = null;
+      resultTsBlock = aggregationOperator.next();
       if (resultTsBlock == null) {
         continue;
       }
@@ -231,8 +231,7 @@ public class AggregationOperatorTest {
   }
 
   @Test
-  public void testGroupByIntermediateResult2()
-      throws IllegalPathException, ExecutionException, InterruptedException {
+  public void testGroupByIntermediateResult2() throws Exception {
     double[][] result =
         new double[][] {
           {20049.5, 20149.5, 6249.5, 8429.808},
@@ -262,7 +261,8 @@ public class AggregationOperatorTest {
       if (!aggregationOperator.hasNext()) {
         break;
       }
-      TsBlock resultTsBlock = aggregationOperator.next();
+      TsBlock resultTsBlock = null;
+      resultTsBlock = aggregationOperator.next();
       if (resultTsBlock == null) {
         continue;
       }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesAggregationScanOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
index 6d45de1d7f..f5d7e9a003 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesAggregationScanOperatorTest.java
@@ -95,7 +95,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testAggregationWithoutTimeFilter() throws IllegalPathException {
+  public void testAggregationWithoutTimeFilter() throws Exception {
     List<Aggregator> aggregators = new ArrayList<>();
     for (int i = 0; i < measurementSchemas.size(); i++) {
       TSDataType dataType = measurementSchemas.get(i).getType();
@@ -126,7 +126,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testAggregationWithoutTimeFilterOrderByTimeDesc() throws IllegalPathException {
+  public void testAggregationWithoutTimeFilterOrderByTimeDesc() throws Exception {
     List<Aggregator> aggregators = new ArrayList<>();
     for (int i = 0; i < measurementSchemas.size(); i++) {
       TSDataType dataType = measurementSchemas.get(i).getType();
@@ -153,11 +153,12 @@ public class AlignedSeriesAggregationScanOperatorTest {
       }
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilter1() throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilter1() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.COUNT);
     aggregationTypes.add(TAggregationType.SUM);
@@ -190,7 +191,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilter2() throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilter2() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -231,8 +232,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilterOrderByTimeDesc()
-      throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilterOrderByTimeDesc() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -273,7 +273,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testAggregationWithTimeFilter1() throws IllegalPathException {
+  public void testAggregationWithTimeFilter1() throws Exception {
     List<Aggregator> aggregators = new ArrayList<>();
     for (int i = 0; i < measurementSchemas.size(); i++) {
       TSDataType dataType = measurementSchemas.get(i).getType();
@@ -301,11 +301,12 @@ public class AlignedSeriesAggregationScanOperatorTest {
       }
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithTimeFilter2() throws IllegalPathException {
+  public void testAggregationWithTimeFilter2() throws Exception {
     Filter timeFilter = TimeFilter.ltEq(379);
     List<Aggregator> aggregators = new ArrayList<>();
     for (int i = 0; i < measurementSchemas.size(); i++) {
@@ -333,11 +334,12 @@ public class AlignedSeriesAggregationScanOperatorTest {
       }
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithTimeFilter3() throws IllegalPathException {
+  public void testAggregationWithTimeFilter3() throws Exception {
     Filter timeFilter = new AndFilter(TimeFilter.gtEq(100), TimeFilter.ltEq(399));
     List<Aggregator> aggregators = new ArrayList<>();
     for (int i = 0; i < measurementSchemas.size(); i++) {
@@ -369,7 +371,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testMultiAggregationWithTimeFilter() throws IllegalPathException {
+  public void testMultiAggregationWithTimeFilter() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -407,11 +409,12 @@ public class AlignedSeriesAggregationScanOperatorTest {
       assertEquals(399, resultTsBlock.getColumn(5).getLong(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testGroupByWithoutGlobalTimeFilter() throws IllegalPathException {
+  public void testGroupByWithoutGlobalTimeFilter() throws Exception {
     int[] result = new int[] {100, 100, 100, 99};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 100, true);
     List<Aggregator> aggregators = new ArrayList<>();
@@ -444,11 +447,12 @@ public class AlignedSeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(4, count);
   }
 
   @Test
-  public void testGroupByWithGlobalTimeFilter() throws IllegalPathException {
+  public void testGroupByWithGlobalTimeFilter() throws Exception {
     int[] result = new int[] {0, 80, 100, 80};
     Filter timeFilter = new AndFilter(TimeFilter.gtEq(120), TimeFilter.ltEq(379));
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 100, true);
@@ -487,7 +491,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testGroupByWithMultiFunction() throws IllegalPathException {
+  public void testGroupByWithMultiFunction() throws Exception {
     int[][] result =
         new int[][] {
           {20000, 20100, 10200, 10300},
@@ -530,7 +534,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testGroupByWithMultiFunctionOrderByTimeDesc() throws IllegalPathException {
+  public void testGroupByWithMultiFunctionOrderByTimeDesc() throws Exception {
     int[][] result =
         new int[][] {
           {20000, 20100, 10200, 10300},
@@ -573,7 +577,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testGroupBySlidingTimeWindow() throws IllegalPathException {
+  public void testGroupBySlidingTimeWindow() throws Exception {
     int[] result = new int[] {50, 50, 50, 50, 50, 50, 50, 49};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 50, true);
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
@@ -603,7 +607,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testGroupBySlidingTimeWindow2() throws IllegalPathException {
+  public void testGroupBySlidingTimeWindow2() throws Exception {
     int[] timeColumn = new int[] {0, 20, 30, 50, 60, 80, 90, 110, 120, 140};
     int[] result = new int[] {20, 10, 20, 10, 20, 10, 20, 10, 20, 9};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 149, 50, 30, true);
@@ -634,7 +638,7 @@ public class AlignedSeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testGroupBySlidingWindowWithMultiFunction() throws IllegalPathException {
+  public void testGroupBySlidingWindowWithMultiFunction() throws Exception {
     int[] timeColumn = new int[] {0, 20, 30, 50, 60, 80, 90, 110, 120, 140};
     int[][] result =
         new int[][] {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesScanOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesScanOperatorTest.java
index 894ef7c8c3..5366412433 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesScanOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/AlignedSeriesScanOperatorTest.java
@@ -96,7 +96,7 @@ public class AlignedSeriesScanOperatorTest {
   }
 
   @Test
-  public void batchTest1() {
+  public void batchTest1() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -173,7 +173,7 @@ public class AlignedSeriesScanOperatorTest {
   }
 
   @Test
-  public void batchTest2() {
+  public void batchTest2() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -462,7 +462,7 @@ public class AlignedSeriesScanOperatorTest {
 
   /** order by time desc */
   @Test
-  public void batchTest3() {
+  public void batchTest3() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceMergeOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceMergeOperatorTest.java
deleted file mode 100644
index 9960a40286..0000000000
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceMergeOperatorTest.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * 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.
- */
-
-package org.apache.iotdb.db.mpp.execution.operator;
-
-import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.exception.IllegalPathException;
-import org.apache.iotdb.commons.exception.MetadataException;
-import org.apache.iotdb.commons.path.MeasurementPath;
-import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
-import org.apache.iotdb.db.engine.storagegroup.TsFileResource;
-import org.apache.iotdb.db.mpp.common.FragmentInstanceId;
-import org.apache.iotdb.db.mpp.common.PlanFragmentId;
-import org.apache.iotdb.db.mpp.common.QueryId;
-import org.apache.iotdb.db.mpp.execution.driver.DriverContext;
-import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceContext;
-import org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceStateMachine;
-import org.apache.iotdb.db.mpp.execution.operator.process.DeviceMergeOperator;
-import org.apache.iotdb.db.mpp.execution.operator.process.DeviceViewOperator;
-import org.apache.iotdb.db.mpp.execution.operator.process.join.merge.AscTimeComparator;
-import org.apache.iotdb.db.mpp.execution.operator.source.SeriesScanOperator;
-import org.apache.iotdb.db.mpp.plan.planner.plan.node.PlanNodeId;
-import org.apache.iotdb.db.mpp.plan.planner.plan.parameter.SeriesScanOptions;
-import org.apache.iotdb.db.mpp.plan.statement.component.Ordering;
-import org.apache.iotdb.db.query.reader.series.SeriesReaderTestUtil;
-import org.apache.iotdb.db.utils.datastructure.TimeSelector;
-import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
-import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
-import org.apache.iotdb.tsfile.read.common.block.TsBlock;
-import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
-
-import io.airlift.units.Duration;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import static org.apache.iotdb.db.mpp.execution.fragment.FragmentInstanceContext.createFragmentInstanceContext;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-public class DeviceMergeOperatorTest {
-
-  private static final String DEVICE_MERGE_OPERATOR_TEST_SG = "root.DeviceMergeOperatorTest";
-  private final List<String> deviceIds = new ArrayList<>();
-  private final List<MeasurementSchema> measurementSchemas = new ArrayList<>();
-
-  private final List<TsFileResource> seqResources = new ArrayList<>();
-  private final List<TsFileResource> unSeqResources = new ArrayList<>();
-
-  @Before
-  public void setUp() throws MetadataException, IOException, WriteProcessException {
-    SeriesReaderTestUtil.setUp(
-        measurementSchemas, deviceIds, seqResources, unSeqResources, DEVICE_MERGE_OPERATOR_TEST_SG);
-  }
-
-  @After
-  public void tearDown() throws IOException {
-    SeriesReaderTestUtil.tearDown(seqResources, unSeqResources);
-  }
-
-  /**
-   * Construct DeviceMergeOperator with different devices in two DeviceViewOperators.
-   *
-   * <p>DeviceViewOperator1: [seriesScanOperator: [device0.sensor0]],
-   *
-   * <p>DeviceViewOperator2: [seriesScanOperator: [device1.sensor1]]
-   *
-   * <p>the result tsBlock should be like [Device, sensor0, sensor1]. The sensor1 column of device0
-   * and the sensor0 column of device1 should be null.
-   */
-  @Test
-  public void deviceMergeOperatorTest() {
-    ExecutorService instanceNotificationExecutor =
-        IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
-    try {
-      // Construct operator tree
-      QueryId queryId = new QueryId("stub_query");
-      FragmentInstanceId instanceId =
-          new FragmentInstanceId(new PlanFragmentId(queryId, 0), "stub-instance");
-      FragmentInstanceStateMachine stateMachine =
-          new FragmentInstanceStateMachine(instanceId, instanceNotificationExecutor);
-      FragmentInstanceContext fragmentInstanceContext =
-          createFragmentInstanceContext(instanceId, stateMachine);
-      DriverContext driverContext = new DriverContext(fragmentInstanceContext, 0);
-      PlanNodeId planNodeId1 = new PlanNodeId("1");
-      driverContext.addOperatorContext(1, planNodeId1, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId2 = new PlanNodeId("2");
-      driverContext.addOperatorContext(2, planNodeId2, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId3 = new PlanNodeId("3");
-      driverContext.addOperatorContext(
-          3, planNodeId3, DeviceViewOperatorTest.class.getSimpleName());
-      PlanNodeId planNodeId4 = new PlanNodeId("4");
-      driverContext.addOperatorContext(
-          4, planNodeId4, DeviceViewOperatorTest.class.getSimpleName());
-      PlanNodeId planNodeId5 = new PlanNodeId("5");
-      driverContext.addOperatorContext(5, planNodeId5, DeviceMergeOperator.class.getSimpleName());
-
-      List<TSDataType> dataTypes = new ArrayList<>();
-      dataTypes.add(TSDataType.TEXT);
-      dataTypes.add(TSDataType.INT32);
-      dataTypes.add(TSDataType.INT32);
-      MeasurementPath measurementPath1 =
-          new MeasurementPath(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0.sensor0", TSDataType.INT32);
-
-      SeriesScanOptions.Builder scanOptionsBuilder = new SeriesScanOptions.Builder();
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor0"));
-      SeriesScanOperator seriesScanOperator1 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(0),
-              planNodeId1,
-              measurementPath1,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      seriesScanOperator1.initQueryDataSource(new QueryDataSource(seqResources, unSeqResources));
-      seriesScanOperator1
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      DeviceViewOperator deviceViewOperator1 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(2),
-              Collections.singletonList(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"),
-              Collections.singletonList(seriesScanOperator1),
-              Collections.singletonList(Collections.singletonList(1)),
-              dataTypes);
-
-      MeasurementPath measurementPath2 =
-          new MeasurementPath(DEVICE_MERGE_OPERATOR_TEST_SG + ".device1.sensor1", TSDataType.INT32);
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor1"));
-      SeriesScanOperator seriesScanOperator2 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(1),
-              planNodeId2,
-              measurementPath2,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      seriesScanOperator2.initQueryDataSource(new QueryDataSource(seqResources, unSeqResources));
-      seriesScanOperator2
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      DeviceViewOperator deviceViewOperator2 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(3),
-              Collections.singletonList(DEVICE_MERGE_OPERATOR_TEST_SG + ".device1"),
-              Collections.singletonList(seriesScanOperator2),
-              Collections.singletonList(Collections.singletonList(2)),
-              dataTypes);
-
-      List<String> devices = new ArrayList<>();
-      devices.add(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0");
-      devices.add(DEVICE_MERGE_OPERATOR_TEST_SG + ".device1");
-      List<Operator> deviceOperators = new ArrayList<>();
-      deviceOperators.add(deviceViewOperator1);
-      deviceOperators.add(deviceViewOperator2);
-      DeviceMergeOperator deviceMergeOperator =
-          new DeviceMergeOperator(
-              driverContext.getOperatorContexts().get(4),
-              devices,
-              deviceOperators,
-              dataTypes,
-              new TimeSelector(500, true),
-              new AscTimeComparator());
-
-      int count = 0;
-      while (deviceMergeOperator.hasNext()) {
-        TsBlock tsBlock = deviceMergeOperator.next();
-        if (tsBlock == null) {
-          continue;
-        }
-        assertEquals(3, tsBlock.getValueColumnCount());
-        for (int i = 0; i < tsBlock.getPositionCount(); i++, count++) {
-          long expectedTime = count % 500;
-          assertEquals(expectedTime, tsBlock.getTimeByIndex(i));
-          assertEquals(
-              count < 500
-                  ? DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"
-                  : DEVICE_MERGE_OPERATOR_TEST_SG + ".device1",
-              tsBlock.getColumn(0).getBinary(i).getStringValue());
-          if (expectedTime < 200) {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(20000 + expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(20000 + expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          } else if (expectedTime < 260
-              || (expectedTime >= 300 && expectedTime < 380)
-              || expectedTime >= 400) {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(10000 + expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(10000 + expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          } else {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          }
-        }
-      }
-      assertEquals(1000, count);
-    } catch (IllegalPathException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  /**
-   * Construct DeviceMergeOperator with the same device in two DeviceViewOperators.
-   *
-   * <p>DeviceViewOperator1: [seriesScanOperator: [device0.sensor0]],
-   *
-   * <p>DeviceViewOperator2: [seriesScanOperator: [device0.sensor0]]
-   *
-   * <p>the result tsBlock should be like [Device, sensor0, sensor1]. The sensor1 column of device0
-   * and the sensor0 column of device1 should be null.
-   */
-  @Test
-  public void deviceMergeOperatorTest2() {
-    ExecutorService instanceNotificationExecutor =
-        IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
-    try {
-      // Construct operator tree
-      QueryId queryId = new QueryId("stub_query");
-      FragmentInstanceId instanceId =
-          new FragmentInstanceId(new PlanFragmentId(queryId, 0), "stub-instance");
-      FragmentInstanceStateMachine stateMachine =
-          new FragmentInstanceStateMachine(instanceId, instanceNotificationExecutor);
-      FragmentInstanceContext fragmentInstanceContext =
-          createFragmentInstanceContext(instanceId, stateMachine);
-      DriverContext driverContext = new DriverContext(fragmentInstanceContext, 0);
-      PlanNodeId planNodeId1 = new PlanNodeId("1");
-      driverContext.addOperatorContext(1, planNodeId1, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId2 = new PlanNodeId("2");
-      driverContext.addOperatorContext(2, planNodeId2, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId3 = new PlanNodeId("3");
-      driverContext.addOperatorContext(
-          3, planNodeId3, DeviceViewOperatorTest.class.getSimpleName());
-      PlanNodeId planNodeId4 = new PlanNodeId("4");
-      driverContext.addOperatorContext(
-          4, planNodeId4, DeviceViewOperatorTest.class.getSimpleName());
-      PlanNodeId planNodeId5 = new PlanNodeId("5");
-      driverContext.addOperatorContext(5, planNodeId5, DeviceMergeOperator.class.getSimpleName());
-
-      List<TSDataType> dataTypes = new ArrayList<>();
-      dataTypes.add(TSDataType.TEXT);
-      dataTypes.add(TSDataType.INT32);
-      MeasurementPath measurementPath1 =
-          new MeasurementPath(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0.sensor0", TSDataType.INT32);
-      SeriesScanOptions.Builder scanOptionsBuilder = new SeriesScanOptions.Builder();
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor0"));
-      SeriesScanOperator seriesScanOperator1 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(0),
-              planNodeId1,
-              measurementPath1,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      List<TsFileResource> seqResources1 = new ArrayList<>();
-      List<TsFileResource> unSeqResources1 = new ArrayList<>();
-      seqResources1.add(seqResources.get(0));
-      seqResources1.add(seqResources.get(1));
-      seqResources1.add(seqResources.get(3));
-      unSeqResources1.add(unSeqResources.get(0));
-      unSeqResources1.add(unSeqResources.get(1));
-      unSeqResources1.add(unSeqResources.get(3));
-      unSeqResources1.add(unSeqResources.get(5));
-      seriesScanOperator1.initQueryDataSource(new QueryDataSource(seqResources1, unSeqResources1));
-      seriesScanOperator1
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      DeviceViewOperator deviceViewOperator1 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(2),
-              Collections.singletonList(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"),
-              Collections.singletonList(seriesScanOperator1),
-              Collections.singletonList(Collections.singletonList(1)),
-              dataTypes);
-
-      SeriesScanOperator seriesScanOperator2 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(1),
-              planNodeId2,
-              measurementPath1,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      seriesScanOperator2
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      List<TsFileResource> seqResources2 = new ArrayList<>();
-      List<TsFileResource> unSeqResources2 = new ArrayList<>();
-      seqResources2.add(seqResources.get(2));
-      seqResources2.add(seqResources.get(4));
-      unSeqResources2.add(unSeqResources.get(2));
-      unSeqResources2.add(unSeqResources.get(4));
-      seriesScanOperator2.initQueryDataSource(new QueryDataSource(seqResources2, unSeqResources2));
-      DeviceViewOperator deviceViewOperator2 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(3),
-              Collections.singletonList(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"),
-              Collections.singletonList(seriesScanOperator2),
-              Collections.singletonList(Collections.singletonList(1)),
-              dataTypes);
-
-      List<String> devices = new ArrayList<>();
-      devices.add(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0");
-      List<Operator> deviceOperators = new ArrayList<>();
-      deviceOperators.add(deviceViewOperator1);
-      deviceOperators.add(deviceViewOperator2);
-      DeviceMergeOperator deviceMergeOperator =
-          new DeviceMergeOperator(
-              driverContext.getOperatorContexts().get(4),
-              devices,
-              deviceOperators,
-              dataTypes,
-              new TimeSelector(500, true),
-              new AscTimeComparator());
-
-      int count = 0;
-      while (deviceMergeOperator.hasNext()) {
-        TsBlock tsBlock = deviceMergeOperator.next();
-        if (tsBlock == null) {
-          continue;
-        }
-        assertEquals(2, tsBlock.getValueColumnCount());
-        for (int i = 0; i < tsBlock.getPositionCount(); i++, count++) {
-          assertEquals(count, tsBlock.getTimeByIndex(i));
-          assertEquals(
-              DEVICE_MERGE_OPERATOR_TEST_SG + ".device0",
-              tsBlock.getColumn(0).getBinary(i).getStringValue());
-          if ((long) count < 200) {
-            assertEquals(20000 + (long) count, tsBlock.getColumn(1).getInt(i));
-          } else if ((long) count < 260
-              || ((long) count >= 300 && (long) count < 380)
-              || (long) count >= 400) {
-            assertEquals(10000 + (long) count, tsBlock.getColumn(1).getInt(i));
-          } else {
-            assertEquals(count, tsBlock.getColumn(1).getInt(i));
-          }
-        }
-      }
-      assertEquals(500, count);
-    } catch (IllegalPathException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-
-  /**
-   * Construct DeviceMergeOperator with the same and different device at the same time in two
-   * DeviceViewOperators.
-   *
-   * <p>DeviceViewOperator1: [seriesScanOperator: [device0.sensor0], [device1.sensor1]],
-   *
-   * <p>DeviceViewOperator2: [seriesScanOperator: [device0.sensor0]]
-   *
-   * <p>the result tsBlock should be like [Device, sensor0, sensor1]. The sensor1 column of device0
-   * and the sensor0 column of device1 should be null.
-   */
-  @Test
-  public void deviceMergeOperatorTest3() {
-    ExecutorService instanceNotificationExecutor =
-        IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
-    try {
-      // Construct operator tree
-      QueryId queryId = new QueryId("stub_query");
-      FragmentInstanceId instanceId =
-          new FragmentInstanceId(new PlanFragmentId(queryId, 0), "stub-instance");
-      FragmentInstanceStateMachine stateMachine =
-          new FragmentInstanceStateMachine(instanceId, instanceNotificationExecutor);
-      FragmentInstanceContext fragmentInstanceContext =
-          createFragmentInstanceContext(instanceId, stateMachine);
-      DriverContext driverContext = new DriverContext(fragmentInstanceContext, 0);
-      PlanNodeId planNodeId1 = new PlanNodeId("1");
-      driverContext.addOperatorContext(1, planNodeId1, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId2 = new PlanNodeId("2");
-      driverContext.addOperatorContext(2, planNodeId2, SeriesScanOperator.class.getSimpleName());
-      PlanNodeId planNodeId3 = new PlanNodeId("3");
-      driverContext.addOperatorContext(3, planNodeId3, SeriesScanOperator.class.getSimpleName());
-      driverContext.addOperatorContext(
-          4, new PlanNodeId("4"), DeviceViewOperatorTest.class.getSimpleName());
-      driverContext.addOperatorContext(
-          5, new PlanNodeId("5"), DeviceViewOperatorTest.class.getSimpleName());
-      driverContext.addOperatorContext(
-          6, new PlanNodeId("6"), DeviceMergeOperator.class.getSimpleName());
-
-      List<TSDataType> dataTypes = new ArrayList<>();
-      dataTypes.add(TSDataType.TEXT);
-      dataTypes.add(TSDataType.INT32);
-      dataTypes.add(TSDataType.INT32);
-      MeasurementPath measurementPath1 =
-          new MeasurementPath(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0.sensor0", TSDataType.INT32);
-      SeriesScanOptions.Builder scanOptionsBuilder = new SeriesScanOptions.Builder();
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor0"));
-      SeriesScanOperator seriesScanOperator1 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(0),
-              planNodeId1,
-              measurementPath1,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      List<TsFileResource> seqResources1 = new ArrayList<>();
-      List<TsFileResource> unSeqResources1 = new ArrayList<>();
-      seqResources1.add(seqResources.get(0));
-      seqResources1.add(seqResources.get(1));
-      seqResources1.add(seqResources.get(3));
-      unSeqResources1.add(unSeqResources.get(0));
-      unSeqResources1.add(unSeqResources.get(1));
-      unSeqResources1.add(unSeqResources.get(3));
-      unSeqResources1.add(unSeqResources.get(5));
-      seriesScanOperator1.initQueryDataSource(new QueryDataSource(seqResources1, unSeqResources1));
-      seriesScanOperator1
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      MeasurementPath measurementPath2 =
-          new MeasurementPath(DEVICE_MERGE_OPERATOR_TEST_SG + ".device1.sensor1", TSDataType.INT32);
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor1"));
-      SeriesScanOperator seriesScanOperator2 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(1),
-              planNodeId2,
-              measurementPath2,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      seriesScanOperator2.initQueryDataSource(new QueryDataSource(seqResources, unSeqResources));
-      seriesScanOperator2
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      List<String> devices = new ArrayList<>();
-      devices.add(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0");
-      devices.add(DEVICE_MERGE_OPERATOR_TEST_SG + ".device1");
-      List<Operator> deviceOperators = new ArrayList<>();
-      deviceOperators.add(seriesScanOperator1);
-      deviceOperators.add(seriesScanOperator2);
-      List<List<Integer>> deviceColumnIndex = new ArrayList<>();
-      deviceColumnIndex.add(Collections.singletonList(1));
-      deviceColumnIndex.add(Collections.singletonList(2));
-      DeviceViewOperator deviceViewOperator1 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(3),
-              devices,
-              deviceOperators,
-              deviceColumnIndex,
-              dataTypes);
-
-      scanOptionsBuilder.withAllSensors(Collections.singleton("sensor0"));
-      SeriesScanOperator seriesScanOperator3 =
-          new SeriesScanOperator(
-              driverContext.getOperatorContexts().get(2),
-              planNodeId3,
-              measurementPath1,
-              Ordering.ASC,
-              scanOptionsBuilder.build());
-      seriesScanOperator3
-          .getOperatorContext()
-          .setMaxRunTime(new Duration(500, TimeUnit.MILLISECONDS));
-
-      List<TsFileResource> seqResources2 = new ArrayList<>();
-      List<TsFileResource> unSeqResources2 = new ArrayList<>();
-      seqResources2.add(seqResources.get(2));
-      seqResources2.add(seqResources.get(4));
-      unSeqResources2.add(unSeqResources.get(2));
-      unSeqResources2.add(unSeqResources.get(4));
-      seriesScanOperator3.initQueryDataSource(new QueryDataSource(seqResources2, unSeqResources2));
-      DeviceViewOperator deviceViewOperator2 =
-          new DeviceViewOperator(
-              driverContext.getOperatorContexts().get(4),
-              Collections.singletonList(DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"),
-              Collections.singletonList(seriesScanOperator3),
-              Collections.singletonList(Collections.singletonList(1)),
-              dataTypes);
-
-      List<Operator> deviceViewOperators = new ArrayList<>();
-      deviceViewOperators.add(deviceViewOperator1);
-      deviceViewOperators.add(deviceViewOperator2);
-      DeviceMergeOperator deviceMergeOperator =
-          new DeviceMergeOperator(
-              driverContext.getOperatorContexts().get(5),
-              devices,
-              deviceViewOperators,
-              dataTypes,
-              new TimeSelector(500, true),
-              new AscTimeComparator());
-
-      int count = 0;
-      while (deviceMergeOperator.hasNext()) {
-        TsBlock tsBlock = deviceMergeOperator.next();
-        if (tsBlock == null) {
-          continue;
-        }
-        assertEquals(3, tsBlock.getValueColumnCount());
-        for (int i = 0; i < tsBlock.getPositionCount(); i++, count++) {
-          long expectedTime = count % 500;
-          assertEquals(expectedTime, tsBlock.getTimeByIndex(i));
-          assertEquals(
-              count < 500
-                  ? DEVICE_MERGE_OPERATOR_TEST_SG + ".device0"
-                  : DEVICE_MERGE_OPERATOR_TEST_SG + ".device1",
-              tsBlock.getColumn(0).getBinary(i).getStringValue());
-          if (expectedTime < 200) {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(20000 + expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(20000 + expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          } else if (expectedTime < 260
-              || (expectedTime >= 300 && expectedTime < 380)
-              || expectedTime >= 400) {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(10000 + expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(10000 + expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          } else {
-            if (!tsBlock.getColumn(1).isNull(i)) {
-              assertEquals(expectedTime, tsBlock.getColumn(1).getInt(i));
-              assertTrue(tsBlock.getColumn(2).isNull(i));
-            } else {
-              assertEquals(expectedTime, tsBlock.getColumn(2).getInt(i));
-            }
-          }
-        }
-      }
-      assertEquals(1000, count);
-    } catch (IllegalPathException e) {
-      e.printStackTrace();
-      fail();
-    }
-  }
-}
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceViewOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceViewOperatorTest.java
index 9e53ab2fe0..b524825fbb 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceViewOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/DeviceViewOperatorTest.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.mpp.execution.operator;
 
 import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.exception.MetadataException;
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
@@ -195,7 +194,7 @@ public class DeviceViewOperatorTest {
         }
       }
       assertEquals(1000, count);
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/FillOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/FillOperatorTest.java
index af84ea03a8..75da328970 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/FillOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/FillOperatorTest.java
@@ -46,7 +46,7 @@ import static org.junit.Assert.assertTrue;
 public class FillOperatorTest {
 
   @Test
-  public void batchConstantFillTest() {
+  public void batchConstantFillTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -80,7 +80,7 @@ public class FillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   int delta = index * 10000;
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
@@ -122,12 +122,12 @@ public class FillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
@@ -220,7 +220,7 @@ public class FillOperatorTest {
   }
 
   @Test
-  public void batchPreviousFillTest() {
+  public void batchPreviousFillTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -250,7 +250,7 @@ public class FillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   int delta = index * 10000;
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
@@ -291,12 +291,12 @@ public class FillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/HorizontallyConcatOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/HorizontallyConcatOperatorTest.java
index 1430fc4a11..15e803e7f6 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/HorizontallyConcatOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/HorizontallyConcatOperatorTest.java
@@ -92,7 +92,7 @@ public class HorizontallyConcatOperatorTest {
   }
 
   @Test
-  public void batchTest1() {
+  public void batchTest1() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryMergeOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryMergeOperatorTest.java
index c409373a4d..8a4862fa4a 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryMergeOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryMergeOperatorTest.java
@@ -63,7 +63,7 @@ public class LastQueryMergeOperatorTest {
   }
 
   @Test
-  public void testLastQueryMergeOperatorDesc() {
+  public void testLastQueryMergeOperatorDesc() throws Exception {
 
     QueryId queryId = new QueryId("stub_query");
     FragmentInstanceId instanceId =
@@ -104,7 +104,7 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public TsBlock next() {
+          public TsBlock next() throws Exception {
             TsBlockBuilder builder = LastQueryUtil.createTsBlockBuilder(4);
             for (int i = timeArray[index].length - 1; i >= 0; i--) {
               LastQueryUtil.appendLastValue(
@@ -119,12 +119,12 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public boolean hasNext() {
+          public boolean hasNext() throws Exception {
             return index >= 0;
           }
 
           @Override
-          public boolean isFinished() {
+          public boolean isFinished() throws Exception {
             return !hasNext();
           }
 
@@ -168,7 +168,7 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public TsBlock next() {
+          public TsBlock next() throws Exception {
             TsBlockBuilder builder = LastQueryUtil.createTsBlockBuilder(4);
             for (int i = timeArray[index].length - 1; i >= 0; i--) {
               LastQueryUtil.appendLastValue(
@@ -183,12 +183,12 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public boolean hasNext() {
+          public boolean hasNext() throws Exception {
             return index >= 0;
           }
 
           @Override
-          public boolean isFinished() {
+          public boolean isFinished() throws Exception {
             return !hasNext();
           }
 
@@ -241,7 +241,9 @@ public class LastQueryMergeOperatorTest {
     int count = timeArray.length - 1;
     while (!lastQueryMergeOperator.isFinished()) {
       assertTrue(lastQueryMergeOperator.isBlocked().isDone());
-      TsBlock result = lastQueryMergeOperator.next();
+      TsBlock result = null;
+      result = lastQueryMergeOperator.next();
+
       if (result == null) {
         continue;
       }
@@ -255,11 +257,12 @@ public class LastQueryMergeOperatorTest {
         count--;
       }
     }
+
     assertEquals(-1, count);
   }
 
   @Test
-  public void testLastQueryMergeOperatorAsc() {
+  public void testLastQueryMergeOperatorAsc() throws Exception {
 
     QueryId queryId = new QueryId("stub_query");
     FragmentInstanceId instanceId =
@@ -300,7 +303,7 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public TsBlock next() {
+          public TsBlock next() throws Exception {
             TsBlockBuilder builder = LastQueryUtil.createTsBlockBuilder(4);
             for (int i = 0, size = timeArray[index].length; i < size; i++) {
               LastQueryUtil.appendLastValue(
@@ -315,12 +318,13 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public boolean hasNext() {
+          public boolean hasNext() throws Exception {
             return index < 2;
           }
 
           @Override
-          public boolean isFinished() {
+          public boolean isFinished() throws Exception {
+
             return !hasNext();
           }
 
@@ -364,7 +368,7 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public TsBlock next() {
+          public TsBlock next() throws Exception {
             TsBlockBuilder builder = LastQueryUtil.createTsBlockBuilder(4);
             for (int i = 0, size = timeArray[index].length; i < size; i++) {
               LastQueryUtil.appendLastValue(
@@ -379,12 +383,13 @@ public class LastQueryMergeOperatorTest {
           }
 
           @Override
-          public boolean hasNext() {
+          public boolean hasNext() throws Exception {
             return index < 2;
           }
 
           @Override
-          public boolean isFinished() {
+          public boolean isFinished() throws Exception {
+
             return !hasNext();
           }
 
@@ -437,7 +442,8 @@ public class LastQueryMergeOperatorTest {
     int count = 0;
     while (!lastQueryMergeOperator.isFinished()) {
       assertTrue(lastQueryMergeOperator.isBlocked().isDone());
-      TsBlock result = lastQueryMergeOperator.next();
+      TsBlock result = null;
+      result = lastQueryMergeOperator.next();
       if (result == null) {
         continue;
       }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryOperatorTest.java
index 5d387029ce..e3141272de 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQueryOperatorTest.java
@@ -90,7 +90,7 @@ public class LastQueryOperatorTest {
   }
 
   @Test
-  public void testLastQueryOperator1() {
+  public void testLastQueryOperator1() throws Exception {
     try {
       List<Aggregator> aggregators1 = LastQueryUtil.createAggregators(TSDataType.INT32);
       MeasurementPath measurementPath1 =
@@ -341,7 +341,7 @@ public class LastQueryOperatorTest {
         }
       }
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQuerySortOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQuerySortOperatorTest.java
index ea669cf1de..76b26258e6 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQuerySortOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LastQuerySortOperatorTest.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.mpp.execution.operator;
 
 import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.exception.MetadataException;
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
@@ -209,7 +208,7 @@ public class LastQuerySortOperatorTest {
         }
       }
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
@@ -343,7 +342,7 @@ public class LastQuerySortOperatorTest {
         }
       }
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LimitOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LimitOperatorTest.java
index 79a4d56445..a69d41765d 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LimitOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LimitOperatorTest.java
@@ -86,7 +86,7 @@ public class LimitOperatorTest {
   }
 
   @Test
-  public void batchTest() {
+  public void batchTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LinearFillOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LinearFillOperatorTest.java
index 6bac123f24..877510fe2e 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LinearFillOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/LinearFillOperatorTest.java
@@ -48,7 +48,7 @@ import static org.junit.Assert.assertTrue;
 public class LinearFillOperatorTest {
 
   @Test
-  public void batchLinearFillTest1() {
+  public void batchLinearFillTest1() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -131,7 +131,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
                           ImmutableList.of(
@@ -155,12 +155,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
@@ -261,7 +261,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillTest1OrderByDesc() {
+  public void batchLinearFillTest1OrderByDesc() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -344,7 +344,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
                           ImmutableList.of(
@@ -368,12 +368,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
@@ -474,7 +474,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillTest2() {
+  public void batchLinearFillTest2() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -557,7 +557,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
                           ImmutableList.of(
@@ -581,12 +581,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
@@ -687,7 +687,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillTest2OrderByDesc() {
+  public void batchLinearFillTest2OrderByDesc() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -770,7 +770,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder =
                       new TsBlockBuilder(
                           ImmutableList.of(
@@ -794,12 +794,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 3;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 3;
                 }
 
@@ -900,7 +900,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillTest3() {
+  public void batchLinearFillTest3() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -937,7 +937,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder = new TsBlockBuilder(ImmutableList.of(TSDataType.FLOAT));
                   for (int i = 0; i < 1; i++) {
                     builder.getTimeColumnBuilder().writeLong(i + index);
@@ -955,12 +955,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 7;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 7;
                 }
 
@@ -1020,7 +1020,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillTest3OrderByDesc() {
+  public void batchLinearFillTest3OrderByDesc() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -1057,7 +1057,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder = new TsBlockBuilder(ImmutableList.of(TSDataType.FLOAT));
                   for (int i = 0; i < 1; i++) {
                     builder.getTimeColumnBuilder().writeLong(i + (6 - index));
@@ -1075,12 +1075,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 7;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 7;
                 }
 
@@ -1140,7 +1140,7 @@ public class LinearFillOperatorTest {
   }
 
   @Test
-  public void batchLinearFillBooleanTest() {
+  public void batchLinearFillBooleanTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -1177,7 +1177,7 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public TsBlock next() {
+                public TsBlock next() throws Exception {
                   TsBlockBuilder builder = new TsBlockBuilder(ImmutableList.of(TSDataType.BOOLEAN));
                   for (int i = 0; i < 1; i++) {
                     builder.getTimeColumnBuilder().writeLong(i + index);
@@ -1195,12 +1195,12 @@ public class LinearFillOperatorTest {
                 }
 
                 @Override
-                public boolean hasNext() {
+                public boolean hasNext() throws Exception {
                   return index < 7;
                 }
 
                 @Override
-                public boolean isFinished() {
+                public boolean isFinished() throws Exception {
                   return index >= 7;
                 }
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/MergeSortOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/MergeSortOperatorTest.java
index 3cc0f1ec56..5826d2c4e7 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/MergeSortOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/MergeSortOperatorTest.java
@@ -337,7 +337,7 @@ public class MergeSortOperatorTest {
   }
 
   @Test
-  public void testOrderByTime1() {
+  public void testOrderByTime1() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest(Ordering.ASC, Ordering.ASC);
     long lastTime = -1;
     int checkDevice = 0;
@@ -379,11 +379,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 1500);
   }
 
   @Test
-  public void testOrderByTime2() {
+  public void testOrderByTime2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest(Ordering.ASC, Ordering.DESC);
     long lastTime = -1;
     int checkDevice = 0;
@@ -425,11 +426,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 1500);
   }
 
   @Test
-  public void testOrderByTime3() {
+  public void testOrderByTime3() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest(Ordering.DESC, Ordering.DESC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
@@ -471,11 +473,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 1500);
   }
 
   @Test
-  public void testOrderByTime4() {
+  public void testOrderByTime4() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest(Ordering.DESC, Ordering.ASC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
@@ -517,6 +520,7 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 1500);
   }
 
@@ -815,7 +819,7 @@ public class MergeSortOperatorTest {
   }
 
   @Test
-  public void testOrderByTime1_2() {
+  public void testOrderByTime1_2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest2(Ordering.ASC, Ordering.ASC);
     long lastTime = -1;
     int checkDevice = 0;
@@ -853,15 +857,17 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
 
   @Test
-  public void testOrderByTime2_2() {
+  public void testOrderByTime2_2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest2(Ordering.ASC, Ordering.DESC);
     long lastTime = -1;
     int checkDevice = 0;
     int count = 0;
+
     while (mergeSortOperator.isBlocked().isDone() && mergeSortOperator.hasNext()) {
       TsBlock tsBlock = mergeSortOperator.next();
       assertEquals(3, tsBlock.getValueColumnCount());
@@ -895,11 +901,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
 
   @Test
-  public void testOrderByTime3_2() {
+  public void testOrderByTime3_2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest2(Ordering.DESC, Ordering.DESC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
@@ -937,11 +944,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
 
   @Test
-  public void testOrderByTime4_2() {
+  public void testOrderByTime4_2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest2(Ordering.DESC, Ordering.ASC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
@@ -979,6 +987,7 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
   // ------------------------------------------------------------------------------------------------
@@ -1245,7 +1254,7 @@ public class MergeSortOperatorTest {
   }
 
   @Test
-  public void testOrderByDevice1() {
+  public void testOrderByDevice1() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest3(Ordering.ASC, Ordering.ASC);
     long lastTime = -1;
     int checkDevice = 0;
@@ -1293,11 +1302,12 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
 
   @Test
-  public void testOrderByDevice2() {
+  public void testOrderByDevice2() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest3(Ordering.ASC, Ordering.DESC);
     long lastTime = -1;
     int checkDevice = 0;
@@ -1345,15 +1355,17 @@ public class MergeSortOperatorTest {
         }
       }
     }
+
     assertEquals(count, 2000);
   }
 
   @Test
-  public void testOrderByDevice3() {
+  public void testOrderByDevice3() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest3(Ordering.DESC, Ordering.ASC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
     int count = 0;
+
     while (mergeSortOperator.isBlocked().isDone() && mergeSortOperator.hasNext()) {
       TsBlock tsBlock = mergeSortOperator.next();
       if (tsBlock == null) continue;
@@ -1401,7 +1413,7 @@ public class MergeSortOperatorTest {
   }
 
   @Test
-  public void testOrderByDevice4() {
+  public void testOrderByDevice4() throws Exception {
     MergeSortOperator mergeSortOperator = mergeSortOperatorTest3(Ordering.DESC, Ordering.DESC);
     long lastTime = Long.MAX_VALUE;
     int checkDevice = 0;
@@ -1464,7 +1476,7 @@ public class MergeSortOperatorTest {
   //                        ShowQueriesOperator      ShowQueriesOperator
   // ------------------------------------------------------------------------------------------------
   @Test
-  public void mergeSortWithSortOperatorTest() {
+  public void mergeSortWithSortOperatorTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/OffsetOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/OffsetOperatorTest.java
index 16747a70ea..b4a098282e 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/OffsetOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/OffsetOperatorTest.java
@@ -87,7 +87,7 @@ public class OffsetOperatorTest {
   }
 
   @Test
-  public void batchTest1() {
+  public void batchTest1() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -192,7 +192,7 @@ public class OffsetOperatorTest {
 
   /** offset is 0 in which case we will get all data */
   @Test
-  public void batchTest2() {
+  public void batchTest2() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -294,7 +294,7 @@ public class OffsetOperatorTest {
 
   /** offset is larger than max row number in which case we will get no data */
   @Test
-  public void batchTest3() {
+  public void batchTest3() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/RawDataAggregationOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/RawDataAggregationOperatorTest.java
index aa333914a9..3f3fc62d27 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/RawDataAggregationOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/RawDataAggregationOperatorTest.java
@@ -114,7 +114,7 @@ public class RawDataAggregationOperatorTest {
    * always used with value filter.
    */
   @Test
-  public void aggregateRawDataTest1() throws IllegalPathException {
+  public void aggregateRawDataTest1() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     List<List<InputLocation[]>> inputLocations = new ArrayList<>();
     for (int i = 0; i < 2; i++) {
@@ -165,7 +165,7 @@ public class RawDataAggregationOperatorTest {
    * always used with value filter.
    */
   @Test
-  public void aggregateRawDataTest2() throws IllegalPathException {
+  public void aggregateRawDataTest2() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     List<List<InputLocation[]>> inputLocations = new ArrayList<>();
     for (int i = 0; i < 2; i++) {
@@ -209,12 +209,13 @@ public class RawDataAggregationOperatorTest {
       }
       count++;
     }
+
     assertEquals(1, count);
   }
 
   /** Test aggregating raw data by time interval. */
   @Test
-  public void groupByTimeRawDataTest1() throws IllegalPathException {
+  public void groupByTimeRawDataTest1() throws Exception {
     int[][] result =
         new int[][] {
           {100, 100, 100, 99},
@@ -247,6 +248,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(
             aggregationTypes, groupByTimeParameter, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -265,12 +267,13 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(4, count);
   }
 
   /** Test aggregating raw data by time interval. */
   @Test
-  public void groupByTimeRawDataTest2() throws IllegalPathException {
+  public void groupByTimeRawDataTest2() throws Exception {
     double[][] result =
         new double[][] {
           {20049.5, 20149.5, 6249.5, 8429.808},
@@ -305,6 +308,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(
             aggregationTypes, groupByTimeParameter, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -325,12 +329,13 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(4, count);
   }
 
   /** Test by time interval with EndTime */
   @Test
-  public void groupByTimeRawDataTest3() throws IllegalPathException {
+  public void groupByTimeRawDataTest3() throws Exception {
     int[][] result =
         new int[][] {
           {100, 100, 100, 99},
@@ -367,6 +372,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(
             aggregationTypes, groupByTimeParameter, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -394,12 +400,13 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(4, count);
   }
 
   /** 0 - 99 100 - 199 200 - 299 300 - 399 400 - 499 500 - 599 */
   @Test
-  public void groupByTimeRawDataTest4() throws IllegalPathException {
+  public void groupByTimeRawDataTest4() throws Exception {
     int[][] result =
         new int[][] {
           {100, 100, 100, 100, 100, 0},
@@ -430,6 +437,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(
             aggregationTypes, groupByTimeParameter, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -457,6 +465,7 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(6, count);
   }
 
@@ -465,7 +474,7 @@ public class RawDataAggregationOperatorTest {
    * 501 - 600
    */
   @Test
-  public void groupByTimeRawDataTest5() throws IllegalPathException {
+  public void groupByTimeRawDataTest5() throws Exception {
     int[][] result =
         new int[][] {
           {100, 100, 100, 100, 99, 0},
@@ -496,6 +505,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(
             aggregationTypes, groupByTimeParameter, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -521,12 +531,13 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(6, count);
   }
 
   /** 0 - 259 260 - 299 `300 - 499 */
   @Test
-  public void groupByEventRawDataTest1() throws IllegalPathException {
+  public void groupByEventRawDataTest1() throws Exception {
     int[][] result =
         new int[][] {
           {0, 260, 300},
@@ -567,6 +578,7 @@ public class RawDataAggregationOperatorTest {
     RawDataAggregationOperator rawDataAggregationOperator =
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -588,11 +600,12 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(3, count);
   }
 
   @Test
-  public void groupByEventRawDataTest2() throws IllegalPathException {
+  public void groupByEventRawDataTest2() throws Exception {
     int[][] result =
         new int[][] {
           {4019900, 613770, 11180, 827160, 7790, 1044950},
@@ -631,6 +644,7 @@ public class RawDataAggregationOperatorTest {
     RawDataAggregationOperator rawDataAggregationOperator =
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -651,11 +665,12 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(6, count);
   }
 
   @Test
-  public void groupByEventRawDataTest3() throws IllegalPathException {
+  public void groupByEventRawDataTest3() throws Exception {
     int[][] result =
         new int[][] {
           {4019900, 613770, 11180, 827160, 7790, 1044950},
@@ -690,6 +705,7 @@ public class RawDataAggregationOperatorTest {
     RawDataAggregationOperator rawDataAggregationOperator =
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -709,11 +725,12 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(6, count);
   }
   /** 0 - 199 200 - 259 260 - 299 300 - 379 380 - 399 400 - 499 */
   @Test
-  public void groupByEventRawDataTest4() throws IllegalPathException {
+  public void groupByEventRawDataTest4() throws Exception {
     int[] result =
         new int[] {
           20000, 10200, 260, 10300, 380, 10400,
@@ -739,6 +756,7 @@ public class RawDataAggregationOperatorTest {
     RawDataAggregationOperator rawDataAggregationOperator =
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -753,25 +771,25 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(6, count);
   }
 
   @Test
-  public void onePointInOneEqualEventWindowTest() throws IllegalPathException {
+  public void onePointInOneEqualEventWindowTest() throws Exception {
     WindowParameter windowParameter =
         new VariationWindowParameter(TSDataType.INT32, 0, false, true, 0);
     onePointInOneWindowTest(windowParameter);
   }
 
   @Test
-  public void onePointInOneVariationEventWindowTest() throws IllegalPathException {
+  public void onePointInOneVariationEventWindowTest() throws Exception {
     WindowParameter windowParameter =
         new VariationWindowParameter(TSDataType.INT32, 0, false, true, 0.5);
     onePointInOneWindowTest(windowParameter);
   }
 
-  private void onePointInOneWindowTest(WindowParameter windowParameter)
-      throws IllegalPathException {
+  private void onePointInOneWindowTest(WindowParameter windowParameter) throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     List<List<InputLocation[]>> inputLocations = new ArrayList<>();
     for (int i = 0; i < 2; i++) {
@@ -791,6 +809,7 @@ public class RawDataAggregationOperatorTest {
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
 
     int resultMinTime1 = -1, resultMinTime2 = -1;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -815,12 +834,13 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(resultMinTime1, 499);
     assertEquals(resultMinTime2, 499);
   }
 
   @Test
-  public void groupBySessionRawDataTest1() throws IllegalPathException {
+  public void groupBySessionRawDataTest1() throws Exception {
     int[][] result = new int[][] {{0}, {499}, {20000}, {10499}};
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     List<List<InputLocation[]>> inputLocations = new ArrayList<>();
@@ -854,6 +874,7 @@ public class RawDataAggregationOperatorTest {
     RawDataAggregationOperator rawDataAggregationOperator =
         initRawDataAggregationOperator(aggregationTypes, null, inputLocations, windowParameter);
     int count = 0;
+
     while (rawDataAggregationOperator.isBlocked().isDone()
         && rawDataAggregationOperator.hasNext()) {
       TsBlock resultTsBlock = rawDataAggregationOperator.next();
@@ -875,6 +896,7 @@ public class RawDataAggregationOperatorTest {
         }
       }
     }
+
     assertEquals(1, count);
   }
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesAggregationScanOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesAggregationScanOperatorTest.java
index 36c815927a..06ea323617 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesAggregationScanOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesAggregationScanOperatorTest.java
@@ -91,7 +91,7 @@ public class SeriesAggregationScanOperatorTest {
   }
 
   @Test
-  public void testAggregationWithoutTimeFilter() throws IllegalPathException {
+  public void testAggregationWithoutTimeFilter() throws Exception {
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
     List<Aggregator> aggregators = new ArrayList<>();
     AccumulatorFactory.createAccumulators(
@@ -104,16 +104,18 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(500, resultTsBlock.getColumn(0).getLong(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithoutTimeFilterOrderByTimeDesc() throws IllegalPathException {
+  public void testAggregationWithoutTimeFilterOrderByTimeDesc() throws Exception {
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
     List<Aggregator> aggregators = new ArrayList<>();
     AccumulatorFactory.createAccumulators(
@@ -126,16 +128,18 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, false, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(500, resultTsBlock.getColumn(0).getLong(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilter1() throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilter1() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.COUNT);
     aggregationTypes.add(TAggregationType.SUM);
@@ -150,17 +154,19 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(500, resultTsBlock.getColumn(0).getLong(0));
       assertEquals(6524750.0, resultTsBlock.getColumn(1).getDouble(0), 0.0001);
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilter2() throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilter2() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -179,6 +185,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(20000, resultTsBlock.getColumn(0).getInt(0));
@@ -189,12 +196,12 @@ public class SeriesAggregationScanOperatorTest {
       assertEquals(260, resultTsBlock.getColumn(5).getInt(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testMultiAggregationFuncWithoutTimeFilterOrderByTimeDesc()
-      throws IllegalPathException {
+  public void testMultiAggregationFuncWithoutTimeFilterOrderByTimeDesc() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -213,6 +220,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, false, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(20000, resultTsBlock.getColumn(0).getInt(0));
@@ -223,11 +231,12 @@ public class SeriesAggregationScanOperatorTest {
       assertEquals(260, resultTsBlock.getColumn(5).getInt(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithTimeFilter1() throws IllegalPathException {
+  public void testAggregationWithTimeFilter1() throws Exception {
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
     List<Aggregator> aggregators = new ArrayList<>();
     AccumulatorFactory.createAccumulators(
@@ -241,16 +250,18 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, timeFilter, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(resultTsBlock.getColumn(0).getLong(0), 380);
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithTimeFilter2() throws IllegalPathException {
+  public void testAggregationWithTimeFilter2() throws Exception {
     Filter timeFilter = TimeFilter.ltEq(379);
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
     List<Aggregator> aggregators = new ArrayList<>();
@@ -264,16 +275,18 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, timeFilter, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(resultTsBlock.getColumn(0).getLong(0), 380);
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testAggregationWithTimeFilter3() throws IllegalPathException {
+  public void testAggregationWithTimeFilter3() throws Exception {
     Filter timeFilter = new AndFilter(TimeFilter.gtEq(100), TimeFilter.ltEq(399));
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
     List<Aggregator> aggregators = new ArrayList<>();
@@ -287,16 +300,18 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, timeFilter, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(resultTsBlock.getColumn(0).getLong(0), 300);
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testMultiAggregationWithTimeFilter() throws IllegalPathException {
+  public void testMultiAggregationWithTimeFilter() throws Exception {
     List<TAggregationType> aggregationTypes = new ArrayList<>();
     aggregationTypes.add(TAggregationType.FIRST_VALUE);
     aggregationTypes.add(TAggregationType.LAST_VALUE);
@@ -316,6 +331,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, timeFilter, true, null);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       assertEquals(20100, resultTsBlock.getColumn(0).getInt(0));
@@ -326,11 +342,12 @@ public class SeriesAggregationScanOperatorTest {
       assertEquals(260, resultTsBlock.getColumn(5).getInt(0));
       count++;
     }
+
     assertEquals(1, count);
   }
 
   @Test
-  public void testGroupByWithoutGlobalTimeFilter() throws IllegalPathException {
+  public void testGroupByWithoutGlobalTimeFilter() throws Exception {
     int[] result = new int[] {100, 100, 100, 99};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 100, true);
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
@@ -345,6 +362,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -354,11 +372,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(4, count);
   }
 
   @Test
-  public void testGroupByWithGlobalTimeFilter() throws IllegalPathException {
+  public void testGroupByWithGlobalTimeFilter() throws Exception {
     int[] result = new int[] {0, 80, 100, 80};
     Filter timeFilter = new AndFilter(TimeFilter.gtEq(120), TimeFilter.ltEq(379));
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 100, true);
@@ -374,6 +393,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, timeFilter, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -383,11 +403,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(4, count);
   }
 
   @Test
-  public void testGroupByWithMultiFunction() throws IllegalPathException {
+  public void testGroupByWithMultiFunction() throws Exception {
     int[][] result =
         new int[][] {
           {20000, 20100, 10200, 10300},
@@ -412,6 +433,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -424,11 +446,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(4, count);
   }
 
   @Test
-  public void testGroupByWithMultiFunctionOrderByTimeDesc() throws IllegalPathException {
+  public void testGroupByWithMultiFunctionOrderByTimeDesc() throws Exception {
     int[][] result =
         new int[][] {
           {20000, 20100, 10200, 10300},
@@ -453,6 +476,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, false, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -465,11 +489,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(4, count);
   }
 
   @Test
-  public void testGroupBySlidingTimeWindow() throws IllegalPathException {
+  public void testGroupBySlidingTimeWindow() throws Exception {
     int[] result = new int[] {50, 50, 50, 50, 50, 50, 50, 49};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 399, 100, 50, true);
     List<TAggregationType> aggregationTypes = Collections.singletonList(TAggregationType.COUNT);
@@ -484,6 +509,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -493,11 +519,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(result.length, count);
   }
 
   @Test
-  public void testGroupBySlidingTimeWindow2() throws IllegalPathException {
+  public void testGroupBySlidingTimeWindow2() throws Exception {
     int[] timeColumn = new int[] {0, 20, 30, 50, 60, 80, 90, 110, 120, 140};
     int[] result = new int[] {20, 10, 20, 10, 20, 10, 20, 10, 20, 9};
     GroupByTimeParameter groupByTimeParameter = new GroupByTimeParameter(0, 149, 50, 30, true);
@@ -513,6 +540,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -522,11 +550,12 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(timeColumn.length, count);
   }
 
   @Test
-  public void testGroupBySlidingWindowWithMultiFunction() throws IllegalPathException {
+  public void testGroupBySlidingWindowWithMultiFunction() throws Exception {
     int[] timeColumn = new int[] {0, 20, 30, 50, 60, 80, 90, 110, 120, 140};
     int[][] result =
         new int[][] {
@@ -552,6 +581,7 @@ public class SeriesAggregationScanOperatorTest {
     SeriesAggregationScanOperator seriesAggregationScanOperator =
         initSeriesAggregationScanOperator(aggregators, null, true, groupByTimeParameter);
     int count = 0;
+
     while (seriesAggregationScanOperator.hasNext()) {
       TsBlock resultTsBlock = seriesAggregationScanOperator.next();
       int positionCount = resultTsBlock.getPositionCount();
@@ -564,6 +594,7 @@ public class SeriesAggregationScanOperatorTest {
         count++;
       }
     }
+
     assertEquals(timeColumn.length, count);
   }
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesScanOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesScanOperatorTest.java
index d79cb7fad9..2c0721684f 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesScanOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SeriesScanOperatorTest.java
@@ -80,7 +80,7 @@ public class SeriesScanOperatorTest {
   }
 
   @Test
-  public void batchTest() {
+  public void batchTest() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SingleDeviceViewOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SingleDeviceViewOperatorTest.java
index b935d1d665..cd1a9a48a7 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SingleDeviceViewOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SingleDeviceViewOperatorTest.java
@@ -19,7 +19,6 @@
 package org.apache.iotdb.db.mpp.execution.operator;
 
 import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
-import org.apache.iotdb.commons.exception.IllegalPathException;
 import org.apache.iotdb.commons.exception.MetadataException;
 import org.apache.iotdb.commons.path.MeasurementPath;
 import org.apache.iotdb.db.engine.querycontext.QueryDataSource;
@@ -194,7 +193,7 @@ public class SingleDeviceViewOperatorTest {
         count++;
       }
       assertEquals(500, total);
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SlidingWindowAggregationOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SlidingWindowAggregationOperatorTest.java
index 50d2ab026f..105f468a59 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SlidingWindowAggregationOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/SlidingWindowAggregationOperatorTest.java
@@ -133,7 +133,7 @@ public class SlidingWindowAggregationOperatorTest {
   }
 
   @Test
-  public void slidingWindowAggregationTest() throws IllegalPathException {
+  public void slidingWindowAggregationTest() throws Exception {
     String[] retArray =
         new String[] {
           "0,100,20049.5,2004950.0,20099,0,99,20000,20099,20000",
@@ -175,6 +175,7 @@ public class SlidingWindowAggregationOperatorTest {
         count--;
       }
     }
+
     Assert.assertEquals(0, count);
   }
 
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/TimeJoinOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/TimeJoinOperatorTest.java
index 70c768c1cf..ef122f78b8 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/TimeJoinOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/TimeJoinOperatorTest.java
@@ -87,7 +87,7 @@ public class TimeJoinOperatorTest {
   }
 
   @Test
-  public void batchTest1() {
+  public void batchTest1() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -182,7 +182,7 @@ public class TimeJoinOperatorTest {
 
   /** test time join with non-exist sensor */
   @Test
-  public void batchTest2() {
+  public void batchTest2() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -298,7 +298,7 @@ public class TimeJoinOperatorTest {
 
   /** test time join with non-exist sensor and order by time desc */
   @Test
-  public void batchTest3() {
+  public void batchTest3() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/UpdateLastCacheOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/UpdateLastCacheOperatorTest.java
index 953da1b480..a9fc842802 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/UpdateLastCacheOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/UpdateLastCacheOperatorTest.java
@@ -113,7 +113,7 @@ public class UpdateLastCacheOperatorTest {
       assertFalse(updateLastCacheOperator.hasNext());
       assertTrue(updateLastCacheOperator.isFinished());
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
@@ -143,7 +143,7 @@ public class UpdateLastCacheOperatorTest {
       assertFalse(updateLastCacheOperator.hasNext());
       assertTrue(updateLastCacheOperator.isFinished());
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
@@ -173,7 +173,7 @@ public class UpdateLastCacheOperatorTest {
       assertFalse(updateLastCacheOperator.hasNext());
       assertTrue(updateLastCacheOperator.isFinished());
 
-    } catch (IllegalPathException e) {
+    } catch (Exception e) {
       e.printStackTrace();
       fail();
     }
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperatorTest.java
index ec10473b9b..5bf7e1a656 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaCountOperatorTest.java
@@ -55,7 +55,7 @@ public class SchemaCountOperatorTest {
   private static final String SCHEMA_COUNT_OPERATOR_TEST_SG = "root.SchemaCountOperatorTest";
 
   @Test
-  public void testSchemaCountOperator() {
+  public void testSchemaCountOperator() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -184,7 +184,7 @@ public class SchemaCountOperatorTest {
     }
   }
 
-  private List<TsBlock> collectResult(CountGroupByLevelScanOperator<?> operator) {
+  private List<TsBlock> collectResult(CountGroupByLevelScanOperator<?> operator) throws Exception {
     List<TsBlock> tsBlocks = new ArrayList<>();
     while (operator.hasNext()) {
       TsBlock tsBlock = operator.next();
diff --git a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperatorTest.java b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperatorTest.java
index 434d509c75..7adb9b07bc 100644
--- a/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperatorTest.java
+++ b/server/src/test/java/org/apache/iotdb/db/mpp/execution/operator/schema/SchemaQueryScanOperatorTest.java
@@ -64,7 +64,7 @@ public class SchemaQueryScanOperatorTest {
   private static final String META_SCAN_OPERATOR_TEST_SG = "root.MetaScanOperatorTest";
 
   @Test
-  public void testDeviceSchemaScan() {
+  public void testDeviceSchemaScan() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
@@ -156,7 +156,7 @@ public class SchemaQueryScanOperatorTest {
   }
 
   @Test
-  public void testTimeSeriesSchemaScan() {
+  public void testTimeSeriesSchemaScan() throws Exception {
     ExecutorService instanceNotificationExecutor =
         IoTDBThreadPoolFactory.newFixedThreadPool(1, "test-instance-notification");
     try {
diff --git a/thrift/src/main/thrift/datanode.thrift b/thrift/src/main/thrift/datanode.thrift
index a47ee29305..c64e42d51a 100644
--- a/thrift/src/main/thrift/datanode.thrift
+++ b/thrift/src/main/thrift/datanode.thrift
@@ -63,7 +63,7 @@ struct TGetDataBlockRequest {
   1: required TFragmentInstanceId sourceFragmentInstanceId
   2: required i32 startSequenceId
   3: required i32 endSequenceId
-  // index of upstream SinkHandle
+  // index of upstream SinkChannel
   4: required i32 index
 }
 
@@ -75,10 +75,16 @@ struct TAcknowledgeDataBlockEvent {
   1: required TFragmentInstanceId sourceFragmentInstanceId
   2: required i32 startSequenceId
   3: required i32 endSequenceId
-  // index of upstream SinkHandle
+  // index of upstream SinkChannel
   4: required i32 index
 }
 
+struct TCloseSinkChannelEvent {
+  1: required TFragmentInstanceId sourceFragmentInstanceId
+  // index of upstream SinkChannel
+  2: required i32 index
+}
+
 struct TNewDataBlockEvent {
   1: required TFragmentInstanceId targetFragmentInstanceId
   2: required string targetPlanNodeId
@@ -742,6 +748,8 @@ service MPPDataExchangeService {
 
   void onAcknowledgeDataBlockEvent(TAcknowledgeDataBlockEvent e);
 
+  void onCloseSinkChannelEvent(TCloseSinkChannelEvent e);
+
   void onNewDataBlockEvent(TNewDataBlockEvent e);
 
   void onEndOfDataBlockEvent(TEndOfDataBlockEvent e);


[iotdb] 09/13: [IOTDB-5695] Ensures backward compatibility between 1.0 and 1.1 for ConfigNode when using SimpleConsensus (#9367)

Posted by zy...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

zyk pushed a commit to branch rc/1.1.0
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 38d7b3ee409a59050084ce6d82532ee316d16769
Author: Potato <ta...@apache.org>
AuthorDate: Sat Mar 18 11:02:06 2023 +0800

    [IOTDB-5695] Ensures backward compatibility between 1.0 and 1.1 for ConfigNode when using SimpleConsensus (#9367)
---
 .../statemachine/ConfigRegionStateMachine.java     |  3 +-
 .../manager/consensus/ConsensusManager.java        | 58 ++++++++++++++++------
 2 files changed, 45 insertions(+), 16 deletions(-)

diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigRegionStateMachine.java b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigRegionStateMachine.java
index b4c6dbd77d..8555ff9a77 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigRegionStateMachine.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/consensus/statemachine/ConfigRegionStateMachine.java
@@ -32,6 +32,7 @@ import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
 import org.apache.iotdb.confignode.consensus.request.ConfigPhysicalPlan;
 import org.apache.iotdb.confignode.exception.physical.UnknownPhysicalPlanTypeException;
 import org.apache.iotdb.confignode.manager.ConfigManager;
+import org.apache.iotdb.confignode.manager.consensus.ConsensusManager;
 import org.apache.iotdb.confignode.persistence.executor.ConfigPlanExecutor;
 import org.apache.iotdb.confignode.writelog.io.SingleFileLogReader;
 import org.apache.iotdb.consensus.ConsensusFactory;
@@ -76,7 +77,7 @@ public class ConfigRegionStateMachine
   private int endIndex;
 
   private static final String CURRENT_FILE_DIR =
-      CONF.getConsensusDir() + File.separator + "simple" + File.separator + "current";
+      ConsensusManager.getConfigRegionDir() + File.separator + "current";
   private static final String PROGRESS_FILE_PATH =
       CURRENT_FILE_DIR + File.separator + "log_inprogress_";
   private static final String FILE_PATH = CURRENT_FILE_DIR + File.separator + "log_";
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
index b49123c542..a767d05c9c 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/consensus/ConsensusManager.java
@@ -48,6 +48,7 @@ import org.apache.ratis.util.TimeDuration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -62,10 +63,11 @@ public class ConsensusManager {
   private static final Logger LOGGER = LoggerFactory.getLogger(ConsensusManager.class);
   private static final ConfigNodeConfig CONF = ConfigNodeDescriptor.getInstance().getConf();
   private static final int SEED_CONFIG_NODE_ID = 0;
+  /** There is only one ConfigNodeGroup */
+  public static final ConsensusGroupId DEFAULT_CONSENSUS_GROUP_ID =
+      new ConfigRegionId(CONF.getConfigRegionId());;
 
   private final IManager configManager;
-
-  private ConsensusGroupId consensusGroupId;
   private IConsensus consensusImpl;
 
   public ConsensusManager(IManager configManager, ConfigRegionStateMachine stateMachine)
@@ -80,10 +82,9 @@ public class ConsensusManager {
 
   /** ConsensusLayer local implementation. */
   private void setConsensusLayer(ConfigRegionStateMachine stateMachine) throws IOException {
-    // There is only one ConfigNodeGroup
-    consensusGroupId = new ConfigRegionId(CONF.getConfigRegionId());
 
     if (SIMPLE_CONSENSUS.equals(CONF.getConfigNodeConsensusProtocolClass())) {
+      upgrade();
       consensusImpl =
           ConsensusFactory.getConsensusImpl(
                   SIMPLE_CONSENSUS,
@@ -216,6 +217,25 @@ public class ConsensusManager {
     }
   }
 
+  /**
+   * In version 1.1, we fixed a 1.0 SimpleConsensus bug that incorrectly set the consensus
+   * directory. For backward compatibility, we added this function, which we may remove in version
+   * 2.x
+   */
+  private void upgrade() {
+    File consensusDir = new File(CONF.getConsensusDir());
+    if (consensusDir.exists()) {
+      File oldWalDir = new File(consensusDir, "simple");
+      if (oldWalDir.exists()) {
+        if (!oldWalDir.renameTo(new File(getConfigRegionDir()))) {
+          LOGGER.warn(
+              "upgrade ConfigNode consensus wal dir for SimpleConsensus from version/1.0 to version/1.1 failed, "
+                  + "you maybe need to rename the simple dir to 0_0 manually.");
+        }
+      }
+    }
+  }
+
   /**
    * Create peer in new node to build consensus group.
    *
@@ -228,11 +248,11 @@ public class ConsensusManager {
     for (TConfigNodeLocation configNodeLocation : configNodeLocations) {
       peerList.add(
           new Peer(
-              consensusGroupId,
+              DEFAULT_CONSENSUS_GROUP_ID,
               configNodeLocation.getConfigNodeId(),
               configNodeLocation.getConsensusEndPoint()));
     }
-    consensusImpl.createPeer(consensusGroupId, peerList);
+    consensusImpl.createPeer(DEFAULT_CONSENSUS_GROUP_ID, peerList);
   }
 
   /**
@@ -245,9 +265,9 @@ public class ConsensusManager {
     boolean result =
         consensusImpl
             .addPeer(
-                consensusGroupId,
+                DEFAULT_CONSENSUS_GROUP_ID,
                 new Peer(
-                    consensusGroupId,
+                    DEFAULT_CONSENSUS_GROUP_ID,
                     configNodeLocation.getConfigNodeId(),
                     configNodeLocation.getConsensusEndPoint()))
             .isSuccess();
@@ -267,9 +287,9 @@ public class ConsensusManager {
   public boolean removeConfigNodePeer(TConfigNodeLocation configNodeLocation) {
     return consensusImpl
         .removePeer(
-            consensusGroupId,
+            DEFAULT_CONSENSUS_GROUP_ID,
             new Peer(
-                consensusGroupId,
+                DEFAULT_CONSENSUS_GROUP_ID,
                 configNodeLocation.getConfigNodeId(),
                 configNodeLocation.getConsensusEndPoint()))
         .isSuccess();
@@ -277,22 +297,22 @@ public class ConsensusManager {
 
   /** Transmit PhysicalPlan to confignode.consensus.statemachine */
   public ConsensusWriteResponse write(ConfigPhysicalPlan plan) {
-    return consensusImpl.write(consensusGroupId, plan);
+    return consensusImpl.write(DEFAULT_CONSENSUS_GROUP_ID, plan);
   }
 
   /** Transmit PhysicalPlan to confignode.consensus.statemachine */
   public ConsensusReadResponse read(ConfigPhysicalPlan plan) {
-    return consensusImpl.read(consensusGroupId, plan);
+    return consensusImpl.read(DEFAULT_CONSENSUS_GROUP_ID, plan);
   }
 
   public boolean isLeader() {
-    return consensusImpl.isLeader(consensusGroupId);
+    return consensusImpl.isLeader(DEFAULT_CONSENSUS_GROUP_ID);
   }
 
   /** @return ConfigNode-leader's location if leader exists, null otherwise. */
   public TConfigNodeLocation getLeader() {
     for (int retry = 0; retry < 50; retry++) {
-      Peer leaderPeer = consensusImpl.getLeader(consensusGroupId);
+      Peer leaderPeer = consensusImpl.getLeader(DEFAULT_CONSENSUS_GROUP_ID);
       if (leaderPeer != null) {
         List<TConfigNodeLocation> registeredConfigNodes =
             getNodeManager().getRegisteredConfigNodes();
@@ -341,7 +361,15 @@ public class ConsensusManager {
   }
 
   public ConsensusGroupId getConsensusGroupId() {
-    return consensusGroupId;
+    return DEFAULT_CONSENSUS_GROUP_ID;
+  }
+
+  public static String getConfigRegionDir() {
+    return CONF.getConsensusDir()
+        + File.separator
+        + ConsensusManager.DEFAULT_CONSENSUS_GROUP_ID.getType().getValue()
+        + "_"
+        + ConsensusManager.DEFAULT_CONSENSUS_GROUP_ID.getId();
   }
 
   public IConsensus getConsensusImpl() {