Github user ravipesala commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/2045#discussion_r174233092
--- Diff:
core/src/main/java/org/apache/carbondata/core/locks/CarbonLockUtil.java ---
@@ -107,4 +114,36 @@ public static int getLockProperty(String property, int
defaultValue) {
}
}
+ /**
+ * Currently the segment lock files are not deleted immediately when
unlock,
+ * so it needs to delete expired lock files before delete loads.
+ */
+ public static void deleteExpiredSegmentLockFiles(CarbonTable
carbonTable) {
+ LoadMetadataDetails[] details =
--- End diff --
I think you can better list the segment lock files from locks folder and
check the modified time of it and remove . Otherwise if you do as per
tablestatus then namenode calls would be many.
---