mirror of
https://github.com/minio/minio.git
synced 2025-07-14 11:21:52 -04:00
replication: Avoid proxying if requested object is a deletemarker (#19656)
Fixes: #19654
This commit is contained in:
parent
04f92f1291
commit
446c760820
@ -488,6 +488,8 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj
|
|||||||
reader *GetObjectReader
|
reader *GetObjectReader
|
||||||
perr error
|
perr error
|
||||||
)
|
)
|
||||||
|
// avoid proxying if version is a delete marker
|
||||||
|
if !isErrMethodNotAllowed(err) && !(gr != nil && gr.ObjInfo.DeleteMarker) {
|
||||||
proxytgts := getProxyTargets(ctx, bucket, object, opts)
|
proxytgts := getProxyTargets(ctx, bucket, object, opts)
|
||||||
if !proxytgts.Empty() {
|
if !proxytgts.Empty() {
|
||||||
globalReplicationStats.incProxy(bucket, getObjectAPI, false)
|
globalReplicationStats.incProxy(bucket, getObjectAPI, false)
|
||||||
@ -505,6 +507,7 @@ func (api objectAPIHandlers) getObjectHandler(ctx context.Context, objectAPI Obj
|
|||||||
gr = reader
|
gr = reader
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if reader == nil || !proxy.Proxy {
|
if reader == nil || !proxy.Proxy {
|
||||||
// validate if the request indeed was authorized, if it wasn't we need to return "ErrAccessDenied"
|
// validate if the request indeed was authorized, if it wasn't we need to return "ErrAccessDenied"
|
||||||
// instead of any namespace related error.
|
// instead of any namespace related error.
|
||||||
@ -1024,7 +1027,7 @@ func (api objectAPIHandlers) headObjectHandler(ctx context.Context, objectAPI Ob
|
|||||||
|
|
||||||
objInfo, err := getObjectInfo(ctx, bucket, object, opts)
|
objInfo, err := getObjectInfo(ctx, bucket, object, opts)
|
||||||
var proxy proxyResult
|
var proxy proxyResult
|
||||||
if err != nil {
|
if err != nil && !objInfo.DeleteMarker && !isErrMethodNotAllowed(err) {
|
||||||
// proxy HEAD to replication target if active-active replication configured on bucket
|
// proxy HEAD to replication target if active-active replication configured on bucket
|
||||||
proxytgts := getProxyTargets(ctx, bucket, object, opts)
|
proxytgts := getProxyTargets(ctx, bucket, object, opts)
|
||||||
if !proxytgts.Empty() {
|
if !proxytgts.Empty() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user