carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [2/5] incubator-carbondata git commit: When data load and drop is executed concurrently, then even though drop didn't get lock, its table files.
Date Mon, 07 Nov 2016 11:51:55 GMT
When data load and drop is executed concurrently, then even though drop didn't get lock, its
table files.


Project: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/commit/91d94e7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/tree/91d94e7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-carbondata/diff/91d94e7a

Branch: refs/heads/branch-0.2
Commit: 91d94e7a203d5521d40866c2fc1ba1355b1e7577
Parents: 0306614
Author: Ashok <ashok.blend@gmail.com>
Authored: Thu Nov 3 07:37:59 2016 +0530
Committer: ravipesala <ravi.pesala@gmail.com>
Committed: Mon Nov 7 17:12:15 2016 +0530

----------------------------------------------------------------------
 .../apache/spark/sql/execution/command/carbonTableSchema.scala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/91d94e7a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
index 5599ae0..0e87eb9 100644
--- a/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
+++ b/integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
@@ -1258,8 +1258,10 @@ private[sql] case class DropTableCommand(ifExistsSet: Boolean, databaseNameOp:
O
     val carbonLock = CarbonLockFactory
       .getCarbonLockObj(carbonTableIdentifier, LockUsage.DROP_TABLE_LOCK)
     val storePath = CarbonEnv.getInstance(sqlContext).carbonCatalog.storePath
+    var isLocked = false
     try {
-      if (carbonLock.lockWithRetries()) {
+      isLocked = carbonLock.lockWithRetries()
+      if (isLocked) {
         logInfo("Successfully able to get the lock for drop.")
       }
       else {
@@ -1271,7 +1273,7 @@ private[sql] case class DropTableCommand(ifExistsSet: Boolean, databaseNameOp:
O
       LOGGER.audit(s"Deleted table [$tableName] under database [$dbName]")
     }
     finally {
-      if (carbonLock != null) {
+      if (carbonLock != null && isLocked) {
         if (carbonLock.unlock()) {
           logInfo("Table MetaData Unlocked Successfully after dropping the table")
           // deleting any remaining files.


Mime
View raw message