JackieTien97 commented on code in PR #11773:
URL: https://github.com/apache/iotdb/pull/11773#discussion_r1434829495


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/AnalyzeVisitor.java:
##########
@@ -2579,10 +2580,15 @@ public Analysis visitPipeEnrichedStatement(
     return analysis;
   }
 
+  /*
+   * This function will acquire a read lock on datanode's schema cache.
+   */
   private void validateSchema(
       Analysis analysis, InsertBaseStatement insertStatement, MPPQueryContext 
context) {
     final long startTime = System.nanoTime();
     try {
+      DataNodeSchemaCache.getInstance().takeReadLock();
+      context.setAcquiredLock(true);

Review Comment:
   Better to move these lines to the two `validate` methods of 
`SchemaValidator`. We should taka account for load.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to