ajantha-bhat commented on a change in pull request #3435: [CARBONDATA-3571] Add 
table status file read retry for query
URL: https://github.com/apache/carbondata/pull/3435#discussion_r346735732
 
 

 ##########
 File path: 
core/src/main/java/org/apache/carbondata/core/statusmanager/SegmentStatusManager.java
 ##########
 @@ -254,33 +261,51 @@ public ValidAndInvalidSegmentsInfo 
getValidAndInvalidSegments(Boolean isChildTab
     DataInputStream dataInputStream = null;
     BufferedReader buffReader = null;
     InputStreamReader inStream = null;
-    LoadMetadataDetails[] listOfLoadFolderDetailsArray;
+    LoadMetadataDetails[] loadFolderDetails = null;
     AtomicFileOperations fileOperation =
         AtomicFileOperationFactory.getAtomicFileOperations(tableStatusPath);
 
-    try {
-      if (!FileFactory.isFileExist(tableStatusPath, 
FileFactory.getFileType(tableStatusPath))) {
-        return new LoadMetadataDetails[0];
+    // When storing table status file in object store, reading of table status 
file may
+    // fail (receive EOFException) when table status file is being modifying
+    // so here we retry multiple times before throwing EOFException
+    int retry = READ_TABLE_STATUS_RETRY_COUNT;
+    while (retry > 0) {
+      try {
+        if (!FileFactory.isFileExist(tableStatusPath, 
FileFactory.getFileType(tableStatusPath))) {
 
 Review comment:
   can we move it outside retry ?
   Because we already checked for file exist. Only read has failed. so just 
retry read should be ok. Check file exist again in S3 may take some time. 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

Reply via email to