The vocabulary reindexing operation should not leave the system in a bad state at any moment

Description

Currently the reindex operation first empties the current index, then tries to fetch and index the new version, which means that there is a short period of time when the ontology is empty, and if the fetch or index fails, it could permanently remain empty.

Proposed solution:

  • Create a new index: copy the solr configuration file in a separate temp directory, then attempt to fetch and index the new version

  • If the above fails for any reason (e.g. cannot access the vocabulary url, the file has unexpected format, etc), display the appropriate message to the user and clean up the temporary directory. The index of the previous vocabulary version will remain intact.

  • If re-indexing is successful, replace the old index with the new one.

Environment

None

Status

Assignee

Veronika Koltunova

Reporter

Sergiu Dumitriu

External issue ID

1366

External issue ID

None

Fix versions

Priority

Medium
Configure