Skip to content

[stable35] perf: Partition preview migration job - #65464

Open
backportbot[bot] wants to merge 6 commits into
stable35from
backport/64515/stable35
Open

backportbot[bot] wants to merge 6 commits into
stable35from
backport/64515/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Backport of #64515

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot Bot added 3. to review Waiting for reviews AI assisted labels Oct 13, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.2 milestone Oct 13, 2026
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Assisted-by: ClaudeCode:claude-sonnet-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Use 16 partitions

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Also optimize fetching the previews to migrate by directly querying the
filecache with an optimized SQL query.

Migrating 100 000 previews now takes 22s instead of 646s on PostgreSQL
and 50s instead of 449s on SQLite.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Set the location of migrated previews before inserting them, resolving
it once per bucket and batch, instead of updating every preview after
its insert. Orphaned previews are deleted from the object store by urn
directly, with their filecache rows removed in bulk.

Migrating 100 000 previews on an object store primary storage with
PostgreSQL now takes 24s instead of 123s.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Move the filecache queries from the job into the migration service, so
the job only walks the preview folders of its partition, and share the
source file lookup and the preview creation between the batch and the
single file migration.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan
CarlSchwan force-pushed the backport/64515/stable35 branch from d45a0bf to 874ebfa Compare October 14, 2026 07:40
@CarlSchwan
CarlSchwan marked this pull request as ready for review October 14, 2026 07:49
@CarlSchwan
CarlSchwan requested a review from a team as a code owner October 14, 2026 07:49
@CarlSchwan
CarlSchwan requested review from leftybournes, salmart-dev and sorbaugh and removed request for a team October 14, 2026 07:49

This branch has not been deployed

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

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant