This repository was archived by the owner on Sep 30, 2024. It is now read-only.
[Backport 5.2] Embeddings: fix low-hanging issues with scheduling job#58651
Merged
Conversation
|
We require contributors to sign our Contributor License Agreement (CLA), and we don't have yours on file. In order for us to review and merge your code, please sign CLA to get yourself added. Sourcegraph teammates should refer to Accepting contributions for guidance. |
As part of the embeddings policy framework, a worker periodically checks what repos can be embedded. For every candidate repo, it queries the DB to see if there's a new revision to embed. This runs every minute and becomes increasingly expensive as the jobs table fills up with more entries over time. This change makes small optimizations to improve this: * Add an index to make selecting on `repo_id` and `revision` much faster * Check the repos every 5 minutes instead of 1 minute. This shouldn't make a huge difference in user experience, since by default embeddings jobs aren't allowed to be scheduled within 24h of the last run
ec6b23a to
0e15267
Compare
Contributor
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 19823d7...0f5f30d.
|
keegancsmith
approved these changes
Nov 29, 2023
Contributor
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of the embeddings policy framework, a worker periodically checks what repos can be embedded. For every candidate repo, it queries the DB to see if there's a new revision to embed. This runs every minute and becomes increasingly expensive as the jobs table fills up with more entries over time.
This change makes small optimizations to improve this:
repo_idandrevisionmuch fasterBackport of #58510