-
Notifications
You must be signed in to change notification settings - Fork 108
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
[CouchDB] Remove CouchDB all_or_nothing option for bulk API #11011
Conversation
Jenkins results:
|
if unit._couch.documentExists(unit.id): | ||
self.logger.info('Element "%s" already exists, skip insertion.' % unit.id) | ||
continue | ||
|
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.
Hi @amaltaro I seem to fail grasping the need of reordering of these checks (The one above and the if parent
one below.) Could you please shed some light?
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.
I moved this check up, because when the document already exists, we do not (re-)insert it into CouchDB, neither we return this document/object back from this method. So, it looks to me the sooner we check and skip this document, the better.
Of course, it could be a problem if this list of documents is still used later in the chain somehow, which I am not 100% sure.
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.
But I am going to revert it just to reduce the amount of changes required for the couch migration. Thanks Todor.
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.
Thanks Alan! Just to note, I was not requesting a change to it, I was asking more like... for me to understand it.
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.
Thanks @amaltaro The change looks good to me. I had only one comment inline. It is not requesting any change though, it is just for clarification purposes.
revert check for existent document
Jenkins results:
|
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.
Thanks @amaltaro I had only one question inline. But the changes look good to me.
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.
Sorry for delay, I think I missed the email with this request.
Given that there is no replacement for this in the latest CouchDB version, I think it's better to get it merged sooner than later. At least we can have some experience with this code still in CouchDB 1.6.x. I need to have another look into this code though. |
And there is nothing else to be done here, merging. |
Fixes #11009
Superseeds #10780
Status
ready
Description
CouchDB
all_or_nothing
option is no longer available for bulk APIs. This PR stops using that option.Note that if there is a conflict with one or more of the documents being updated, the conflict is only resolved if a callback function is passed over.
Is it backward compatible (if not, which system it affects?)
YES
Related PRs
Superseeds #10780
by adding a few extra checks in the tests and other minor improvements.
Many other changes have been provided in this PR: #11001
External dependencies / deployment changes
Changes required for CouchDB 3.x, but can also be merged while we are at CouchDB 1.6.