[stable-7.2] fix(search): skip disabled spaces when reindexing all spaces - #3565
Draft
schweigisito wants to merge 1 commit into
Draft
schweigisito wants to merge 1 commit into
schweigisito wants to merge 1 commit into
Conversation
Reindexing all spaces aborted on the first disabled space. The storage provider answers with "not found" for the root of a disabled space, so the tree walk failed and the error took the whole run down, leaving the remaining spaces unindexed. Skip disabled spaces and log them instead, they have to be indexed again once they have been enabled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Up to standards βπ’ Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Description
opencloud search index --all-spacesaborted on the first disabled space it ran into.ListStorageSpacesreturns disabled spaces, but the storage provider answers withnot foundfor their root (node.ReadNodeis called withcanListDisabledSpace=false). reva's walker stats the space root before it descends, so the walk fails immediately andIndexSpacereturns that error. The handler propagated it out of the loop, which ended the whole run and left every space that had not been processed yet unindexed:Disabled spaces are now skipped and logged, using the same
trashedopaque marker the search service already uses to keep disabled spaces out of query results (services/search/pkg/search/service.go). A summary line at the end tells the admin how many spaces were skipped so they can be indexed again after being enabled.Indexing a disabled space is not possible through the CS3 gateway at all β both
StatandListContainerresolve the space root throughReadNodeand getnot foundβ so skipping is the only option available here without a reva change.This is not a backport.
maindoes not abort the run, becausec8805265e2swallowsnot foundinside the walk callback, but as a result it reports disabled spaces as successfully indexed without touching them. That needs a separate fix onmain, see the issue.Scope is deliberately kept to the disabled space failure. Two adjacent things are not in this PR:
mainthis was changed by Reindex spaces concurrentlyΒ #3207 /243514ec17)Related Issue
Motivation and Context
Indexing all spaces is what the post upgrade job of the helm charts runs after the search index version bump in 8.x. A single disabled space made that job fail and left the instance with a partially rebuilt index.
How Has This Been Tested?
go build ./services/search/...,go vet,go test ./services/search/...(thepkg/opensearchsuite needs a Docker testcontainer and is unaffected by this change)opencloud search index --all-spaces --force-rescan --insecureβ the command now completes, the disabled space is logged as skipped and the remaining spaces are indexedAn acceptance test for this scenario exists for
mainin #3560 and should be backported once it has been merged.Types of changes
Checklist:
π€ Generated with Claude Code