[Eureka ECS] Spike: Investigate instance and holdings circulation constraints

Description

There are two related and similar issues:

FOCUS OF THIS ISSUE

  1. When creating a cross-tenant Secure (title level) request, creating the primary circulation request in the Secure tenant fails if there is no local holding for the requested instance in the Secure tenant

As of 2/3/25, we will move forward with solution 1:

  1. Instance creation as needed – Before attempting to create a request in any tenant, verify whether the required instance exists in that tenant. If not, initiate the creation of a shadow copy of the shared instance in that tenant. Then continue with the current circulation scenario. Scope – mod-tlr, efforts 3 to 5 SPs. This option is quick and simple, though over time, the number of shadow copies will grow. Another comment – this approach is essentially used in ordering as well (mod-orders).

    We also need to take into consideration (to plan and point) a script for cleaning up shadow copies.

Notes:
Issue with Instances and Holdings and requesting

  • ECS non-congressional requesting

  • ECS Congressional requesting through Secure tenant

    • Circulation rules for secure tenant – As indicated in the “Confirm a mediated request in Secure tenant” block of the Available workflows by sprint doc

Congressional loan stats

Numbers of requests submitted per month/year by congressional patrons (total, filled, and unfilled) 

  • Total Congressional requests for calendar year 2022 : 5418

  • Total Filled : 5218

  • Total Unfilled : 200

*keep in mind that things get filled days/weeks/ months down the line so the monthly filled/unfilled rates are worse than the annual.

Monthly requests (Dec 22-May 23)

Info for devs:

In scope of this spike, you need to:

  • Use instance sharing API https://s3.amazonaws.com/foliodocs/api/mod-consortia/s/sharing_instances.html#operation/getSharingInstances to create a shadow instance before confirming a mediated request. Steps:
    1. Create shared instance
    2. Create an item in College
    3. DO NOT create Holdings record in the secure tenant, Instead use sharing instance API to create a shadow instance
    4. Create and confirm mediated request in the secure tenant

  • In case of success, estimate work:

    • The fix needed in mod-tlr to start using instance sharing API

    • Cleanup script that would delete unneeded shadow instances

 

OUT OF SCOPE FOR THIS ISSUE

  1. When creating a cross-tenant ECS request (title level Hold) from the Central tenant, creating the secondary circulation request in the data tenant fails if there is no local holding for the requested instance in that tenant. If Secondary request creation fails, no Primary request can be created.

    1. Important: If a (at least one) holdings record for an instance exists for each location/data tenant where an item might be located, then no development will be needed. If there is only one holdings for an instance, but the items could be distributed across tenants, then only the one holding and data tenant will be pinged for the request. 

The reason for the issues is that shadow copies of a shared instance in member tenants are not created automatically.
Therefore, currently it is necessary to create holdings in member tenants so that shadow copies of shared instances appear in the tenants, which in turn will allow the creation of circulation requests.

  1. Creation of virtual instances – almost the same as above but with the creation of a virtual copy of the shared instance instead of a shadow copy. Scope – mod-tlr, mod-circulation-item, mod-circulation. Efforts 13-20 SPs. This is a more complex option, but it aligns with the long-term idea of separating inventory and circulation processes.

Environment

None

CSP Request Details

None

CSP Rejection Details

None

Estimation Notes and Assumptions

None

RCA Group Details

None

Potential Workaround

None

Attachments

1
  • 03 Feb 2025, 03:54 PM

Checklist

hide

Activity

Show:

Alexander Kurash February 11, 2025 at 4:40 PM

Option #1 confirmed for mediated requests. On Eureka Bugfest, mediated request has been confirmed and Primary request created for the title ak-title-2 that didn’t have any holdings in the Secure tenant.

Notes for https://folio-org.atlassian.net/browse/MODTLR-141 dev:

Shadow instance was created before confirming a mediated request with this API https://s3.amazonaws.com/foliodocs/api/mod-consortia-keycloak/s/sharing_instances.html . This is what needs to be done in https://folio-org.atlassian.net/browse/MODTLR-141 before creating a Primary request.

URL example:
POST {{host}}:{{port}}/consortia/1f06c60e-4431-432d-97a4-ca2bc6b152cb/sharing/instances

consortiumId could be taken from user_tenants API (cache it for efficiency).
Body example:

{ "instanceIdentifier": "6b6598fc-31ab-4979-ae8f-bf26a173ccf3", "sourceTenantId": "cs00000int", "targetTenantId": "cs00000int_0013", "status": "IN_PROGRESS" }

Response:

{ "id": "4366a4a2-3984-4d2a-9ab1-1fd02b3cccf3", "instanceIdentifier": "6b6598fc-31ab-4979-ae8f-bf26a173ccf3", "sourceTenantId": "cs00000int", "targetTenantId": "cs00000int_0013", "status": "COMPLETE", "metadata": { "createdDate": "2025-02-11T15:44:15.652581217", "createdByUserId": "da39f5a8-dac0-4e6e-8731-865c133ad187", "updatedDate": "2025-02-11T15:44:15.652581217", "updatedByUserId": "da39f5a8-dac0-4e6e-8731-865c133ad187" } }

Thoughts, open questions:

  1. What if status in the response is different from COMPLETE? Is that possible? If so, do we need to implement some kind of retry logic?

  2. This call took 10.2 seconds.

Tetiana Gusar February 4, 2025 at 11:21 AM

In spike result we expect:

  • Estimate changes, required for the mod-tlr and possibly other modules?

  • Also need script that will periodically clean up these shadow instances - estimate this script.

CC:

Done

Assignee

Reporter

Development Team

Vega

Release

Ramsons (R2 2024) Service Patch #1

RCA Group

Architecture issue

Story Points

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs
Created January 28, 2025 at 9:09 PM
Updated February 12, 2025 at 12:15 PM
Resolved February 11, 2025 at 4:49 PM
TestRail: Cases
TestRail: Runs