Github user kunal642 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1844#discussion_r163459153 --- Diff: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java --- @@ -700,11 +708,28 @@ public static Boolean checkIfAnyLoadInProgressForTable(CarbonTable carbonTable) SegmentStatus segmentStatus = loaddetail.getSegmentStatus(); if (segmentStatus == SegmentStatus.INSERT_IN_PROGRESS || segmentStatus == SegmentStatus.INSERT_OVERWRITE_IN_PROGRESS) { - loadInProgress = true; + loadInProgress = + checkIfValidLoadInProgress(carbonTable.getAbsoluteTableIdentifier(), + loaddetail.getLoadName()); } } } return loadInProgress; } + public static Boolean checkIfValidLoadInProgress(AbsoluteTableIdentifier absoluteTableIdentifier, --- End diff -- please add method description --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1844#discussion_r164338912 --- Diff: core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java --- @@ -700,11 +708,30 @@ public static Boolean checkIfAnyLoadInProgressForTable(CarbonTable carbonTable) SegmentStatus segmentStatus = loaddetail.getSegmentStatus(); if (segmentStatus == SegmentStatus.INSERT_IN_PROGRESS || segmentStatus == SegmentStatus.INSERT_OVERWRITE_IN_PROGRESS) { - loadInProgress = true; + loadInProgress = + checkIfValidLoadInProgress(carbonTable.getAbsoluteTableIdentifier(), + loaddetail.getLoadName()); } } } return loadInProgress; } + /** + * This method will check for valid IN_PROGRESS segments. + * Tries to acquire a lock on the segment and decide on the stale segments + * @param absoluteTableIdentifier + * + */ + public static Boolean checkIfValidLoadInProgress(AbsoluteTableIdentifier absoluteTableIdentifier, + String loadId) { + ICarbonLock segmentLock = CarbonLockFactory.getCarbonLockObj(absoluteTableIdentifier, + CarbonTablePath.addSegmentPrefix(loadId) + LockUsage.LOCK); + try { + return !segmentLock.lockWithRetries(1, 5); --- End diff -- Make the retrycountinterval to 0 as if after 1st time we are not able to acquire the lock that means it is a valid InProgress segment. !segmentLock.lockWithRetries(1, 0) --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1844 Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder1/3207/ --- |
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:
https://github.com/apache/carbondata/pull/1844 Build Success with Spark 2.2.1, Please check CI http://88.99.58.216:8080/job/ApacheCarbonPRBuilder/1974/ --- |
In reply to this post by qiuchenjian-2
Github user manishgupta88 commented on the issue:
https://github.com/apache/carbondata/pull/1844 LGTM --- |
In reply to this post by qiuchenjian-2
|
In reply to this post by qiuchenjian-2
Github user ravipesala commented on the issue:
https://github.com/apache/carbondata/pull/1844 SDV Build Success , Please check CI http://144.76.159.231:8080/job/ApacheSDVTests/3173/ --- |
Free forum by Nabble | Edit this page |