yihua commented on code in PR #12804:
URL: https://github.com/apache/hudi/pull/12804#discussion_r1960373329


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/marker/TestTimelineServerBasedWriteMarkers.java:
##########
@@ -112,6 +112,73 @@ void verifyMarkersInFileSystem(boolean isTablePartitioned) 
throws IOException {
     closeQuietly(inputStream);
   }
 
+  @Test
+  public void testCreationWithTimelineServiceRetries() throws Exception {
+    // Validate marker creation/ deletion work without any failures in the 
timeline service.
+    createSomeMarkers(true);
+    assertTrue(storage.exists(markerFolderPath));
+    writeMarkers.doesMarkerDirExist();
+
+    // Simulate only a single failure and ensure the request fails.
+    restartServerAndClient(1);
+    // validate that subsequent request fails
+    validateRequestFailed(writeMarkers::doesMarkerDirExist);
+
+    // Simulate 3 failures, but make sure the request succeeds as retries are 
enabled
+    restartServerAndClient(3);
+    // Configure a new client with retries enabled.
+    TimelineServerBasedWriteMarkers writeMarkersWithRetries = initWriteMarkers(
+        metaClient.getBasePath().toString(),
+        markerFolderPath.toString(),
+        timelineService.getServerPort(),
+        true);
+    writeMarkersWithRetries.doesMarkerDirExist();
+  }
+
+  private void restartServerAndClient(int numberOfSimulatedConnectionFailures) 
{
+    if (timelineService != null) {
+      timelineService.close();
+    }
+    try {
+      HoodieEngineContext hoodieEngineContext = new 
HoodieLocalEngineContext(metaClient.getStorageConf());
+      FileSystemViewStorageConfig storageConf =
+          
FileSystemViewStorageConfig.newBuilder().withStorageType(FileSystemViewStorageType.SPILLABLE_DISK).build();

Review Comment:
   Could we parameterize the tests based on two types of FSV, `MEMORY` 
(default) and `SPILLABLE_DISK`?



##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/marker/TestTimelineServerBasedWriteMarkers.java:
##########
@@ -112,6 +112,73 @@ void verifyMarkersInFileSystem(boolean isTablePartitioned) 
throws IOException {
     closeQuietly(inputStream);
   }
 
+  @Test
+  public void testCreationWithTimelineServiceRetries() throws Exception {
+    // Validate marker creation/ deletion work without any failures in the 
timeline service.
+    createSomeMarkers(true);
+    assertTrue(storage.exists(markerFolderPath));
+    writeMarkers.doesMarkerDirExist();
+
+    // Simulate only a single failure and ensure the request fails.
+    restartServerAndClient(1);
+    // validate that subsequent request fails
+    validateRequestFailed(writeMarkers::doesMarkerDirExist);
+
+    // Simulate 3 failures, but make sure the request succeeds as retries are 
enabled
+    restartServerAndClient(3);
+    // Configure a new client with retries enabled.
+    TimelineServerBasedWriteMarkers writeMarkersWithRetries = initWriteMarkers(
+        metaClient.getBasePath().toString(),
+        markerFolderPath.toString(),
+        timelineService.getServerPort(),
+        true);
+    writeMarkersWithRetries.doesMarkerDirExist();

Review Comment:
   Same here on asserting the result of the method call.



##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/table/marker/TestTimelineServerBasedWriteMarkers.java:
##########
@@ -112,6 +112,73 @@ void verifyMarkersInFileSystem(boolean isTablePartitioned) 
throws IOException {
     closeQuietly(inputStream);
   }
 
+  @Test
+  public void testCreationWithTimelineServiceRetries() throws Exception {
+    // Validate marker creation/ deletion work without any failures in the 
timeline service.
+    createSomeMarkers(true);
+    assertTrue(storage.exists(markerFolderPath));
+    writeMarkers.doesMarkerDirExist();

Review Comment:
   Could we assert the result of the method call?



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