Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] For private release: Add ContinueAsNew preserve events support for legacy OOProc #2863

Draft
wants to merge 1 commit into
base: v2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private string OrchestrationContextToString(DurableOrchestrationContext arg)
new JProperty("isReplaying", arg.IsReplaying),
new JProperty("parentInstanceId", arg.ParentInstanceId),
new JProperty("upperSchemaVersion", SchemaVersion.V2),
new JProperty("upperSchemaVersionNew", SchemaVersion.V3),
new JProperty("upperSchemaVersionNew", SchemaVersion.V4),
new JProperty("longRunningTimerIntervalDuration", arg.LongRunningTimerIntervalLength),
new JProperty("maximumShortTimerDuration", arg.MaximumShortTimerDuration),
new JProperty("defaultHttpAsyncRequestSleepTimeMillseconds", arg.DefaultHttpAsyncRequestSleepTimeMillseconds));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ internal enum SchemaVersion
Original = 0,
V2 = 1,
V3 = 2,
V4 = 3,
}

private enum AsyncActionType
Expand Down Expand Up @@ -168,7 +169,7 @@ private Task InvokeAPIFromAction(AsyncAction action, SchemaVersion schema)
}

case AsyncActionType.ContinueAsNew:
this.context.ContinueAsNew(action.Input);
this.context.ContinueAsNew(action.Input, action.PreserveUnprocessedEvents);
task = fireAndForgetTask;
break;
case AsyncActionType.WaitForExternalEvent:
Expand Down Expand Up @@ -229,6 +230,7 @@ private async Task ReplayOOProcOrchestration(AsyncAction[][] actions, SchemaVers
{
switch (schema)
{
case SchemaVersion.V4:
case SchemaVersion.V3:
case SchemaVersion.V2:
// In this schema, action arrays should be 1 dimensional (1 action per yield), but due to legacy behavior they're nested within a 2-dimensional array.
Expand Down Expand Up @@ -313,6 +315,9 @@ private class AsyncAction
[JsonProperty("input")]
internal object Input { get; set; }

[JsonProperty("preserveUnprocessedEvents")]
internal bool PreserveUnprocessedEvents { get; set; } = false;

[JsonProperty("compoundActions")]
internal AsyncAction[] CompoundActions { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<RootNamespace>Microsoft.Azure.WebJobs.Extensions.DurableTask</RootNamespace>
<MajorVersion>2</MajorVersion>
<MinorVersion>13</MinorVersion>
<PatchVersion>4</PatchVersion>
<VersionSuffix>$(PackageSuffix)</VersionSuffix>
<PatchVersion>5</PatchVersion>
<VersionSuffix>preview.1</VersionSuffix>
<FileVersion>$(MajorVersion).$(MinorVersion).$(PatchVersion)</FileVersion>
<AssemblyVersion>$(MajorVersion).0.0.0</AssemblyVersion>
<Company>Microsoft Corporation</Company>
Expand Down Expand Up @@ -57,7 +57,7 @@
<Compile Include="**/*.cs" Exclude="Auth/*.cs;Correlation/*.cs;**/obj/**/*.cs" />
<!-- Don't increase below versions without significantly testing on Functions V1!
Increasing these versions increments some dependencies that have binding redirects in Functions V1. -->
<PackageReference Include="Azure.Identity" Version="1.1.1" NoWarn="NU1902,NU1903"/> <!-- Added NoWarn as this dependency cannot be dropped due to Functions V1-->
<PackageReference Include="Azure.Identity" Version="1.1.1" NoWarn="NU1902,NU1903" /> <!-- Added NoWarn as this dependency cannot be dropped due to Functions V1-->
<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="1.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="1.0.2" />
Expand Down
Loading