You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CleanEntityStorageAsync() does not clean entities (likely 'transient' ones) #324
Hi! I am migrating some code from from in-process durable framework to isolated model, and I got stuck with handling entities.
I was looking for an option to completely delete entities. Reading docs, I learned that I can use DurableTaskClient.CleanEntityStorageAsync() to clean storage. I manually delete state for entities I wish to query and then I call this method, which does nothing, reporting that it purged exactly 0 entities.
Now my entities in question appear to be 'transient' so that I need to pass new EntityQuery { IncludeTransient = true } to GetAllEntitiesAsync() in order to see them in the output. It feels like by deleting state I promoted entities to transient and now entity storage is not cleaned because of that. The scenario for debugging is roughly the following:
// Here I get two transient entities with no statevarentities=awaitclient.Entities.GetAllEntitiesAsync(newEntityQuery{IncludeState=true,IncludeTransient=true}).ToListAsync();// And here I get 0 removed entities and 0 orphaned locks releasedvarresult=awaitclient.Entities.CleanEntityStorageAsync(newCleanEntityStorageRequest{RemoveEmptyEntities=true,ReleaseOrphanedLocks=true});// Here again I get two entitiesvarentitiesAfter=awaitclient.Entities.GetAllEntitiesAsync(newEntityQuery{IncludeState=true,IncludeTransient=true}).ToListAsync();
Perhaps I do not understand something about this flow?
Also, when querying for entities, even though I specify IncludeState = true, resulting metadata do not include state and have IncludesState set to false. Is this how it is supposed to work?
I debug this code locally, backing durable framework by Azurite storage, so I can access and inspect my entities, and check if they are removed or not, or if they have associated state.
Activity