[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3141: [CARBONDATA-3310]fix IndexOutOfBoundException when drop table and create table run parallel for different table

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] qiuchenjian commented on a change in pull request #3141: [CARBONDATA-3310]fix IndexOutOfBoundException when drop table and create table run parallel for different table

GitBox
qiuchenjian commented on a change in pull request #3141: [CARBONDATA-3310]fix IndexOutOfBoundException when drop table and create table run parallel for different table
URL: https://github.com/apache/carbondata/pull/3141#discussion_r263992050
 
 

 ##########
 File path: integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
 ##########
 @@ -424,16 +436,21 @@ class CarbonFileMetastore extends CarbonMetaStore {
    * @param tableName
    */
   def removeTableFromMetadata(dbName: String, tableName: String): Unit = {
-    val carbonTableToBeRemoved: Option[CarbonTable] = getTableFromMetadataCache(dbName, tableName)
-    carbonTableToBeRemoved match {
-      case Some(carbonTable) =>
-        metadata.carbonTables -= carbonTable
-      case None =>
-        if (LOGGER.isDebugEnabled) {
-          LOGGER.debug(s"No entry for table $tableName in database $dbName")
-        }
+    if (isDropAllowed) {
+      val carbonTableToBeRemoved: Option[CarbonTable] = getTableFromMetadataCache(dbName, tableName)
+      carbonTableToBeRemoved match {
+        case Some(carbonTable) =>
+          metadata.carbonTables -= carbonTable
+        case None =>
+          if (LOGGER.isDebugEnabled) {
+            LOGGER.debug(s"No entry for table $tableName in database $dbName")
+          }
+      }
+      CarbonMetadata.getInstance.removeTable(dbName, tableName)
+    } else {
+      Thread.sleep(250)
 
 Review comment:
   Better to add timeout

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[hidden email]


With regards,
Apache Git Services