Browse Source

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.
pull/20569/head
Anis Eleuch 10 months ago
committed by Harshavardhana
parent
commit
7ebceacac6
  1. 11
      cmd/storage-rest-client.go

11
cmd/storage-rest-client.go

@ -20,7 +20,6 @@ package cmd
import (
"bytes"
"context"
"encoding/gob"
"encoding/hex"
"errors"
"fmt"
@ -842,12 +841,16 @@ func (client *storageRESTClient) VerifyFile(ctx context.Context, volume, path st
return nil, toStorageErr(err)
}
verifyResp := &CheckPartsResp{}
if err = gob.NewDecoder(respReader).Decode(verifyResp); err != nil {
dec := msgpNewReader(respReader)
defer readMsgpReaderPoolPut(dec)
verifyResp := CheckPartsResp{}
err = verifyResp.DecodeMsg(dec)
if err != nil {
return nil, toStorageErr(err)
}
return verifyResp, nil
return &verifyResp, nil
}
func (client *storageRESTClient) DeleteBulk(ctx context.Context, volume string, paths ...string) (err error) {

Loading…
Cancel
Save