sadanand48 commented on code in PR #10185:
URL: https://github.com/apache/ozone/pull/10185#discussion_r3440715469


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOMDbCheckpointServletInodeBasedXfer.java:
##########
@@ -1005,6 +1015,51 @@ public static Map<String, List<String>> 
readFileToMap(String filePath) throws IO
     return dataMap;
   }
 
+  /**
+   * Follower bootstrap must abort before streaming when the leader's SST 
estimate header
+   * implies more free space than is available (v2 inode-based checkpoint URL).
+   */
+  @Test
+  public void 
testBootstrapSnapshotDownloadAbortsWhenDiskSpaceBelowLeaderSstEstimateV2()

Review Comment:
   done.



##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis_snapshot/TestOmRatisSnapshotProvider.java:
##########
@@ -80,6 +87,46 @@ public void setup(@TempDir File snapshotDir,
             false, connectionFactory);
   }
 
+  @Test
+  public void testIsDiskFullOrQuotaIOExceptionDetectsNoSpaceMessage() {
+    assertTrue(OmRatisSnapshotProvider.isDiskFullOrQuotaIOException(
+        new IOException("No space left on device")));
+  }
+
+  @Test
+  public void 
testIsDiskFullOrQuotaIOExceptionDetectsFileSystemExceptionReason() {
+    IOException wrapped = new IOException("write failed",
+        new FileSystemException("p", null, "No space left on device"));
+    assertTrue(OmRatisSnapshotProvider.isDiskFullOrQuotaIOException(wrapped));
+  }
+
+  @Test
+  public void testIsDiskFullOrQuotaIOExceptionReturnsFalseForOtherErrors() {
+    assertFalse(OmRatisSnapshotProvider.isDiskFullOrQuotaIOException(
+        new IOException("Connection reset")));
+  }
+
+  @Test
+  public void testBootstrapDiskSpaceCheckSkippedWhenZero(@TempDir File 
snapshotDir) {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OMConfigKeys.OZONE_OM_BOOTSTRAP_MIN_SPACE_KEY, "0GB");
+    OmRatisSnapshotProvider provider =
+        new OmRatisSnapshotProvider(conf, snapshotDir, new HashMap<>());
+    assertDoesNotThrow(() -> provider.ensureBootstrapDiskSpace());
+  }
+
+  @Test
+  public void testBootstrapDiskSpaceCheckFailsWhenBelowMinimum(@TempDir File 
snapshotDir) {
+    OzoneConfiguration conf = new OzoneConfiguration();
+    conf.set(OMConfigKeys.OZONE_OM_BOOTSTRAP_MIN_SPACE_KEY, "1024EB");
+    OmRatisSnapshotProvider provider =
+        new OmRatisSnapshotProvider(conf, snapshotDir, new HashMap<>());
+    IOException ex =
+        assertThrows(IOException.class, provider::ensureBootstrapDiskSpace);
+    assertEquals(true,
+        
ex.getMessage().contains(OMConfigKeys.OZONE_OM_BOOTSTRAP_MIN_SPACE_KEY));

Review Comment:
   done



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to