mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: optimize parentDirIsObject by moving isObject to storage layer (#11291)
For objects with `N` prefix depth, this PR reduces `N` such network operations by converting `CheckFile` into a single bulk operation. Reduction in chattiness here would allow disks to be utilized more cleanly, while maintaining the same functionality along with one extra volume check stat() call is removed. Update tests to test multiple sets scenario
This commit is contained in:
@@ -1657,6 +1657,10 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
t.Fatalf("Unable to create file, %s", err)
|
||||
}
|
||||
|
||||
if err := xlStorage.MakeVol(context.Background(), "success-vol/path/to/"+xlStorageFormatFile); err != nil {
|
||||
t.Fatalf("Unable to create path, %s", err)
|
||||
}
|
||||
|
||||
testCases := []struct {
|
||||
srcVol string
|
||||
srcPath string
|
||||
@@ -1695,7 +1699,7 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
{
|
||||
srcVol: "success-vol",
|
||||
srcPath: "path",
|
||||
expectedErr: errFileNotFound,
|
||||
expectedErr: errPathNotFound,
|
||||
},
|
||||
// TestXLStorage case - 6.
|
||||
// TestXLStorage case with non existent volume.
|
||||
@@ -1704,6 +1708,13 @@ func TestXLStorageCheckFile(t *testing.T) {
|
||||
srcPath: "success-file",
|
||||
expectedErr: errPathNotFound,
|
||||
},
|
||||
// TestXLStorage case - 7.
|
||||
// TestXLStorage case with file with directory.
|
||||
{
|
||||
srcVol: "success-vol",
|
||||
srcPath: "path/to",
|
||||
expectedErr: errFileNotFound,
|
||||
},
|
||||
}
|
||||
|
||||
for i, testCase := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user