Skip to content

[stable-7.2] fix(search): skip disabled spaces when reindexing all spaces - #3565

Draft
schweigisito wants to merge 1 commit into
stable-7.2from
fix/stable-7.2/search-reindex-disabled-spaces
Draft

schweigisito wants to merge 1 commit into
stable-7.2from
fix/stable-7.2/search-reindex-disabled-spaces

Conversation

@schweigisito

@schweigisito schweigisito commented Sep 18, 2026

Copy link
Copy Markdown
Member

Description

opencloud search index --all-spaces aborted on the first disabled space it ran into.

ListStorageSpaces returns disabled spaces, but the storage provider answers with not found for their root (node.ReadNode is called with canListDisabledSpace=false). reva's walker stats the space root before it descends, so the walk fails immediately and IndexSpace returns 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:

failed to index space: rpc error: code = Unknown desc = error: not found: stat: error: not found: d9dc2372-2684-48f8-aa99-3fc672eddcf3

Disabled spaces are now skipped and logged, using the same trashed opaque 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 Stat and ListContainer resolve the space root through ReadNode and get not found β€” so skipping is the only option available here without a reva change.

This is not a backport. main does not abort the run, because c8805265e2 swallows not found inside the walk callback, but as a result it reports disabled spaces as successfully indexed without touching them. That needs a separate fix on main, see the issue.

Scope is deliberately kept to the disabled space failure. Two adjacent things are not in this PR:

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?

  • test environment: local build of this branch, go build ./services/search/..., go vet, go test ./services/search/... (the pkg/opensearch suite needs a Docker testcontainer and is unaffected by this change)
  • test case 1: create a space, disable it, run opencloud search index --all-spaces --force-rescan --insecure β€” the command now completes, the disabled space is logged as skipped and the remaining spaces are indexed
  • test case 2: enable the space again and re-run the command β€” the space is indexed as before

An acceptance test for this scenario exists for main in #3560 and should be backported once it has been merged.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added

πŸ€– Generated with Claude Code

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>
@codacy-production

Copy link
Copy Markdown

Up to standards βœ…

🟒 Issues 0 issues

Results:
0 new issues

View in Codacy

🟒 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant