AtlasOfLivingAustralia / data-management

Data management issue tracking
7 stars 0 forks source link

Assertion Sync to poll status and call clear admin cache #993

Open patkyn opened 7 months ago

patkyn commented 7 months ago

Currently, after full index runs, the assertion sync is triggered and the status shows success. However, the status success does not indicate that the assertion sync has finished. Clearing the biocache admin cache immediately before the job finishes will show incorrect user assertion numbers as reported in issue https://github.com/AtlasOfLivingAustralia/ala-infrastructure/issues/1115 (as shown in point 3).

After triggering https://biocache.ala.org.au/ws/sync, Assertion Sync dag needs to poll for the status from https://biocache.ala.org.au/ws/sync/status. The status must show "Task running" until "No task is running" (need to reconfirm when the actual task runs). Once the status is "No task is running", the https://biocache.ala.org.au/admin/clearAllCaches should be triggered.

One caveat, this assertion sync need to be run on the swapped index (pointed by solr biocache alias). If index swapped is not successful, and a manual swap is done, the assertion sync dag needs to be triggered manually for the above to happen

patkyn commented 7 months ago

Update: when the assertion sync is running, the status shows "indexAll task is running". image

When the assertion sync background task finishes, the status shows "No task is running" image

I've also noticed that on a successful automatic swap, the actual record count is not reflected on biocache. https://biocache.ala.org.au/admin/clearAllCaches should be triggered after the assertion sync background task finish