You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clearing a cached artifact and queueing its file aren’t atomic #467
#428 made retention clear the record and queue the file in pending_deletes in one transaction. Three other places still do it in two steps:
DiscardArtifact (internal/database/queries.go) clears the record, commits, then calls QueuePendingDelete.
UpsertArtifact commits the new storage path, then queues the old one separately.
The LRU loop in evictBatch (internal/server/eviction.go) clears the record, deletes the file, and only queues it if the delete fails.
A crash or a failed second write between the steps leaves a file in storage that no record points to and nothing will ever delete. I'd move each pair into one transaction, the same way ClearExpiredArtifact does now.
Activity