-
Notifications
You must be signed in to change notification settings - Fork 20
fix concurrent mpu duplicate objects bug #2459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development/8.2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ export type ObjectMDOperationParams = { | |
needOplogUpdate: boolean, | ||
originOp: string, | ||
doesNotNeedOpogUpdate?: boolean, | ||
preventConcurrentCompletion?: boolean, | ||
conditions: any, | ||
}; | ||
|
||
|
@@ -1200,6 +1201,9 @@ class MongoClientInterface { | |
* @param {string} params.vFormat - object key format. | ||
* @param {boolean} params.needOplogUpdate - If true, the object is directly put into the collection | ||
* with updating the operation log. | ||
* @param {boolean} params.preventConcurrentCompletion - If true, the object is only created if | ||
* completeInProgress is not already set to true. Fix this concurrent completeMultipartUpload issue : | ||
* https://scality.atlassian.net/jira/software/c/projects/OS/boards/268?selectedIssue=CLDSRV-687 | ||
* @param {Object} log - The logger to use. | ||
* @param {Function} cb - The callback function to call when the operation is complete. It is called with an error | ||
* if there is an issue with the operation. | ||
|
@@ -1220,6 +1224,9 @@ class MongoClientInterface { | |
} | ||
const key = formatMasterKey(objName, params.vFormat); | ||
const putFilter = { _id: key }; | ||
if (params?.preventConcurrentCompletion) { | ||
putFilter['value.completeInProgress'] = { $ne: true }; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This approach does not work for Metadata (since metadata does not go through MongoClientInterface), and introduce some business-specific logic deep down in the "metadata layer" (completeInProgress is not related to metadata management, but really only to MPU objects) : thus creating more coupling and breaking the abstraction... Alternatively, if we don't think this approach solves the issue or if we need that fix more urgently, this needs more work:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is also a (kind of generic) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, Metadata uses the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and Cloudserver passes the upload ID of the MPU as the unique property of the MPU There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @jonathan-gramain ! Can you explain what is the expected semantics of the "backend", i.e. metadata/mongoClientInterface, regarding this field? And point us to the implementation in metadata? cc @williamlardier maybe this also relates to the other issues we found/fixed on MPU ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @francoisferrand I don't think it is related to my recent PRs in the sense that we really had a wrong logic in some cases, but for this one (the current PR), it is definitely related yes. I saw we had logic in the metadata backend that we don't with MongoDB. As we definitely reproduced the issue with a mongodb backend, that is, end up with two distinct versions and the same data location, I was just wondering if @jonathan-gramain knows if the metadata backend would be also affected. As you mention If that is the case, it means two things:
|
||
return collection.updateOne(putFilter, { | ||
$set: { | ||
_id: key, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just ticket number of enough