akashrn5 commented on a change in pull request #3907:
URL: https://github.com/apache/carbondata/pull/3907#discussion_r481226211



##########
File path: 
core/src/main/java/org/apache/carbondata/core/index/IndexStoreManager.java
##########
@@ -515,15 +516,16 @@ public TableSegmentRefresher 
getTableSegmentRefresher(CarbonTable table) {
         UpdateVO updateVO =
             
SegmentUpdateStatusManager.getInvalidTimestampRange(segment.getLoadMetadataDetails());
         SegmentRefreshInfo segmentRefreshInfo;
-        if ((updateVO != null && updateVO.getLatestUpdateTimestamp() != null)
-            || segment.getSegmentFileName() != null) {
-          long segmentFileTimeStamp;
+        if (updateVO.getLatestUpdateTimestamp() != null || 
segment.getSegmentFileName() != null) {
+          long segmentFileTimeStamp = 0L;
           if (null != segment.getLoadMetadataDetails()) {
             segmentFileTimeStamp = 
segment.getLoadMetadataDetails().getLastModifiedTime();
           } else {
-            segmentFileTimeStamp = FileFactory.getCarbonFile(CarbonTablePath
-                .getSegmentFilePath(table.getTablePath(), 
segment.getSegmentFileName()))
-                .getLastModifiedTime();
+            CarbonFile segmentFile = FileFactory.getCarbonFile(CarbonTablePath
+                .getSegmentFilePath(table.getTablePath(), 
segment.getSegmentFileName()));
+            if (segmentFile.exists()) {

Review comment:
       > actually it depends on how the segment object is made, since we have 
many methods to do it, These all things can be avoided when the segment 
refactoring is done, as already discussions are going on.
   
   > actually we have segment lock for actual segments, not the segment file 
which is metadata, that is the problem, its not like table status file. So 
during segment refactor we can consider these things into consideration and 
design it to avoid all these things, But now for existing users it will create, 
issue so we can consider this change.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to