Skip to content

SOLR-16218: Fix bug in in-place update when failOnVersionConflicts=false#898

Merged
anshumg merged 1 commit intoapache:mainfrom
laminelam:SOLR-16218_failOnVersionConflicts_option_not_working_for_in-place_updates
Jun 10, 2022
Merged

SOLR-16218: Fix bug in in-place update when failOnVersionConflicts=false#898
anshumg merged 1 commit intoapache:mainfrom
laminelam:SOLR-16218_failOnVersionConflicts_option_not_working_for_in-place_updates

Conversation

@laminelam
Copy link
Contributor

https://issues.apache.org/jira/browse/SOLR-16218

Description

Fix a bug in in-place update when failOnVersionConflicts=false.

When sending in-place/atomic updates for a non-existent doc with version=1 Solr throws 409 error even if failOnVersionConflicts is set to false.

Steps to Reproduce

  • Send an update request (single or batch) that includes Update in-place/atomic command of a non-existent doc.
  • Set Version=1
  • Solr will throw 409 exception with "Document not found for update" message error.

Set failOnVersionConflicts=false

  • Solr still throws the same error.

Expected

if failOnVersionConflicts=false Solr should ignore the error silently and continue processing the rest of the commands.

Actual Result

Solr throws 409 exception with "Document not found for update" message error.

Solution

Check in getUpdatedDocument if failOnVersionConflicts=true before throwing the exception.

Tests

Added test cases catching the expected behavior when _failOnVersionConflicts is set to true or false (default is true).

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute 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 to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • [] I have added documentation for the Reference Guide

@anshumg anshumg merged commit 329fda7 into apache:main Jun 10, 2022
anshumg pushed a commit to anshumg/solr that referenced this pull request Jun 10, 2022
)

Co-authored-by: Lamine Idjeraoui <lidjeraoui@apple.com>
anshumg added a commit that referenced this pull request Jun 12, 2022
…901)

Co-authored-by: Lamine Idjeraoui <lidjeraoui@apple.com>
@anshumg anshumg changed the title Fix bug in in-place update when failOnVersionConflicts=false SOLR-16218: Fix bug in in-place update when failOnVersionConflicts=false Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants