mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
HealBucket: create the bucket if it is missing in one of the disks. (#2924)
This commit is contained in:
committed by
Harshavardhana
parent
3349153058
commit
0320a77dc0
@@ -345,4 +345,21 @@ func TestHealObject(t *testing.T) {
|
||||
if !reflect.DeepEqual(xlMetaPreHeal, xlMetaPostHeal) {
|
||||
t.Fatal("HealObject failed")
|
||||
}
|
||||
|
||||
// Remove the bucket - to simulate the case where bucket was created when the
|
||||
// disk was down.
|
||||
err = os.RemoveAll(path.Join(fsDirs[0], bucket))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// This would create the bucket.
|
||||
err = xl.HealObject(bucket, "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Stat the bucket to make sure that it was created.
|
||||
_, err = xl.storageDisks[0].StatVol(bucket)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user