Repository navigation
Delete github cache entry blob storage outside transaction - #6597
Open
jeremyevans wants to merge 2 commits into
Open
jeremyevans wants to merge 2 commits into
jeremyevans wants to merge 2 commits into
Conversation
jeremyevans
force-pushed
the
jeremy-http-inside-transaction
branch
from
October 6, 2026 15:06
8f48539 to
ec1618b
Compare
Avoids the need repeat the conditional in a where call.
Deleting the blob storage takes 1-2 HTTP calls. It was previously done after the cache entry was deleted from the database inside the, holding a lock on the deleted row, which could block loads of the cache entries for a repository. Move the blob storage deletion code into a delete_blob_storage method, and call that in .destroy_where and in the route to delete specific cache entries. After blob storage is deleted, this changes upload_id to an sentinel string. I'm not sure whether there is a better way to do this that doesn't require adding a column. I don't think the upload_id is needed after the blob storage is deleted, and the value of saving it in the deleted record seems low. There are still a couple of progs that delete cache entries, and as prog labels are run inside transactions by default, are still subject to this problem. These will be addressed in the future.
jeremyevans
force-pushed
the
jeremy-delete-cache-blob-storage
branch
from
October 6, 2026 21:58
751029e to
ec1617f
Compare
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Deleting the blob storage takes 1-2 HTTP calls. It was previously done
after the cache entry was deleted from the database inside the, holding
a lock on the deleted row, which could block loads of the cache entries
for a repository.
Move the blob storage deletion code into a delete_blob_storage method,
and call that in .destroy_where and in the route to delete specific
cache entries.
After blob storage is deleted, this changes upload_id to an sentinel
string. I'm not sure whether there is a better way to do this that
doesn't require adding a column. I don't think the upload_id is needed
after the blob storage is deleted, and the value of saving it in the
deleted record seems low.
There are still a couple of progs that delete cache entries, and as
prog labels are run inside transactions by default, are still subject
to this problem. PR #6559 attempts to address this for
GithubRepositoryNexus, and with these changes, should result in blob
storage being deleted outside a transaction for most of the deletions.
A similar approach can be used for DeleteCacheEntries, and the remaing
GithubCacheEntry#destroy call in GithubRepositoryNexus can be changed
to call delete_blob_storage first.