carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackylk <...@git.apache.org>
Subject [GitHub] carbondata pull request #1227: [CARBONDATA-1356] Delete stale folder in inse...
Date Thu, 03 Aug 2017 14:13:16 GMT
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1227#discussion_r131153070
  
    --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/util/CommonUtil.scala
---
    @@ -713,16 +714,20 @@ object CommonUtil {
                             SegmentStatusManager.readLoadMetadata(
                               carbonTablePath.getMetadataDirectoryPath)
                           var loadInprogressExist = false
    +                      val staleFolders: Seq[CarbonFile] = Seq()
                           listOfLoadFolderDetailsArray.foreach { load =>
                             if (load.getLoadStatus.equals(LoadStatusType.IN_PROGRESS.getMessage)
||
                                 load.getLoadStatus.equals(LoadStatusType.INSERT_OVERWRITE.getMessage))
{
                               load.setLoadStatus(CarbonCommonConstants.MARKED_FOR_DELETE)
    +                          staleFolders :+ FileFactory.getCarbonFile(
    +                            carbonTablePath.getCarbonDataDirectoryPath("0", load.getLoadName))
    --- End diff --
    
    It is saver to delete after writing the new table status file (line 729), if we delete
the folder here, it could result in inconsistent state if system crash between line 723 and
line 729


---
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