Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend, ingest): Only return get-original-data when the aux-table is empty #2846

Merged
merged 9 commits into from
Sep 19, 2024

Conversation

anna-parker
Copy link
Contributor

@anna-parker anna-parker commented Sep 19, 2024

resolves #

preview URL: https://check-aux-table.loculus.org/

Summary

As discussed in slack there is a period between when sequences are submitted and will be seen in get-original-data, in this period sequences are added to the aux tables. To prevent ingest errors we should not return original data while the backend is still processing sequences, e.g. there is data in the aux tables. When there is data in the aux tables get-original-data will respond with 423 LOCKED.

Also update ingest to wait 30seconds after a LOCKED response and then retry.
Also update ingest get-submitted to not add "" to dictionary when segment is missing and thus insdc_accession_segment does not exist.

Screenshot

Update I added a sequence to cchf that is why there is one sequence!

PR Checklist

  • All necessary documentation has been adapted.
  • The implemented feature is covered by an appropriate test.

@anna-parker anna-parker added the preview Triggers a deployment to argocd label Sep 19, 2024
@anna-parker
Copy link
Contributor Author

I tried to add a test, e.g. but this fails as the auxtable is empty:

@Test
    fun `GIVEN still processing submitted data THEN return 503`() {
        convenienceClient.submitDefaultFiles(organism = organism)
        val response = submissionControllerClient.getOriginalMetadata()
        response.andExpect(status().isNotAvailable)
    }

@anna-parker anna-parker marked this pull request as ready for review September 19, 2024 14:21
@anna-parker
Copy link
Contributor Author

CCHF ingest was stopped by this new 503 response:

14:46:45    ERROR call_loculus.py:get-submitted - Request failed:
URL: https://backend-check-aux-table.loculus.org/cchf/get-original-metadata
Method: GET
Status Code: 503
Response Content:

But sadly it doesn't seem like the ingest deployment is restarting

@anna-parker anna-parker changed the title Check-aux-table feat(backend, ingest): Only return get-original-data when the aux-table is empty Sep 19, 2024
Copy link
Member

@theosanderson theosanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(I can't see an easy way to add a test - if anyone does know how we can aim to do that)

@anna-parker anna-parker merged commit 61b8fde into main Sep 19, 2024
18 checks passed
@anna-parker anna-parker deleted the check-aux-table branch September 19, 2024 16:06
@fengelniederhammer
Copy link
Contributor

Testing it would have probably been possible by "manually" adding something to the aux tables. I.e. calling a function from the test that inserts a row to simulate being in the middle of an upload.

@corneliusroemer
Copy link
Contributor

@fengelniederhammer makes sense. I'm just not familiar with the framework we're using here. Would be great if you could add such a test in a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Triggers a deployment to argocd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants