Skip to content

Recursive purge is not recursive #293

@EvanMulawski

Description

@EvanMulawski

Invoking DurableTaskClient.PurgeInstanceAsync with PurgeInstanceOptions.Recursive = true does not result in sub-orchestrations being purged. The documentation for this method states that sub-orchestrations should be purged when this flag is set.

Example:

var purgeInstanceOptions = new PurgeInstanceOptions
{
    Recursive = true
};

await client.PurgeInstanceAsync("my_instance_id", purgeInstanceOptions);

with rows in the Instances table that have ParentInstanceID=my_instance_id (in addition to the required InstanceID=my_instance_id row that has a RuntimeStatus of Completed, Terminated, or Failed), executes the following SQL:

declare @p1 dt.InstanceIDs
insert into @p1 values('my_instance_id')

exec dt.PurgeInstanceStateByID @InstanceIDs=@p1

(Stored procedure PurgeInstanceStateByID only uses the provided InstanceIDs - it does not perform a recursive CTE.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions