You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/08/02 21:59:13 UTC

[GitHub] [hudi] xushiyan commented on a diff in pull request #6266: [HUDI-4517] If no marker type file, fallback to timeline based marker

xushiyan commented on code in PR #6266:
URL: https://github.com/apache/hudi/pull/6266#discussion_r936060381


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/marker/MarkerBasedRollbackUtils.java:
##########
@@ -56,10 +56,16 @@ public static List<String> getAllMarkerPaths(HoodieTable table, HoodieEngineCont
     FileSystem fileSystem = table.getMetaClient().getFs();
     Option<MarkerType> markerTypeOption = MarkerUtils.readMarkerType(fileSystem, markerDir);
 
-    // If there is no marker type file "MARKERS.type", we assume "DIRECT" markers are used
+    // If there is no marker type file "MARKERS.type", first assume "DIRECT" markers are used.
+    // If not, then fallback to "TIMELINE_SERVER_BASED" markers.
     if (!markerTypeOption.isPresent()) {
       WriteMarkers writeMarkers = WriteMarkersFactory.get(MarkerType.DIRECT, table, instant);
-      return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      try {
+        return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      } catch (Exception e) {

Review Comment:
   default is TIMELINE_SERVER_BASED, why not assume TIMELINE_SERVER_BASED first then fallback?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/marker/MarkerBasedRollbackUtils.java:
##########
@@ -56,10 +56,16 @@ public static List<String> getAllMarkerPaths(HoodieTable table, HoodieEngineCont
     FileSystem fileSystem = table.getMetaClient().getFs();
     Option<MarkerType> markerTypeOption = MarkerUtils.readMarkerType(fileSystem, markerDir);
 
-    // If there is no marker type file "MARKERS.type", we assume "DIRECT" markers are used
+    // If there is no marker type file "MARKERS.type", first assume "DIRECT" markers are used.
+    // If not, then fallback to "TIMELINE_SERVER_BASED" markers.
     if (!markerTypeOption.isPresent()) {
       WriteMarkers writeMarkers = WriteMarkersFactory.get(MarkerType.DIRECT, table, instant);
-      return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      try {
+        return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      } catch (Exception e) {

Review Comment:
   shouldn't there be some specific exception for this case to catch?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/marker/MarkerBasedRollbackUtils.java:
##########
@@ -56,10 +56,16 @@ public static List<String> getAllMarkerPaths(HoodieTable table, HoodieEngineCont
     FileSystem fileSystem = table.getMetaClient().getFs();
     Option<MarkerType> markerTypeOption = MarkerUtils.readMarkerType(fileSystem, markerDir);
 
-    // If there is no marker type file "MARKERS.type", we assume "DIRECT" markers are used
+    // If there is no marker type file "MARKERS.type", first assume "DIRECT" markers are used.
+    // If not, then fallback to "TIMELINE_SERVER_BASED" markers.
     if (!markerTypeOption.isPresent()) {
       WriteMarkers writeMarkers = WriteMarkersFactory.get(MarkerType.DIRECT, table, instant);
-      return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      try {
+        return new ArrayList<>(writeMarkers.allMarkerFilePaths());
+      } catch (Exception e) {

Review Comment:
   also can you clarify in what cases we may have marker type not known?



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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org