You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ne...@apache.org on 2021/03/25 01:18:14 UTC
[iotdb] branch master updated: [IOTDB-1250] fix pull schema bug
that the pullTimeSeriesSchema and pullMeasurementSchema is misused(#2894)
This is an automated email from the ASF dual-hosted git repository.
neuyilan 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 85604b4 [IOTDB-1250] fix pull schema bug that the pullTimeSeriesSchema and pullMeasurementSchema is misused(#2894)
85604b4 is described below
commit 85604b44cd2e243789d2ecbe09f86a228f2bb7ea
Author: chaow <cc...@163.com>
AuthorDate: Thu Mar 25 09:17:51 2021 +0800
[IOTDB-1250] fix pull schema bug that the pullTimeSeriesSchema and pullMeasurementSchema is misused(#2894)
---
.../java/org/apache/iotdb/cluster/metadata/CMManager.java | 3 ++-
.../java/org/apache/iotdb/cluster/metadata/MetaPuller.java | 3 ++-
.../iotdb/cluster/server/service/DataSyncService.java | 14 ++++++++++++++
.../iotdb/db/engine/compaction/utils/CompactionUtils.java | 2 +-
4 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
index 97904bf..88451b7 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/CMManager.java
@@ -285,6 +285,7 @@ public class CMManager extends MManager {
List<MeasurementSchema> schemas = metaPuller.pullMeasurementSchemas(schemasToPull);
for (MeasurementSchema schema : schemas) {
// TODO-Cluster: also pull alias?
+ // take care, the pulled schema's measurement Id is only series name
MeasurementMNode measurementMNode =
new MeasurementMNode(null, schema.getMeasurementId(), schema, null);
cacheMeta(deviceId.concatNode(schema.getMeasurementId()), measurementMNode);
@@ -1391,7 +1392,7 @@ public class CMManager extends MManager {
public Set<String> getAllDevices(List<String> paths) throws MetadataException {
Set<String> results = new HashSet<>();
for (String path : paths) {
- getAllTimeseriesPath(new PartialPath(path)).stream()
+ getDevices(new PartialPath(path)).stream()
.map(PartialPath::getFullPath)
.forEach(results::add);
}
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
index 13ece7b..e524772 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/metadata/MetaPuller.java
@@ -230,7 +230,8 @@ public class MetaPuller {
.getClientProvider()
.getSyncDataClient(node, RaftServer.getReadOperationTimeoutMS())) {
- PullSchemaResp pullSchemaResp = syncDataClient.pullTimeSeriesSchema(request);
+ // only need measurement name
+ PullSchemaResp pullSchemaResp = syncDataClient.pullMeasurementSchema(request);
ByteBuffer buffer = pullSchemaResp.schemaBytes;
int size = buffer.getInt();
schemas = new ArrayList<>(size);
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
index e0a5dab..77ba4db 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/server/service/DataSyncService.java
@@ -117,6 +117,13 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
}
}
+ /**
+ * return the schema, whose measurement Id is the series full path.
+ *
+ * @param request the pull request
+ * @return response
+ * @throws TException remind of thrift
+ */
@Override
public PullSchemaResp pullTimeSeriesSchema(PullSchemaRequest request) throws TException {
try {
@@ -145,6 +152,13 @@ public class DataSyncService extends BaseSyncService implements TSDataService.If
}
}
+ /**
+ * return the schema, whose measurement Id is the series name.
+ *
+ * @param request the pull request
+ * @return response
+ * @throws TException remind of thrift
+ */
@Override
public PullSchemaResp pullMeasurementSchema(PullSchemaRequest request) throws TException {
try {
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
index 059b07b..b48d5a8 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/compaction/utils/CompactionUtils.java
@@ -190,7 +190,7 @@ public class CompactionUtils {
IoTDB.metaManager.getSeriesSchema(new PartialPath(device), entry.getKey()), true);
} catch (MetadataException e) {
// this may caused in IT by restart
- logger.error("{} get schema {} error,skip this sensor", device, entry.getKey());
+ logger.error("{} get schema {} error, skip this sensor", device, entry.getKey(), e);
return;
}
for (TimeValuePair timeValuePair : timeValuePairMap.values()) {