[FOLIO-3271] Reindex for sample data loaded by mod-inventory-storage in reference environment Created: 26/Aug/21  Updated: 14/Sep/21  Resolved: 14/Sep/21

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: P3
Reporter: Mikhail Fokanov Assignee: Wayne Schneider
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: Text File mod-search.log    
Issue links:
Blocks
blocks MSEARCH-174 Investigate indexing issues in refere... Closed
Sprint: DevOps Sprint 122, DevOps Sprint 123
Story Points: 0.5
Development Team: FOLIO DevOps

 Description   

Background:

When sample data is loaded for inventory-storage for reference enviroments (e.g. snapshot, testing) the mod-seach is not enabled for the tenant. That's why the data is skipped in mod-seach (because it doesn't have index for the tenant yet).

Requirements:

Re-index should be run, when the search module is deployed (after postTenant) uisng the following REST call:

POST [OKAPI_URL]/search/index/inventory/reindex

x-okapi-tenant: [tenant]
x-okapi-token: [JWT_TOKEN]

{
  "recreateIndex": false
}


 Comments   
Comment by Wayne Schneider [ 31/Aug/21 ]

This of course would not be difficult to do, but I'm wondering under what circumstances you would not do this upon enabling mod-search – in other words, shouldn't it be part of the tenant initialization?

Also wondering if this is an asynchronous process (it kind of looks like it, based on the response) – if so, is there an API for checking the indexing process? I didn't see one, skimming the API documentation.

Comment by Wayne Schneider [ 31/Aug/21 ]

If you wanted to, you could support a tenantParameter like reindex=true to control the behavior on tenant init.

Comment by Mikhail Fokanov [ 31/Aug/21 ]

Thanks Wayne Schneider. Reindex shouldn't be applied every time on postTenant. But the option with optional tenantParameter looks good to me. I will ask guys whether they are able to implement it in current sprint.

Comment by Wayne Schneider [ 01/Sep/21 ]

Thanks, Mikhail Fokanov. Please let me know when it is decided how to approach this. If a new tenantParameter is required, that will need a little bit of DevOps work to get it in. If an issue is created for adding the tenantParameter, please link it here as a blocker.

If it is decided not to use a tenantParameter, then we will have to kick off a reindex using the reindex API, which is also quite simple. So the sooner it is decided, the quicker we can get this issue resolved.

Comment by Oleksii Kuzminov [ 02/Sep/21 ]

Wayne Schneider

 It is a good approach to use a tenantParameter for mod-search. runReindex - I think is a good name for the new tenantParameter

Comment by Wayne Schneider [ 02/Sep/21 ]

Thanks, Oleksii Kuzminov – please link the JIRA issue here when you have created it for adding the tenantParameter to mod-search.

Comment by Oleksii Kuzminov [ 07/Sep/21 ]

Wayne Schneider, it will be added in scope of MSEARCH-174 

Comment by Wayne Schneider [ 07/Sep/21 ]

Oleksii Kuzminov should we change the link to MSEARCH-174 Closed from "blocks" to "blocked by", since we can't implement this until the tenantParameter is in place?

Comment by Oleksii Kuzminov [ 08/Sep/21 ]

Hi Wayne Schneider. https://github.com/folio-org/mod-search/pull/122 and MSEARCH-174 are already merged. We can add a new runReindex tenant attribute for mod-search on snapshot and testing envs

Comment by Wayne Schneider [ 08/Sep/21 ]

Thank, Oleksii Kuzminov, I've reopened this issue.

Comment by Oleksii Kuzminov [ 09/Sep/21 ]

Wayne Schneider plz, let me know when this tenantAttribute will be added for reference envs. We need to test it. Thanks

Comment by Wayne Schneider [ 13/Sep/21 ]

I added the runReindex tenant parameter to the call to the Okapi tenant install endpoint. I can see that it was added to the tenant invocation in the Okapi log:

16:56:51 [328144/proxy] [supertenant] [] [] INFO  ProxyContext         328144/proxy RES 200 11616472us okapi-4.9.0-SNAPSHOT /_/proxy/tenants/diku/install?tenantParameters=loadReference%3Dtrue%2CloadSample%3Dtrue%2CrunReindex%3Dtrue

However, I'm not sure how to tell if it actually did what it was supposed to do. I skimmed the mod-search log, but I confess I'm not sure what to look for. Attached here: mod-search.log

In the Inventory ES interface, a keyword search for * returns 31 records.

Oleksii Kuzminov Please review the attached log and the https://folio-snapshot-test.dev.folio.org system. If everything looks good to you, then I will merge the change into the regular reference environment build. Thanks!

Comment by Oleksii Kuzminov [ 13/Sep/21 ]

Wayne Schneider Looks good for me, thanks

Comment by Wayne Schneider [ 14/Sep/21 ]

The update has been merged into folio-ansible and the next builds of folio-testing and folio-snapshot will include this.

Generated at Thu Feb 08 23:26:53 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.