mirror of https://github.com/milvus-io/milvus.git
fix: Folders are also considered for WalkWithObjects to adhere bulk insert failure on using GCS buckets (#39352)
Related task: [#39134 ](https://github.com/milvus-io/milvus/issues/39134) Previous PR: [#39150 ](https://github.com/milvus-io/milvus/pull/39150)pull/39420/head
parent
5b35fc700d
commit
f54e8e9554
|
@ -170,10 +170,13 @@ func (gcs *GcpNativeObjectStorage) WalkWithObjects(ctx context.Context,
|
||||||
return checkObjectStorageError(prefix, err)
|
return checkObjectStorageError(prefix, err)
|
||||||
}
|
}
|
||||||
if objAttrs.Prefix != "" {
|
if objAttrs.Prefix != "" {
|
||||||
continue
|
if !walkFunc(&ChunkObjectInfo{FilePath: objAttrs.Prefix, ModifyTime: objAttrs.Updated}) {
|
||||||
}
|
return nil
|
||||||
if !walkFunc(&ChunkObjectInfo{FilePath: objAttrs.Name, ModifyTime: objAttrs.Updated}) {
|
}
|
||||||
return nil
|
} else if objAttrs.Name != "" {
|
||||||
|
if !walkFunc(&ChunkObjectInfo{FilePath: objAttrs.Name, ModifyTime: objAttrs.Updated}) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -147,14 +147,11 @@ func TestGcpNativeObjectStorage(t *testing.T) {
|
||||||
value []byte
|
value []byte
|
||||||
}{
|
}{
|
||||||
{false, "abc/", []byte("123")},
|
{false, "abc/", []byte("123")},
|
||||||
{true, "abc/d/", []byte("1234")},
|
{true, "abc/d", []byte("1234")},
|
||||||
{false, "abc/d/e", []byte("12345")},
|
|
||||||
{true, "abc/e/d", []byte("12354")},
|
{true, "abc/e/d", []byte("12354")},
|
||||||
{true, "key_/1/1", []byte("111")},
|
{true, "key_/1/1", []byte("111")},
|
||||||
{true, "key_/1/2/", []byte("222")},
|
{true, "key_/1/2", []byte("222")},
|
||||||
{false, "key_/1/2/3", []byte("333")},
|
|
||||||
{true, "key_/2/3", []byte("333")},
|
{true, "key_/2/3", []byte("333")},
|
||||||
{true, "key_/test.txt", []byte("333")},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range prepareTests {
|
for _, test := range prepareTests {
|
||||||
|
@ -172,10 +169,10 @@ func TestGcpNativeObjectStorage(t *testing.T) {
|
||||||
prefix string
|
prefix string
|
||||||
expectedValue []string
|
expectedValue []string
|
||||||
}{
|
}{
|
||||||
{true, "abc/", []string{"abc/e/d"}},
|
{true, "abc/", []string{"abc/d", "abc/e/d"}},
|
||||||
{true, "key_/", []string{"key_/1/1", "key_/2/3", "key_/test.txt"}},
|
{true, "key_/", []string{"key_/1/1", "key_/1/2", "key_/2/3"}},
|
||||||
{false, "abc/", []string{}},
|
{false, "abc/", []string{"abc/d", "abc/e/"}},
|
||||||
{false, "key_/", []string{"key_/test.txt"}},
|
{false, "key_/", []string{"key_/1/", "key_/2/"}},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, test := range insertWithPrefixTests {
|
for _, test := range insertWithPrefixTests {
|
||||||
|
|
Loading…
Reference in New Issue