Repository navigation
fix(dir/server): handle missing manifest gracefully to prevent orphaned search index rows - #2067
Merged
Merged
Conversation
Member
|
@vijit-vishnoi Please run |
) Signed-off-by: vijit-vishnoi <[email protected]>
vijit-vishnoi
force-pushed
the
fix/issue-2066-orphan-index
branch
from
August 25, 2026 14:05
6987e4e to
cea68c5
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
paralta
approved these changes
Aug 25, 2026
paralta
left a comment
Member
There was a problem hiding this comment.
LGTM 🚀 Thank you so much for picking this issue up and for how quickly you turned it around — neat fix!
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.
Fixes #2066
Problem Statement
Previously,
StoreService.Deletewould fail and return an error if a record's manifest was already missing from the OCI store. Because the OCI deletion step failed, the subsequent database search-index cleanup step was never reached, leaving behind an orphaned, unrecoverable row in the search index.Proposed Changes
This PR implements the maintainer's proposed solution to make "record not found in OCI" a non-fatal outcome, allowing the deletion process to continue and clean up the database index:
server/store/oci/internal.go):deleteFromOCIStoreanddeleteFromRemoteRepositoryto check forerrdef.ErrNotFoundusingerrors.Is.nil(success), treating the deletion as idempotent.server/controller/store.go):s.store.Delete.s.db.RemoveRecordeven if the store returns acodes.NotFoundgRPC status.TestDeleteFromOCIStore_NotFound: Verifies that attempting to delete a non-existent CID in the OCI store correctly returnsnil.TestStoreDelete_NotFound: Verifies that the controller'sDeletemethod correctly invokes the databaseRemoveRecordmock even when the OCI store returnscodes.NotFound.Checklist
go test)