Reindex spaces concurrently - #3207
Conversation
This speeds up reindexing all spaces which happend sequentially space after space until now. The level of concurrency can be configured using the SEARCH_REINDEX_CONCURRENCY env var (3 by default).
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
🟢 Coverage 0.00% diff coverage · -0.02% coverage variation
Metric Results Coverage variation ✅ -0.02% coverage variation (-1.00%) Diff coverage ✅ 0.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (bb8cefa) 83760 19256 22.99% Head commit (d50d8d8) 83772 (+12) 19244 (-12) 22.97% (-0.02%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3207) 16 0 0.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
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.
There was a problem hiding this comment.
Two findings:
-
Should we just log the indexing errors in the server and otherwise swallow them?
I would probably prefer to collect them and report to the caller (the cli) that indexing (some) spaces failed.. Reporting the actual spaces in a structured format would probably mean touching the proto files. If you want to avoid that, a simple summary of failed spaces in a single error message would still be better than nothing imho. -
It might be more complex and maybe not necessary right now, but I could imagine that an operator might want to set the concurrency value depending on the load of the cluster without restarting the search service ...
Maybe let's name the option_MAX_CONCURRENCYso we can introduce a cli arg later?
This would obviously need a proto change as well
Yes you're right, the experience when using the CLI needs to be improved. We also still have the problem that the CLI doesn't wait indefinitely until the reindex process has completed, so returning an error message usually wouldn't reach the user (See #2592). I would defer that to a proper fix alongside #2592 and just go with the server log messages for now.
Good point, I'll rename the option as suggested. |
|
Sounds reasonable, thanks! |
#1812) ##### [\`7.4.0\`](https://github.com/opencloud-eu/opencloud/blob/HEAD/CHANGELOG.md#740---2026-08-03) ##### ❤️ Thanks to all contributors! ❤️ [@AlexAndBear](https://github.com/AlexAndBear), [@JammingBen](https://github.com/JammingBen), [@aduffeck](https://github.com/aduffeck), [@dschmidt](https://github.com/dschmidt), [@fschade](https://github.com/fschade), [@michaelstingl](https://github.com/michaelstingl), [@pbleser-oc](https://github.com/pbleser-oc), [@rhafer](https://github.com/rhafer), [@schweigisito](https://github.com/schweigisito), [@v-scharf](https://github.com/v-scharf) ##### 📈 Enhancement - Do not check ignored paths \[[#3233](opencloud-eu/opencloud#3233)] - Extend posixfs consistency check \[[#3220](opencloud-eu/opencloud#3220)] - Improve reindex command \[[#3213](opencloud-eu/opencloud#3213)] - Reindex spaces concurrently \[[#3207](opencloud-eu/opencloud#3207)] - feat: add announcement banner \[[#3189](opencloud-eu/opencloud#3189)] - feat: add space viewer with versions role \[[#2961](opencloud-eu/opencloud#2961)] ##### 🐛 Bug Fixes - fix(runtime): log service startup errors instead of printing them beside the log \[[#3140](opencloud-eu/opencloud#3140)] - fix(posixfs scan): Setup logger for scan command \[[#3185](opencloud-eu/opencloud#3185)] ##### ✅ Tests - api-test: mark group last-manager removal scenario as flaky \[[#3194](opencloud-eu/opencloud#3194)] - rerun flaky tests \[[#3183](opencloud-eu/opencloud#3183)] - api-test: fix removeAccessToDrive.feature:145 \[[#3179](opencloud-eu/opencloud#3179)] - api-test: cover additional unified roles in acceptance tests \[[#3169](opencloud-eu/opencloud#3169)] - test(apiAuthApp): fix flaky token pattern \[[#3163](opencloud-eu/opencloud#3163)] - test(apiArchiver): the single-resource archive is named after the resource \[[#3080](opencloud-eu/opencloud#3080)] - test(coreApiWebdavUploadTUS): assert etag and permissions on the finalizing TUS chunk \[[#3078](opencloud-eu/opencloud#3078)] - test(coreApiWebdavOperations): download a file with a literal "%" via its oc:downloadURL \[[#3079](opencloud-eu/opencloud#3079)] ##### 📚 Documentation - maint: clean-up auth-app documentation \[[#3155](opencloud-eu/opencloud#3155)] - ci: sync tests/README.md to docs \[[#3164](opencloud-eu/opencloud#3164)] ##### 📦️ Dependencies - \[full-ci] chore: bump web to v7.3.0 \[[#3223](opencloud-eu/opencloud#3223)] - build(deps): bump github.com/open-policy-agent/opa from 1.18.2 to 1.19.0 \[[#3231](opencloud-eu/opencloud#3231)] - build(deps): bump google.golang.org/grpc from 1.82.0 to 1.83.0 \[[#3232](opencloud-eu/opencloud#3232)] - chore(idp): bump dependencies \[[#3226](opencloud-eu/opencloud#3226)] - build(deps): bump github.com/nats-io/nats-server/v2 from 2.14.3 to 2.14.4 \[[#3221](opencloud-eu/opencloud#3221)] - build(deps): bump github.com/go-ldap/ldap/v3 from 3.4.13 to 3.4.14 \[[#3222](opencloud-eu/opencloud#3222)] - build(deps): bump github.com/prometheus/client\_golang from 1.23.2 to 1.24.1 \[[#3218](opencloud-eu/opencloud#3218)] - build(deps): bump github.com/gabriel-vasile/mimetype from 1.4.13 to 1.4.15 \[[#3217](opencloud-eu/opencloud#3217)] - build(deps): bump golang.org/x/net from 0.56.0 to 0.57.0 \[[#3136](opencloud-eu/opencloud#3136)] - build(deps): bump github.com/beevik/etree from 1.6.0 to 1.7.0 \[[#3134](opencloud-eu/opencloud#3134)] Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This speeds up reindexing all spaces which happend sequentially space after space until now. The level of concurrency can be configured using the SEARCH_REINDEX_CONCURRENCY env var (3 by default).