Files
Musify/backend/Musify.Infrastructure/Persistence/Migrations/20260705124807_AddTrackProcessingSagaKeys.cs
T
Admin 6e5755039f feat(infra): track saga failure handling + cleanup (phase 2)
On definitive failure of the picture or audio slip, the saga now reaches a
Failed state and recovers end-to-end:
- Picture/audio track slips carry TrackId + ProcessKind variables and a
  subscription to a fault translator (TrackProcessingSlipFaultConsumer) that
  turns RoutingSlipFaulted into a typed Track{Picture,Audio}ProcessingFailed
- The saga stores the final object keys from the start event and, on failure,
  transitions to Failed and publishes TrackProcessingFailed
- TrackProcessingFailedConsumer runs a cleanup slip that removes the orphaned
  final picture/audio copies and marks the track LifeCycleStatus=Failed
  (MarkTrackAsFailedActivity) — the track stays as a visible, recoverable record
- Migration for the new saga columns

Verified: Worker boots against RabbitMQ + Postgres in Docker; the new
endpoints (fault translator, failed consumer, mark-track-as-failed) configure
and the bus starts clean.

Build: 0 warnings, 0 errors.
2026-07-05 14:49:33 +02:00

49 lines
1.4 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Musify.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class AddTrackProcessingSagaKeys : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "AudioKey",
table: "TrackProcessingState",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Bucket",
table: "TrackProcessingState",
type: "text",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "PictureKey",
table: "TrackProcessingState",
type: "text",
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "AudioKey",
table: "TrackProcessingState");
migrationBuilder.DropColumn(
name: "Bucket",
table: "TrackProcessingState");
migrationBuilder.DropColumn(
name: "PictureKey",
table: "TrackProcessingState");
}
}
}