mirror of
https://github.com/minio/minio.git
synced 2025-11-21 18:26:04 -05:00
listobjectversions: Add shortcut for Veeam blocks (#10893)
Add shortcut for `APN/1.0 Veeam/1.0 Backup/10.0` It requests unique blocks with a specific prefix. We skip scanning the parent directory for more objects matching the prefix.
This commit is contained in:
@@ -24,6 +24,7 @@ import (
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -662,7 +663,8 @@ func (z *erasureServerSets) ListObjectVersions(ctx context.Context, bucket, pref
|
||||
if marker == "" && versionMarker != "" {
|
||||
return loi, NotImplemented{}
|
||||
}
|
||||
merged, err := z.listPath(ctx, listPathOptions{
|
||||
|
||||
opts := listPathOptions{
|
||||
Bucket: bucket,
|
||||
Prefix: prefix,
|
||||
Separator: delimiter,
|
||||
@@ -670,7 +672,19 @@ func (z *erasureServerSets) ListObjectVersions(ctx context.Context, bucket, pref
|
||||
Marker: marker,
|
||||
InclDeleted: true,
|
||||
AskDisks: globalAPIConfig.getListQuorum(),
|
||||
})
|
||||
}
|
||||
|
||||
// Shortcut for APN/1.0 Veeam/1.0 Backup/10.0
|
||||
// It requests unique blocks with a specific prefix.
|
||||
// We skip scanning the parent directory for
|
||||
// more objects matching the prefix.
|
||||
ri := logger.GetReqInfo(ctx)
|
||||
if ri != nil && strings.Contains(ri.UserAgent, `1.0 Veeam/1.0 Backup`) && strings.HasSuffix(prefix, ".blk") {
|
||||
opts.singleObject = true
|
||||
opts.Transient = true
|
||||
}
|
||||
|
||||
merged, err := z.listPath(ctx, opts)
|
||||
if err != nil && err != io.EOF {
|
||||
return loi, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user