Github user zzcclp commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2045#discussion_r174338430 --- 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 it is better to use this method to check the status and last modified time of the segment at the same time. As the size of the tablestatus file is getting larger, it is a problem, there are many places will scan this file, not just here, we need to solve this problem. I have raise a [topic](http://apache-carbondata-dev-mailing-list-archive.1130556.n5.nabble.com/The-size-of-the-tablestatus-file-is-getting-larger-does-it-impact-the-performance-of-reading-this-fi-td41941.html) to discuss this on mailling list.
---