You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/02/20 02:37:09 UTC

[GitHub] [iotdb] OneSizeFitsQuorum commented on a change in pull request #5072: [IOTDB-2557] Fix non-data-read QueryContext in getAllMeasurementSchema

OneSizeFitsQuorum commented on a change in pull request #5072:
URL: https://github.com/apache/iotdb/pull/5072#discussion_r810560727



##########
File path: cluster/src/main/java/org/apache/iotdb/cluster/query/LocalQueryExecutor.java
##########
@@ -602,16 +602,15 @@ public long querySingleSeriesByTimestamp(SingleSeriesQueryRequest request)
     }
   }
 
-  public ByteBuffer getAllMeasurementSchema(ByteBuffer planBuffer)
+  public ByteBuffer getAllMeasurementSchema(MeasurementSchemaRequest request)
       throws CheckConsistencyException, IOException, MetadataException {
     dataGroupMember.syncLeaderWithConsistencyCheck(false);
 
-    ShowTimeSeriesPlan plan = (ShowTimeSeriesPlan) PhysicalPlan.Factory.create(planBuffer);
+    ShowTimeSeriesPlan plan = (ShowTimeSeriesPlan) PhysicalPlan.Factory.create(request.planBinary);
     List<ShowTimeSeriesResult> allTimeseriesSchema;
-    allTimeseriesSchema =
-        getCMManager()
-            .showLocalTimeseries(
-                plan, new QueryContext(SessionManager.getInstance().requestQueryId(false)));
+    RemoteQueryContext queryContext =
+        queryManager.getQueryContext(request.getRequester(), request.getQueryId());
+    allTimeseriesSchema = getCMManager().showLocalTimeseries(plan, queryContext);

Review comment:
       Looks reasonable, but if we pass the queryId this way, we need to send an endQuery request from the coordinator node after the query completes to clean up the resources in the queryManager, otherwise there will be a memory leak. So far I haven't found any code related to resource cleaning, what do you think?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org