Skip to content

Conjoined EF Core sagas: partition-per-tenant support (v2) #3542

Description

@jeremydmiller

Spun off from the conjoined EF Core multi-tenancy epic (#3465). Conjoined sagas shipped in Phase 1 (#3462) — saga entities get the tenant column, filter, stamping, and cross-tenant guards, and FindAsync respects the filter so saga loads are tenant-scoped. But sagas were deliberately excluded from Weasel-managed partitioning in v1 (per the #3498 PR): partitioning a saga table requires the (tenant_id, id) composite key to be real for EF, which would change the generated saga-load frames, and it forces the open identity question from #3465:

Partitioned sagas: globally-unique saga ids vs per-tenant id reuse (composite identity).

The db-only composite-PK trick used for non-saga entities (composite key exists only in the database; EF model keeps the single key) was judged unsafe to extend to saga persistence in v1 because saga ids are app-assigned and per-tenant id reuse would silently collide.

Acceptance criteria

  • Decide the identity model: globally-unique saga ids under partitioning (document + enforce), or true composite (tenant, id) saga identity with updated codegen load frames.
  • PartitionPerTenant() covers ITenanted saga tables on both PG and SQL Server, with compliance-battery coverage.
  • Docs on the multi-tenancy page replace the current "sagas are not partitioned" caveat.

Related: #3465, #3462, #3463.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions