the-other-tim-brown commented on code in PR #18073:
URL: https://github.com/apache/hudi/pull/18073#discussion_r2770621592


##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/handlers/marker/MarkerDirState.java:
##########
@@ -265,13 +286,14 @@ public void processMarkerCreationRequests(
    */
   public boolean deleteAllMarkers() {
     boolean result = FSUtils.deleteDir(hoodieEngineContext, storage, 
markerDirPath, parallelism);
-    allMarkers.clear();
+    markerToRequestIdMap.clear();
     fileMarkersMap.clear();
     return result;
   }
 
   /**
    * Syncs all markers maintained in the underlying files under the marker 
directory in the file system.
+   * When TLS recovers from crash, we have no request IDs so store sentinel 
value for each marker.

Review Comment:
   Right now we will allow the request to succeed if they are both 
`NULL_REQUEST_ID` which is different from existing behavior where we fail in 
this case. I think it is easier to reason about if we don't backfill this map. 



##########
hudi-timeline-service/src/main/java/org/apache/hudi/timeline/service/handlers/marker/MarkerDirState.java:
##########
@@ -174,23 +197,34 @@ public List<MarkerCreationFuture> 
fetchPendingMarkerCreationRequests() {
   }
 
   /**
-   * @param shouldClear Should clear the internal request list or not.
+   * @param shouldClear Should clear the internal request map or not.
    * @return futures of pending marker creation requests.
    */
   public List<MarkerCreationFuture> getPendingMarkerCreationRequests(boolean 
shouldClear) {
-    List<MarkerCreationFuture> pendingFutures;
-    synchronized (markerCreationFutures) {
-      if (markerCreationFutures.isEmpty()) {
-        return new ArrayList<>();
-      }
-      pendingFutures = new ArrayList<>(markerCreationFutures);
-      if (shouldClear) {
-        markerCreationFutures.clear();
-      }
+    if (inflightRequestMap.isEmpty()) {
+      return new ArrayList<>();

Review Comment:
   Nit: use `Collections.emptyList()` when you need empty lists to avoid 
allocating a new array.



-- 
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: [email protected]

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

Reply via email to