xl: Implement posix.DeletePrefixes to enhance delete perf (#9100)

Bulk delete API was using cleanupObjectsBulk() which calls posix
listing and delete API to remove objects internal files in the
backend (xl.json and parts) one by one.

Add DeletePrefixes in the storage API to remove the content
of a directory in a single call.

Also use a remove goroutine for each disk to accelerate removal.
This commit is contained in:
Anis Elleuch
2020-03-11 08:56:36 -07:00
committed by GitHub
parent 7c32f3f554
commit 0af62d35a0
10 changed files with 226 additions and 110 deletions

View File

@@ -196,6 +196,13 @@ func (d *naughtyDisk) DeleteFileBulk(volume string, paths []string) ([]error, er
return errs, nil
}
func (d *naughtyDisk) DeletePrefixes(volume string, paths []string) ([]error, error) {
if err := d.calcError(); err != nil {
return nil, err
}
return d.disk.DeletePrefixes(volume, paths)
}
func (d *naughtyDisk) WriteAll(volume string, path string, reader io.Reader) (err error) {
if err := d.calcError(); err != nil {
return err