-
Notifications
You must be signed in to change notification settings - Fork 19
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
feature: ZENKO-2089 add mongodb conditionals #913
Conversation
Hello alexanderchan-scality,My role is to assist you with the merge of this Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
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.
This change seems to be breaking some abstraction here, the metadata interface is backend-agnostic. I suggest collecting which filters are going to be useful, and pass them as objects that are part of Arsenal's API and backend-agnostic, then doing the translation in the backend-specific impl (in this case MongoClientInterface).
Also the metadata wrapper should return an internal error if the backend does not support the translation, to avoid unexpected issues.
@@ -356,6 +356,12 @@ class MetadataWrapper { | |||
notifyBucketChange(cb) { | |||
bucketNotificationHook = cb; | |||
} | |||
|
|||
close() { | |||
if (this.client.close === 'function') { |
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.
Missing typeof
?
@@ -622,6 +662,10 @@ class MongoClientInterface { | |||
return this.putObjectVerCase4(c, bucketName, objName, objVal, | |||
params, log, cb); | |||
} | |||
if (params && params.query) { | |||
return this.putObjectNoVerConditional( |
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.
Is this only the NoVer
variant because blobserver never supports versioning? What would happen if blobserver were to try updating/deleting a versioned object put by cloudserver?
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following reviewers are expecting changes from the author, or must review again: |
a13d547
to
f967b75
Compare
We made the abstraction mistake for search, can we fusion / factorize with search (whom parsing / execution logic lies in CS instead of Arsenal) with those conditional operators ? |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: The following reviewers are expecting changes from the author, or must review again: |
return cb(errors.InternalError); | ||
} | ||
if (!res.value) { | ||
log.debug('object not found...inserting object', { |
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.
Since the action is already done, the log should use past tense to avoid confusion (can be surprising when troubleshooting that the DB does not reflect what the log says).
@vrancurel I'm not sure it would be appropriate to merge them. This particular abstraction is fine for programmatic use of the API, JSON is easy to build this way. But we can't expect users to type JSON in the search bar, and using a human-friendly search syntax for API use (especially implemented in javascript, in critical request path such as upsert/conditional writes) would be wasteful. The search syntax definitely needs to be re-done, and the new parser could definitely translate to this data structure for convenience, but I don't think they are the same abstraction level. For best impact, the human-friendly syntax would be like lucene/elasticsearch, as many users have used it one way or another, and its basic form is similar enough to a google search. |
dbb19c0
to
2f771d3
Compare
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list: |
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.
other than the .only
LGTM
I would prefer renaming Query to Cond, @rachedbenmustapha ? |
4e0297f
to
5125724
Compare
add conditional put/delete operations to allow for correct blobserver behaviors
5125724
to
ad58f66
Compare
@vrancurel wouldn't these new cond primitives make the versioning code a lot cleaner? |
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue ZENKO-2089. Goodbye alexanderchan-scality. |
add conditional put/delete operations to allow for correct blobserver behaviors
update: