mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #13791] [CLOSED] Parallelize library.db migration steps, minor fixes #13710
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/13791
Author: @ferferga
Created: 3/28/2025
Status: ❌ Closed
Base:
master← Head:perf-library-migration-2📝 Commits (8)
0ab8ce7Fix incorrect logging of UserData entrieseed90f3Perform all leftover cleanup first5572c27Run every parallelizable library migration step in taskscdb1e50Defer committing to the end of library.db migrationa5dc983Fix elapsed time not being calculated correctly for base items, processed entities not corresponding to the real onesc55f6c9Fix context disposed on commit, disable change trackingdb37f36Save BaseItem changes early on8b02315Further clarify initial cleanup message📊 Changes
1 file changed (+274 additions, -184 deletions)
View changed files
📝
Jellyfin.Server/Migrations/Routines/MigrateLibraryDb.cs(+274 -184)📄 Description
This PR further reduces the migration time from 04:26 (achieved through #13749) to 03:45 in my Raspberry Pi by parallelizing everything that can be executed in parallel.
The downside is that this increase a little the RAM usage because all the tasks are performed as early as possible and flushing changes to the DB is deferred to the end. The biggest one though (BaseItems) is flushed to the DB as soon as possible. I don't think this will ever be a problem though, since my bottleneck now is I/O bound, and we can assume a correlation between the library size and better I/O speeds for flushing to the database (and, as soon as changes are flushed, space is freed). My 4 GB Pi 4 could handle it with a lot of headroom.
Also took the chance to fix the logger messages (for people entries,
MediaStreamInfoscount was shown instead, for example) and improve the wording (in my opinion) of the logged messages.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.