mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
replication: proxy only on missing object or read quorum err (#20101)
This commit is contained in:
parent
95f076340a
commit
3535197f99
@ -751,12 +751,6 @@ func isErrSignatureDoesNotMatch(err error) bool {
|
|||||||
return errors.As(err, &signatureDoesNotMatch)
|
return errors.As(err, &signatureDoesNotMatch)
|
||||||
}
|
}
|
||||||
|
|
||||||
// isErrObjectNameInvalid - Check if error type is ObjectNameInvalid.
|
|
||||||
func isErrObjectNameInvalid(err error) bool {
|
|
||||||
var invalidObject ObjectNameInvalid
|
|
||||||
return errors.As(err, &invalidObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
// PreConditionFailed - Check if copy precondition failed
|
// PreConditionFailed - Check if copy precondition failed
|
||||||
type PreConditionFailed struct{}
|
type PreConditionFailed struct{}
|
||||||
|
|
||||||
|
@ -501,8 +501,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 !isErrObjectNameInvalid(err) && !isErrMethodNotAllowed(err) && !(gr != nil && gr.ObjInfo.DeleteMarker) {
|
if (isErrObjectNotFound(err) || isErrVersionNotFound(err) || isErrReadQuorum(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)
|
||||||
@ -1028,7 +1028,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 && !objInfo.DeleteMarker && !isErrMethodNotAllowed(err) && !isErrObjectNameInvalid(err) {
|
if err != nil && !objInfo.DeleteMarker && (isErrObjectNotFound(err) || isErrVersionNotFound(err) || isErrReadQuorum(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…
Reference in New Issue
Block a user