You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/07/20 08:08:20 UTC
[GitHub] [lucene-solr] squirmy opened a new pull request #1681: SOLR-10804: Allow same version updates in DocBasedVersionConstraintsProcessor
squirmy opened a new pull request #1681:
URL: https://github.com/apache/lucene-solr/pull/1681
# Description
This change adds an optional configuration parameter to the `DocBasedVersionConstraintsProcessorFactory` which will allow updates to proceed if they have the same version as the existing document.
# Solution
1. Added a boolean parameter named `rejectSameVersion` which defaults to true. This is the original behaviour.
2. Based on the parameter the `DocBasedVersionConstraintsProcessor` will choose the correct strategy for comparing the versions in the new and existing documents.
3. The decision of which strategy to use is done up front so as to not check on every document update.
4. The original code was passing in the versionFieldName to the comparison and never using it, so I removed this from the function signature.
I chose the name `rejectSameVersion` because it seemed to fit with the documentation better as it talks more about rejecting updates than accepting them. Happy to to adjust this based on your feedback.
# Tests
Added a test to check that setting `rejectSameVersion` to `false` has the following behaviour:
- Cannot update the document with an older version
- Can update document with the same version
- Can update document with a new version
All previous unit tests which rely on the default value of `true` pass.
# Checklist
Please review the following and check all that apply:
- [✅] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
- [✅] I have created a Jira issue and added the issue ID to my pull request title.
- [✅] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [✅] I have developed this patch against the `master` branch.
- [✅] I have run `ant precommit` and the appropriate test suite.
- [✅] I have added tests for my changes.
- [✅] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org