Github user sujith71955 commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/156#discussion_r79187047
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataRDDFactory.scala
 ---
    @@ -1077,19 +1077,38 @@ object CarbonDataRDDFactory extends Logging {
           val segmentStatusManager = new 
SegmentStatusManager(table.getAbsoluteTableIdentifier)
           val details = segmentStatusManager
             .readLoadMetadata(loadMetadataFilePath)
    +      val carbonTableStatusLock = CarbonLockFactory
    +        
.getCarbonLockObj(table.getAbsoluteTableIdentifier.getCarbonTableIdentifier,
    +          LockUsage.TABLE_STATUS_LOCK)
     
           // Delete marked loads
           val isUpdationRequired = DeleteLoadFolders
             .deleteLoadFoldersFromFileSystem(carbonLoadModel, 
hdfsStoreLocation,
               partitioner.partitionCount, isForceDeletion, details)
     
           if (isUpdationRequired) {
    +        try {
             // Update load metadate file after cleaning deleted nodes
    -        CarbonLoaderUtil.writeLoadMetadata(
    -          carbonLoadModel.getCarbonDataLoadSchema,
    -          carbonLoadModel.getDatabaseName,
    -          carbonLoadModel.getTableName, details.toList.asJava
    -        )
    +        if (carbonTableStatusLock.lockWithRetries()) {
    +          logger.info("Table status lock has been successfully acquired.")
    +          CarbonLoaderUtil.writeLoadMetadata(
    +            carbonLoadModel.getCarbonDataLoadSchema,
    +            carbonLoadModel.getDatabaseName,
    +            carbonLoadModel.getTableName, details.toList.asJava
    +          )
    +        }
    +        else {
    +          val errorMsg = "Clean files request is failed for " + 
carbonLoadModel.getDatabaseName +
    +                         "." + carbonLoadModel.getTableName +
    +                         ". Not able to acquire the table status lock."
    --- End diff --
    
    also mention that "due to  other operation running in the  background ", 
this message will give more clear picture to user about the task failure


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to