Details
-
Bug
-
Status: Closed (View Workflow)
-
P2
-
Resolution: Won't Do
-
19.3.2
-
None
-
Core: Platform
-
Cornell, Lehigh, MO State, Simmons
Description
When attempting to update holdings and their items concurrently the holdings updates will ever so often interfere with the item updates, effectively nullifying the latter.
Update: The module with the code that surfaced/illustrated the problem in mod-inventory-storage now exists under a new name: mod-inventory-update. The example code to reveal the problem in mod-inventory-storage no longer exists, except for in this somewhat historic commit to the module under its previous name. The mod-inventory-match/mod-inventory-update has worked around the issue in mod-inventory-storage ever since this ticket was filed, simply by refraining from updating holdings and items concurrently (and instead update first holdings, then items, sequentially that is).
The dis-enabled code here would show that
Where as the currently enabled code works:
With mod-inventory-match (branch `hrid-upsert`) and inventory storage running in a FOLIO installation and executing this curl command
curl -X PUT -D - \ -H "Content-type: application/json" \ -H "X-Okapi-Tenant: $tenant" \ -H "X-Okapi-Token: $token" \ -d @$file $protocol://$host/inventory-upsert-hrid
to push this record set:
{ "instance": { "title": "Instance 1", "source": "Local", "instanceTypeId": "6312d172-f0cf-40f6-b27d-9fa8feaf332f", "hrid": "ins001", "identifiers": [ { "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422", "value": "9781466636897" } ] }, "holdingsRecords": [ { "callNumber": "Holdings 1", "permanentLocationId": "53cf956f-c1df-410b-8bea-27f712cca7c0", "hrid": "hol001", "items": [ { "itemIdentifier": "it001", "hrid": "it001", "barcode": "Item 1", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Available" } }, { "itemIdentifier": "it002", "hrid": "it002", "barcode": "Item 2", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Available" } } ] }, { "callNumber": "Holdings 2", "permanentLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", "hrid": "hol002", "items": [ { "itemIdentifier": "it003", "hrid": "it003", "barcode": "Item 3", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Available" } }, { "itemIdentifier": "it004", "hrid": "it004", "barcode": "Item 4", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Available" } } ] } ] }
followed by this record set
{ "instance": { "title": "Instance 1 plain-update", "source": "Local", "instanceTypeId": "6312d172-f0cf-40f6-b27d-9fa8feaf332f", "hrid": "ins001", "identifiers": [ { "identifierTypeId": "8261054f-be78-422d-bd51-4ed9f33c3422", "value": "9781466636897" } ] }, "holdingsRecords": [ { "callNumber": "Holdings 1 plain-update", "permanentLocationId": "53cf956f-c1df-410b-8bea-27f712cca7c0", "hrid": "hol001", "items": [ { "itemIdentifier": "it001", "hrid": "it001", "barcode": "Item 1", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Awaiting pickup" } }, { "itemIdentifier": "it002", "hrid": "it002", "barcode": "Item 2", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Awaiting pickup" } } ] }, { "callNumber": "Holdings 2 plain-update", "permanentLocationId": "fcd64ce1-6995-48f0-840e-89ffa2288371", "hrid": "hol002", "items": [ { "itemIdentifier": "it003", "hrid": "it003", "barcode": "Item 3", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Awaiting pickup" } }, { "itemIdentifier": "it004", "hrid": "it004", "barcode": "Item 4", "materialTypeId": "1a54b431-2e4f-452d-9cae-9cee66c9a892", "permanentLoanTypeId": "2b94c631-fca9-4892-a730-03ee529ffe27", "status": { "name": "Awaiting pickup" } } ] } ] }
then the second PUT attempts to update the Item status for all items created in the first but often only 2 or 3 items appear to update:
TestRail: Results
Attachments
Issue Links
- is blocked by
-
RMB-388 PostgresClient.getById with transaction, with "SELECT … FOR UPDATE"
-
- Closed
-
- relates to
-
UIIN-1245 Implement optimistic locking in Inventory
-
- Closed
-
-
UXPROD-1752 Prevent update conflicts (via optimistic locking): platform support for detection
-
- Closed
-
-
UXPROD-2796 Prevent update conflicts when doing manual edits (User A and User B)
-
- Closed
-
-
UXPROD-2797 Prevent update conflicts (1 user and system trying to act on the same record)
-
- Closed
-
-
UXPROD-2798 Prevent update conflicts (two automated processes acting on the same record)
-
- Closed
-