mirror of
https://github.com/minio/minio.git
synced 2025-11-20 09:56:07 -05:00
fix: multi-delete API write quorum failures (#8926)
multi-delete API failed with write quorum errors under following situations - list of files requested for delete doesn't exist anymore can lead to quorum errors and failure - due to usage of query param for paths, for really long paths MinIO server rejects these requests as malformed as unexpected. This was reproduced with warp
This commit is contained in:
@@ -245,7 +245,7 @@ func (client *storageRESTClient) AppendFile(volume, path string, buffer []byte)
|
||||
values := make(url.Values)
|
||||
values.Set(storageRESTVolume, volume)
|
||||
values.Set(storageRESTFilePath, path)
|
||||
reader := bytes.NewBuffer(buffer)
|
||||
reader := bytes.NewReader(buffer)
|
||||
respBody, err := client.call(storageRESTMethodAppendFile, values, reader, -1)
|
||||
defer http.DrainBody(respBody)
|
||||
return err
|
||||
@@ -405,10 +405,14 @@ func (client *storageRESTClient) DeleteFileBulk(volume string, paths []string) (
|
||||
}
|
||||
values := make(url.Values)
|
||||
values.Set(storageRESTVolume, volume)
|
||||
|
||||
var buffer bytes.Buffer
|
||||
for _, path := range paths {
|
||||
values.Add(storageRESTFilePath, path)
|
||||
buffer.WriteString(path)
|
||||
buffer.WriteString("\n")
|
||||
}
|
||||
respBody, err := client.call(storageRESTMethodDeleteFileBulk, values, nil, -1)
|
||||
|
||||
respBody, err := client.call(storageRESTMethodDeleteFileBulk, values, &buffer, -1)
|
||||
defer http.DrainBody(respBody)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user