Add missing indexes to call stack columns in EF Core migrations#7245
Closed
sfmskywalker with Copilot wants to merge 20 commits into
Closed
Add missing indexes to call stack columns in EF Core migrations#7245sfmskywalker with Copilot wants to merge 20 commits into
sfmskywalker with Copilot wants to merge 20 commits into
Conversation
Implements a call stack mechanism to track the execution chain, enabling visibility into the invocation hierarchy. Introduces new fields to scheduling models and runtime contexts to store call stack information. Includes EF Core migrations for various database providers to support new columns in `ActivityExecutionRecords`. Provides an API to query and reconstruct the call stack for a given activity execution.
… chain pagination
…serialized columns in Oracle.
…2(2000)` to `NCLOB` in Oracle schema.
Simplifies scheduling logic by removing ambient scope mechanisms, refactoring scheduling context handling, and updating affected classes accordingly.
…ully and add `TryGetWorkflowGraphAsync` helper methods.
…vity execution call stack
…ecution tracking Introduce fields for aggregated fault count, scheduling context, workflow instance details, and call stack depth to enhance execution monitoring and debugging capabilities.
Introduced components and models to display a call stack for activity executions in the Workflow Instance Viewer. This includes UI elements for call stack rendering, error handling, and data integration with activity execution records.
Added cycle detection using a `HashSet` to prevent infinite loops when traversing activity execution chains in multiple storage implementations. Updated unit tests to validate correct handling of circular references and chain traversal.
Centralized the `GetExecutionChainAsync` method into an extension class to streamline and unify its implementation across stores. Removed redundant implementations from individual stores and updated interfaces to utilize the new extension method. This reduces code duplication and simplifies future maintenance.
Integrated the `CallStackDepth` property into `ActivityExecutionContext`, `ActivityExecutionContextState`, and related classes to track and manage the call stack depth of activity executions. Removed obsolete depth calculation logic to streamline the process.
- Add `WorkflowExecutionContextTests` to verify correct calculation of call stack depth during activity execution. - Add `WorkflowStateExtractorTests` to ensure call stack depth is preserved during state extraction and application.
…utionMapper - Recreated `DefaultActivityExecutionMapperTests` to fix compilation issues due to corrupted code. - Restored unit test `MapAsync_SetsCallStackDepth_FromContext` ensuring proper handling of `CallStackDepth`.
- Deleted `DefaultActivityExecutionMapperTests_Fixed.cs` due to corruption. - Updated project references to include `Elsa.Testing.Shared` for unit tests.
…tCallStack/Endpoint.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…tCallStack/Endpoint.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: sfmskywalker <938393+sfmskywalker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update activity execution call stack support based on feedback
Add missing indexes to call stack columns in EF Core migrations
Feb 4, 2026
212c69c to
7b9a27e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The V3_7 migrations added call stack tracking columns (
SchedulingActivityExecutionId,SchedulingActivityId,SchedulingWorkflowInstanceId) but omitted the indexes required by the plan document. These columns are used in WHERE clauses and recursive chain traversal, causing table scans on unindexed columns.Changes
nvarchar(max)→nvarchar(450)(matches other ID columns)longtext→varchar(255)(matches other ID columns)Query Context
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.