You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/02/17 05:35:56 UTC

[iotdb] branch master updated: [IOTDB-2550] Avoid show timeseries error after alter tag on sync sender (#5068)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 9c332cf  [IOTDB-2550] Avoid show timeseries error after alter tag on sync sender  (#5068)
9c332cf is described below

commit 9c332cfe528d7bfc62aaaa1ca1ed277950ef8b48
Author: yschengzi <87...@users.noreply.github.com>
AuthorDate: Thu Feb 17 13:35:20 2022 +0800

    [IOTDB-2550] Avoid show timeseries error after alter tag on sync sender  (#5068)
---
 docs/UserGuide/Maintenance-Tools/Sync-Tool.md                         | 4 ++++
 docs/zh/UserGuide/Maintenance-Tools/Sync-Tool.md                      | 4 ++++
 .../org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java   | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/docs/UserGuide/Maintenance-Tools/Sync-Tool.md b/docs/UserGuide/Maintenance-Tools/Sync-Tool.md
index ece12ae..a97a3ab 100644
--- a/docs/UserGuide/Maintenance-Tools/Sync-Tool.md
+++ b/docs/UserGuide/Maintenance-Tools/Sync-Tool.md
@@ -42,6 +42,10 @@ In the sync module, each sub-factory is a sender, a general factory is a receive
 When there is an abnormal scenario, namely, two or more senders synchronize the data of the same device (whose storage group is set as root.sg) to the same receiver, the root.sg data of the sender containing the device data received later by the receiver will be rejected. Example: the engine 1 synchronizes the storage groups root.sg1 and root.sg2 to the receiver, and the engine 2 synchronizes the storage groups root.sg2 and root.sg3 to the receiver. All of them include the time series ro [...]
 If the receiver receives the data of root.sg2.d0.s0 of the sender 1 first, the receiver will reject the data of root.sg2 of the sender 2.
 
+### Precautions for Use
+
+Statement "alter timeseries add tag" will not effect the receiver when a sync-tool is running.
+
 ### Configuration
 #### Sync Receiver
 The parameter configuration of the sync receiver is located in the configuration file `iotdb-engine.properties` of IoTDB, and its directory is `$IOTDB_HOME/conf/iotdb-engine.properties`. In this configuration file, there are four parameters related to the sync receiver. The configuration instructions are as follows:
diff --git a/docs/zh/UserGuide/Maintenance-Tools/Sync-Tool.md b/docs/zh/UserGuide/Maintenance-Tools/Sync-Tool.md
index 4bef366..11a3da2 100644
--- a/docs/zh/UserGuide/Maintenance-Tools/Sync-Tool.md
+++ b/docs/zh/UserGuide/Maintenance-Tools/Sync-Tool.md
@@ -44,6 +44,10 @@
 当出现异常场景时,即两个或两个以上的发送端向同一个接收端同步相同设备(其存储组设为 root.sg) 的数据时,后被接收端收到的含有该设备数据的发送端的 root.sg 数据将会被拒绝接收。示例:发送端 1 向接收端同步存储组 root.sg1 和 root.sg2, 发送端 2 向接收端同步存储组 root.sg2 和 root.sg3, 
 均包括时间序列 root.sg2.d0.s0, 若接收端先接收到发送端 1 的 root.sg2.d0.s0 的数据,那么接收端将拒绝发送端 2 的 root.sg2 同步的数据。
 
+### 注意事项
+
+sync功能开启之后,发送端的 alter timeseries add tag 语句将不会被同步到接收端
+
 ### 配置参数
 
 #### 同步工具接收端
diff --git a/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java b/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
index fd16fe4..0c8c29c 100644
--- a/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
+++ b/server/src/main/java/org/apache/iotdb/db/sync/receiver/transfer/SyncServiceImpl.java
@@ -300,7 +300,8 @@ public class SyncServiceImpl implements SyncService.Iface {
               continue;
             }
             if (plan.getOperatorType() != Operator.OperatorType.CREATE_CONTINUOUS_QUERY
-                && plan.getOperatorType() != Operator.OperatorType.DROP_CONTINUOUS_QUERY) {
+                && plan.getOperatorType() != Operator.OperatorType.DROP_CONTINUOUS_QUERY
+                && plan.getOperatorType() != Operator.OperatorType.CHANGE_TAG_OFFSET) {
               IoTDB.metaManager.operation(plan);
             }
           } catch (Exception e) {