Skip to content

Dapper and MongoDB IKeyValueStore: atomic TryDeleteAsync overrides for legacy-pause adoption (elsa-core#8529) #260

Closed

Description

@sfmskywalker

3.9 blocker. This is required to close elsa-core#8529 for the Dapper and MongoDB providers. Approved by Crew Lead as option A.

Problem

elsa-core #8538 (main) and #8539 (release/3.9.0) add IKeyValueStore.TryDeleteAsync as a default interface method. The default implementation finds the row and then deletes it, so it is not atomic. When two nodes adopt the same legacy pause (the legacy key elsa.quiescence.pause.{shell} moving to the host-wide key in QuiescenceSignal.SweepAndAdoptLegacyPauseAsync), both nodes can find the row, both can delete it, and both get true. Both then save the host key, so a pause that an operator cleared in between can be resurrected (#8529).

The EF Core and in-memory stores override the method atomically. The Dapper and MongoDB key-value stores fall back to the default, which leaves the blocker open for those providers.

Scope

Refs

elsa-core #8529, #8538, #8539; elsa-extensions #245.

Activity

  1. added this to the 3.9 milestone on Sep 28, 2026
  2. sfmskywalker commented on Sep 28, 2026

    @sfmskywalker
    MemberAuthor

    Starting: atomic TryDeleteAsync overrides for Dapper (DELETE row count > 0) and Mongo (DeleteOneAsync(ApplyTenantScope(...)).DeletedCount > 0) with two-node tests, pinned to core 3.9.0-preview.5726 (includes elsa-core#8539). Lands on the 3.9 train PR #266 (with #263/#264), ported to main via #267.

  3. sfmskywalker commented on Oct 2, 2026

    @sfmskywalker
    MemberAuthor

    Delivered via #266 (release/3.9.0, squash aa646675, pinned to core 3.9.0-preview.5726, which includes elsa-core#8539) and #267 (main, merge dc30ffbc). Dapper and MongoDB TryDeleteAsync are now atomic: Dapper checks the deleted row count, and MongoDB uses DeleteOne with the tenant scope. Legacy rows with a NULL TenantId are matched for the default tenant. On main, the fix takes effect once the core pin moves to a 3.10 preview at or after c1c935ce.

  4. moved this from In Progress to Done in Elsa 3 Crewon Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriaged

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions