mirror of https://github.com/minio/minio.git
heal: Fix deep scan failing to heal objects (#117)
The verify file handler response format was changed from gob to msgp since two months but we forgot updating the verify handler client. VerifyFile is only called during a heal deep scan (bitrot check). HealObject() will fail in that case and will mark all disks corrupted and will return early (as unrecoverable object but it will also not be removed) It is a bit rare for HealObject to be called with a deep scan flag. It is called when a HealObject with a normal scan (e.g. new drive healing) detects a bitrot corruption, therefore healing objects with a detected bitrot corruption will fail.
This commit is contained in:
parent
1593cb615d
commit
7ebceacac6
|
@ -20,7 +20,6 @@ package cmd
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/gob"
|
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
@ -842,12 +841,16 @@ func (client *storageRESTClient) VerifyFile(ctx context.Context, volume, path st
|
||||||
return nil, toStorageErr(err)
|
return nil, toStorageErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyResp := &CheckPartsResp{}
|
dec := msgpNewReader(respReader)
|
||||||
if err = gob.NewDecoder(respReader).Decode(verifyResp); err != nil {
|
defer readMsgpReaderPoolPut(dec)
|
||||||
|
|
||||||
|
verifyResp := CheckPartsResp{}
|
||||||
|
err = verifyResp.DecodeMsg(dec)
|
||||||
|
if err != nil {
|
||||||
return nil, toStorageErr(err)
|
return nil, toStorageErr(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return verifyResp, nil
|
return &verifyResp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *storageRESTClient) DeleteBulk(ctx context.Context, volume string, paths ...string) (err error) {
|
func (client *storageRESTClient) DeleteBulk(ctx context.Context, volume string, paths ...string) (err error) {
|
||||||
|
|
Loading…
Reference in New Issue