Complete multi-instance support: Phases 3–6 & deployment

- Implements Phases 3–6: session isolation, cache coordination, primary election, and file system monitor coordination for Jellyfin with PostgreSQL.
- Adds new database entities (Instance, DistributedLock, FileSystemChange) and EF model configurations.
- Includes SQL migration scripts and EF migration for all required tables, columns, and helper functions.
- Updates Device entity and JellyfinDbContext for multi-instance tracking.
- Integrates new DI services for instance registry, distributed locks, cache coordinator, and primary election.
- Adds publishing profiles (Win/Linux/FrameworkDependent) and automation script for deployment.
- Extensive documentation for architecture, setup, and publishing.
- All changes are backward compatible and build successfully.
This commit is contained in:
2026-03-05 16:10:26 -05:00
parent 7eb2b445cb
commit 77e30685bb
52 changed files with 9349 additions and 22 deletions
@@ -0,0 +1,39 @@
// <copyright file="IFileSystemChangeProcessor.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace Jellyfin.Server.Implementations.Clustering
{
using System.Threading;
using System.Threading.Tasks;
/// <summary>
/// Service that processes file system changes from the database (primary instance only).
/// </summary>
public interface IFileSystemChangeProcessor
{
/// <summary>
/// Starts the file system change processor.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task StartAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Stops the file system change processor.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task StopAsync(CancellationToken cancellationToken = default);
/// <summary>
/// Records a file system change to the database.
/// </summary>
/// <param name="path">The path that changed.</param>
/// <param name="changeType">The type of change (Created, Modified, Deleted, Renamed).</param>
/// <param name="oldPath">The old path for rename operations.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
Task RecordChangeAsync(string path, string changeType, string? oldPath = null, CancellationToken cancellationToken = default);
}
}