Increase reserve on ScaleIO disk formatting for fragmentation (#7955)

Signed-off-by: Marcus Sorensen <mls@apple.com>
Co-authored-by: Marcus Sorensen <mls@apple.com>
This commit is contained in:
Marcus Sorensen 2023-09-14 05:13:16 -06:00 committed by GitHub
parent b8c8e17318
commit f049d4d189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -552,12 +552,12 @@ public class ScaleIOStorageAdaptor implements StorageAdaptor {
/** /**
* Calculates usable size from raw size, assuming qcow2 requires 192k/1GB for metadata * Calculates usable size from raw size, assuming qcow2 requires 192k/1GB for metadata
* We also remove 32MiB for potential encryption/safety factor. * We also remove 128MiB for encryption/fragmentation/safety factor.
* @param raw size in bytes * @param raw size in bytes
* @return usable size in bytesbytes * @return usable size in bytesbytes
*/ */
public static long getUsableBytesFromRawBytes(Long raw) { public static long getUsableBytesFromRawBytes(Long raw) {
long usable = raw - (32 << 20) - ((raw >> 30) * 200704); long usable = raw - (128 << 20) - ((raw >> 30) * 200704);
if (usable < 0) { if (usable < 0) {
usable = 0L; usable = 0L;
} }

View File

@ -23,9 +23,9 @@ import org.junit.Test;
public class ScaleIOStorageAdaptorTest { public class ScaleIOStorageAdaptorTest {
@Test @Test
public void getUsableBytesFromRawBytesTest() { public void getUsableBytesFromRawBytesTest() {
Assert.assertEquals("Overhead calculated for 8Gi size", 8554774528L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(8L << 30)); Assert.assertEquals("Overhead calculated for 8Gi size", 8454111232L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(8L << 30));
Assert.assertEquals("Overhead calculated for 4Ti size", 4294130925568L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(4000L << 30)); Assert.assertEquals("Overhead calculated for 4Ti size", 4294030262272L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(4000L << 30));
Assert.assertEquals("Overhead calculated for 500Gi size", 536737005568L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(500L << 30)); Assert.assertEquals("Overhead calculated for 500Gi size", 536636342272L, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(500L << 30));
Assert.assertEquals("Unsupported small size", 0, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(1L)); Assert.assertEquals("Unsupported small size", 0, ScaleIOStorageAdaptor.getUsableBytesFromRawBytes(1L));
} }
} }