OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.35k stars 2.37k forks source link

Workflows need a trimming task #11609

Closed deanmarcussen closed 1 month ago

deanmarcussen commented 2 years ago

Currently workflows can either

Suggest they need a background trimming task, like audit trail.

by our estimations, when a workflow reaches, around 13K entries, they no longer become browseable - actually gets to the point where the SQL Client throws out of memory exceptions, trying to parse strings)

This is due to this open ended query here, which also needs fixing.

https://github.com/OrchardCMS/OrchardCore/blob/f409fd55eec4b114d34e6f8d83aac93d9f81fc63/src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs#L129-L132

The query was done like this to add an instance count to the list, but it's retrieving too many rows, when there have been too many workflows.

Suggest we need a reduce index to handle the instance count as well.

However 13K instances is unnecesary, but we do need to keep at least a month's worth, for auditing purposes

sebastienros commented 2 years ago

I use the word pruning.

Piedone commented 1 month ago

More context: https://github.com/OrchardCMS/OrchardCore/issues/16447.

That instance count was removed due to the same reason since then BTW.

deanmarcussen commented 1 month ago

ah good to know thanks @Piedone

Piedone commented 1 month ago

Will you be able to contribute the implementation you've mentioned under https://github.com/OrchardCMS/OrchardCore/issues/16447#issuecomment-2237554735 any time soon @deanmarcussen? Otherwise, I'd look into this.

deanmarcussen commented 1 month ago

yes, good reminder, I have some time today, so will see what I can do.

Piedone commented 1 month ago

Awesome!