mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
replication: enforce precondition for multipart (#19306)
This commit is contained in:
parent
280526caf7
commit
d990661d1f
@ -1563,6 +1563,9 @@ func replicateObjectWithMultipart(ctx context.Context, c *minio.Core, bucket, ob
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
if minio.ToErrorResponse(err).Code == "PreconditionFailed" {
|
||||||
|
return err
|
||||||
|
}
|
||||||
attempts++
|
attempts++
|
||||||
time.Sleep(time.Duration(rand.Int63n(int64(time.Second))))
|
time.Sleep(time.Duration(rand.Int63n(int64(time.Second))))
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ func checkCopyObjectPreconditions(ctx context.Context, w http.ResponseWriter, r
|
|||||||
// x-minio-source-etag
|
// x-minio-source-etag
|
||||||
func checkPreconditionsPUT(ctx context.Context, w http.ResponseWriter, r *http.Request, objInfo ObjectInfo, opts ObjectOptions) bool {
|
func checkPreconditionsPUT(ctx context.Context, w http.ResponseWriter, r *http.Request, objInfo ObjectInfo, opts ObjectOptions) bool {
|
||||||
// Return false for methods other than PUT.
|
// Return false for methods other than PUT.
|
||||||
if r.Method != http.MethodPut {
|
if r.Method != http.MethodPut && r.Method != http.MethodPost {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// If the object doesn't have a modtime (IsZero), or the modtime
|
// If the object doesn't have a modtime (IsZero), or the modtime
|
||||||
|
Loading…
Reference in New Issue
Block a user