Skip to content
Snippets Groups Projects

Fix batch failure in Fetch Records API when versions are missing

Merged Rustam Lotsmanenko (EPAM) requested to merge fix-get-batch-for-dangling-records into master

Description:

In GC pre-ship env we observed issues with reindexing due to a bug in batch records API. If some records in the batch do not have versions the whole batch will fail, but Storage should put them in the notFound section and return the rest.

Details:

This leads to fthe ollowing response:

{
    "code": 404,
    "reason": "Record version not found",
    "message": "The requested record version 'null' for the record with id 'osdu:test-error-handling:third' was not found"
}

After adding a null check for latest version, we see that valid records from the batch are present in a response and not valid are in the not found section:

....
        }
    ],
    "notFound": [
        "osdu:test-error-handling:third"
    ],
    "conversionStatuses": []
}

How to test:

Does functionality was tested and how?

Changes include:

  • Refactor (a non-breaking change that improves code maintainability).
  • Bugfix (a non-breaking change that solves an issue).
  • New feature (a non-breaking change that adds functionality).
  • Breaking change (a change that is not backward-compatible and/or changes current functionality).

Changes in:

  • Common code

Dev Checklist:

  • Added Unit Tests, wherever applicable.
  • Updated the Readme, if applicable.
  • Existing Tests pass
  • Verified functionality locally
  • Self Reviewed my code for formatting and complex business logic.

Other comments:

Any comments to approvers here

Edited by Rustam Lotsmanenko (EPAM)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading