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:
Anis Eleuch 2024-10-12 23:10:19 +01:00 committed by Harshavardhana
parent 1593cb615d
commit 7ebceacac6
1 changed files with 7 additions and 4 deletions

View File

@ -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) {