From 1d77d47fd6dfd8ab05a5b2fa4f794e005b632a3f Mon Sep 17 00:00:00 2001 From: sebastianburckhardt Date: Fri, 6 Oct 2023 16:13:42 -0700 Subject: [PATCH 1/2] rename includeStateless to includeTransient --- .../EntityTrackingStoreQueries.cs | 2 +- .../Entities/EntityBackendQueries.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs b/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs index b14fe9e26..301725ba0 100644 --- a/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs +++ b/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs @@ -107,7 +107,7 @@ async ValueTask> ConvertResultsAsync(IEnumerable(); foreach (OrchestrationState entry in states) { - EntityMetadata? entityMetadata = await this.GetEntityMetadataAsync(entry, filter.IncludeStateless, filter.IncludeState); + EntityMetadata? entityMetadata = await this.GetEntityMetadataAsync(entry, filter.IncludeTransient, filter.IncludeState); if (entityMetadata.HasValue) { entityResult.Add(entityMetadata.Value); diff --git a/src/DurableTask.Core/Entities/EntityBackendQueries.cs b/src/DurableTask.Core/Entities/EntityBackendQueries.cs index 2ab17a6f1..7f85012c6 100644 --- a/src/DurableTask.Core/Entities/EntityBackendQueries.cs +++ b/src/DurableTask.Core/Entities/EntityBackendQueries.cs @@ -112,14 +112,15 @@ public struct EntityQuery public bool IncludeState { get; set; } /// - /// Gets a value indicating whether to include metadata about entities that have no user-defined state. + /// Gets a value indicating whether to include metadata about transient entities. /// - /// Stateless entities occur when the storage provider is tracking metadata about an entity for synchronization purposes - /// even though the entity does not "logically" exist, in the sense that it has no application-defined state. - /// Stateless entities are usually transient. For example, they may be in the process of being created or deleted, or - /// they may have been locked by a critical section. + /// Transient entities are entities that do not have an application-defined state, but for which the storage provider is + /// tracking metadata for synchronization purposes. + /// For example, a transient entity may be observed when the entity is in the process of being created or deleted, or + /// when the entity has been locked by a critical section. By default, transient entities are not included in queries since they are + /// considered to "not exist" from the perspective of the user application. /// - public bool IncludeStateless { get; set; } + public bool IncludeTransient { get; set; } /// /// Gets or sets the desired size of each page to return. From fd95e38479103a0b85e59c24701b7a1b5e65df62 Mon Sep 17 00:00:00 2001 From: sebastianburckhardt Date: Fri, 6 Oct 2023 16:17:09 -0700 Subject: [PATCH 2/2] rename variable also --- src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs b/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs index 301725ba0..dead69db6 100644 --- a/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs +++ b/src/DurableTask.AzureStorage/EntityTrackingStoreQueries.cs @@ -200,7 +200,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status) }; } - async ValueTask GetEntityMetadataAsync(OrchestrationState? state, bool includeStateless, bool includeState) + async ValueTask GetEntityMetadataAsync(OrchestrationState? state, bool includeTransient, bool includeState) { if (state == null) { @@ -209,7 +209,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status) if (!includeState) { - if (!includeStateless) + if (!includeTransient) { // it is possible that this entity was logically deleted even though its orchestration was not purged yet. // we can check this efficiently (i.e. without deserializing anything) by looking at just the custom status @@ -247,7 +247,7 @@ bool OrchestrationIsRunning(OrchestrationStatus? status) string? serializedEntityState = ClientEntityHelpers.GetEntityState(serializedSchedulerState); // return the result to the user - if (!includeStateless && serializedEntityState == null) + if (!includeTransient && serializedEntityState == null) { return null; }