-
Notifications
You must be signed in to change notification settings - Fork 34
PurgeAllInstancesAsync - Durable SQL Provider - Deletes only 1000 instances maximum #297
Copy link
Copy link
Open
Labels
P1Priority 1Priority 1bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested
Description
We see a behavior, where, only a 1000 instances have been deleted though there are many eligible instances are available in the 'Instances' table.
Is this behavior a default one?
Is there a way to increase this limit of 1000?
Our intention is to run the PurgeAll once every day but with this restriction we left with millions of records in our sql db, indirectly hindering our running durable orchestrators performance.
[Function("PurgeDurableFunctionsHistory")]
public async Task RunAsync([TimerTrigger("%PurgeDurableFunctionsHistory:Schedule%")] TimerInfo myTimer, [DurableClient] DurableTaskClient client, CancellationToken cancellationToken)
{
PurgeResult result = null;
if (!int.TryParse(Environment.GetEnvironmentVariable("PurgeDurableFunctionsHistoryDays"), out int deletePurgeHistoryDays))
{
deletePurgeHistoryDays = 30;
}
var orchStatus = new List<OrchestrationRuntimeStatus>
{
OrchestrationRuntimeStatus.Completed,
};
var purgeFilter = new PurgeInstancesFilter(
DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc),
DateTime.SpecifyKind(DateTime.UtcNow.AddDays(deletePurgeHistoryDays * -1), DateTimeKind.Utc),
orchStatus);
result = await client.PurgeAllInstancesAsync(purgeFilter, cancellationToken).ConfigureAwait(false);
}
NuGet used:
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.1.4" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer" Version="1.3.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.22.0" />
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Priority 1Priority 1bugSomething isn't workingSomething isn't workingquestionFurther information is requestedFurther information is requested