Gracefully handle 413 from cosmosdb

What is the issue or story related to the change?


PUT /api/storage/v2/records API accepts and tries processing the request when the record count in the request is less than 500. The issue arises when the record count is less than 500, but metadata size is more than 2 MB. In this case, storage service tries to upsert all metadata of the records at once to osdu-db using CosmosStoreBulkOperations. However cosmos DB returns 413 Entity too large as the document size in the request exceeded the max allowable document size of 2 MB, and storage converts this exception into 500. As a result, user gets 500 though they are still within the known limit of 500 records, and the storage service's availability goes down.

Issue: #301 (closed)

Change details: Instead of returning 500, core-lib-azure throws 413 to storage service if cosmosdb throws 413.

Does this introduce a breaking change?


No

Behavior before this change: image

Validation after this change: image

Edited by Mina Otgonbold

Merge request reports

Loading