mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fix: Speed up multi-object delete by taking bulk locks (#8974)
Change distributed locking to allow taking bulk locks
across objects, reduces usually 1000 calls to 1.
Also allows for situations where multiple clients sends
delete requests to objects with following names
```
{1,2,3,4,5}
```
```
{5,4,3,2,1}
```
will block and ensure that we do not fail the request
on each other.
This commit is contained in:
@@ -198,6 +198,16 @@ func retainSlash(s string) string {
|
||||
return strings.TrimSuffix(s, SlashSeparator) + SlashSeparator
|
||||
}
|
||||
|
||||
// pathsJoinPrefix - like pathJoin retains trailing SlashSeparator
|
||||
// for all elements, prepends them with 'prefix' respectively.
|
||||
func pathsJoinPrefix(prefix string, elem ...string) (paths []string) {
|
||||
paths = make([]string, len(elem))
|
||||
for i, e := range elem {
|
||||
paths[i] = pathJoin(prefix, e)
|
||||
}
|
||||
return paths
|
||||
}
|
||||
|
||||
// pathJoin - like path.Join() but retains trailing SlashSeparator of the last element
|
||||
func pathJoin(elem ...string) string {
|
||||
trailingSlash := ""
|
||||
|
||||
Reference in New Issue
Block a user