Github user ravipesala commented on a diff in the pull request:
@@ -107,4 +114,36 @@ public static int getLockProperty(String property, int
+ * Currently the segment lock files are not deleted immediately when
+ * so it needs to delete expired lock files before delete loads.
+ public static void deleteExpiredSegmentLockFiles(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.