fix: avoid races in NewMultipartUpload under multiple pools (#12233)

It is possible in some scenarios that in multiple pools,
two concurrent calls for the same object as a multipart operation
can lead to duplicate entries on two different pools.

This PR fixes this

- hold locks to serialize multiple callers so that we don't race.
- make sure to look for existing objects on the namespace as well
  not just for existing uploadIDs
This commit is contained in:
Harshavardhana
2021-05-06 10:45:33 -07:00
committed by GitHub
parent 1aa5858543
commit 361940706d
2 changed files with 32 additions and 52 deletions

View File

@@ -1082,9 +1082,9 @@ var errorCodes = errorCodeMap{
HTTPStatusCode: http.StatusBadRequest,
},
ErrKMSNotConfigured: {
Code: "InvalidArgument",
Code: "NotImplemented",
Description: "Server side encryption specified but KMS is not configured",
HTTPStatusCode: http.StatusBadRequest,
HTTPStatusCode: http.StatusNotImplemented,
},
ErrNoAccessKey: {
Code: "AccessDenied",