sourcegraph/internal/search/exhaustive
Stefan Hengl cd38adb4a7
chore(search_jobs): add janitor job (#64186)
Fixes SPLF-119

This adds a background job to Search Jobs that periodically scans for
finished jobs to aggregate the status, upload logs, and clean up the
tables. This drastically reduces the size of the tables and improves the
performance of the Search Jobs GQL API.

For example, with this change, a finished search job on .com only has 1
entry in the database, whereas before it could have several millions if
we searched each repository.

Notes:
- the diff seems larger than it actually is. I left a couple of comments
to help the reviewers.

## Test plan:
- new unit tests
- manual testing:

I ran a couple of search jobs locally (with the janitor job interval set
to 1 min) and checked that
 - logs are uploaded to `blobstore-go/buckets/search-jobs`
 - repo jobs are deleted from `exhaustive_repo_jobs`
 - logs are served from the blobstore after the janitor ran
 - downloading logs while the job is running still works

## Changelog
The new background job drastically reduces the size of the
`exhaustive_*` tables and improves performance of the Search Jobs GQL
API.
2024-08-01 15:29:10 +02:00
..
service chore(search_jobs): add janitor job (#64186) 2024-08-01 15:29:10 +02:00
store chore(search_jobs): add janitor job (#64186) 2024-08-01 15:29:10 +02:00
types chore(search_jobs): add janitor job (#64186) 2024-08-01 15:29:10 +02:00
BUILD.bazel gating: Add individual switches for disabling tools features (#63686) 2024-07-16 15:45:38 +02:00
conf_test.go gating: Add individual switches for disabling tools features (#63686) 2024-07-16 15:45:38 +02:00
conf.go gating: Add individual switches for disabling tools features (#63686) 2024-07-16 15:45:38 +02:00