carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kunal642 <...@git.apache.org>
Subject [GitHub] carbondata pull request #1168: [CARBONDATA-1229] restrict drop when loading ...
Date Thu, 13 Jul 2017 03:19:11 GMT
Github user kunal642 commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1168#discussion_r127120097
  
    --- Diff: integration/spark/src/main/scala/org/apache/spark/sql/execution/command/carbonTableSchema.scala
---
    @@ -738,27 +739,26 @@ private[sql] case class DropTableCommand(ifExistsSet: Boolean, databaseNameOp:
O
         val dbName = getDB.getDatabaseName(databaseNameOp, sqlContext)
         val identifier = TableIdentifier(tableName, Option(dbName))
         val carbonTableIdentifier = new CarbonTableIdentifier(dbName, tableName, "")
    -    val carbonLock = CarbonLockFactory.getCarbonLockObj(carbonTableIdentifier.getDatabaseName,
    -        carbonTableIdentifier.getTableName + CarbonCommonConstants.UNDERSCORE +
    -        LockUsage.DROP_TABLE_LOCK)
    -    val storePath = CarbonEnv.get.carbonMetastore.storePath
    -    var isLocked = false
    +    val locksToBeAcquired = List(LockUsage.METADATA_LOCK, LockUsage.DROP_TABLE_LOCK)
    +    val carbonLocks: scala.collection.mutable.ListBuffer[ICarbonLock] = ListBuffer()
    +    val catalog = CarbonEnv.get.carbonMetastore
    +    val storePath = catalog.storePath
         try {
    -      isLocked = carbonLock.lockWithRetries()
    -      if (isLocked) {
    -        logInfo("Successfully able to get the lock for drop.")
    -      }
    -      else {
    -        LOGGER.audit(s"Dropping table $dbName.$tableName failed as the Table is locked")
    -        sys.error("Table is locked for deletion. Please try after some time")
    +      locksToBeAcquired foreach {
    --- End diff --
    
    These 2 locks are not acquired in any other flow


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message