Skip to content

Zoekt: Add callback service

Dmitry Gruzd requested to merge 457202-zoekt-start-processing-callbacks into master

What does this MR do and why?

Add a service Search::Zoekt::CallbackService to process the callbacks from Zoekt.

When there is a delete task then it will destroy the zoekt_repository, if there is any indexing task then it will set indexed_at in the zoekt_repository. In addition to that it will move the task to done. For failures callbacks it will reduce the retry_count everytime. And finally when all the retries are exhausted it will move the task to failed.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Query plan

UPDATE
    "zoekt_tasks"
SET
    "updated_at" = '2024-05-14 17:01:55.654473',
    "state" = 255,
    "retries_left" = 0
WHERE
    "zoekt_tasks"."id" = 14

https://console.postgres.ai/shared/1abd8844-115e-4e46-b6d4-19bd03d02293

UPDATE
    "zoekt_repositories"
SET
    "updated_at" = '2024-05-14 17:05:36.919402',
    "indexed_at" = '2024-05-14 17:05:36.918149'
WHERE
    "zoekt_repositories"."id" = 15

https://console.postgres.ai/shared/d7ef40b5-69cd-4ecb-bee9-353acff564c8

DELETE FROM "zoekt_repositories"
WHERE "zoekt_repositories"."id" = 15

https://console.postgres.ai/shared/60464215-be68-4d97-aef6-e9c04ac4ea72

Related to #457202 (closed)

Edited by Ravi Kumar

Merge request reports