Skip to content

Commit 486ad4e

Browse files
authored
Add rewind support (#296)
1 parent 38c074a commit 486ad4e

12 files changed

Lines changed: 1579 additions & 19 deletions

File tree

internal/protocol/SOURCE_COMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1caadbd7ecfdf5f2309acbeac28a3e36d16aa156
1+
3145f9337fca9de57d2f89a6ff6f07150d34f1c2

internal/protocol/protos/orchestrator_service.proto

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ message ActivityRequest {
2525
OrchestrationInstance orchestrationInstance = 4;
2626
int32 taskId = 5;
2727
TraceContext parentTraceContext = 6;
28+
map<string, string> tags = 7;
2829
}
2930

3031
message ActivityResponse {
@@ -320,6 +321,10 @@ message SendEntityMessageAction {
320321
}
321322
}
322323

324+
message RewindOrchestrationAction {
325+
repeated HistoryEvent newHistory = 1;
326+
}
327+
323328
message OrchestratorAction {
324329
int32 id = 1;
325330
oneof orchestratorActionType {
@@ -330,6 +335,7 @@ message OrchestratorAction {
330335
CompleteOrchestrationAction completeOrchestration = 6;
331336
TerminateOrchestrationAction terminateOrchestration = 7;
332337
SendEntityMessageAction sendEntityMessage = 8;
338+
RewindOrchestrationAction rewindOrchestration = 9;
333339
}
334340
}
335341

@@ -364,12 +370,14 @@ message OrchestratorResponse {
364370
// Whether or not a history is required to complete the original OrchestratorRequest and none was provided.
365371
bool requiresHistory = 7;
366372

373+
/* Chunking logic has since been deprecated and fields related to it are marked as such */
374+
367375
// True if this is a partial (chunked) completion. The backend must keep the work item open until the final chunk (isPartial=false).
368-
bool isPartial = 8;
376+
bool isPartial = 8 [deprecated=true];
369377

370378
// Zero-based position of the current chunk within a chunked completion sequence.
371379
// This field is omitted for non-chunked completions.
372-
google.protobuf.Int32Value chunkIndex = 9;
380+
google.protobuf.Int32Value chunkIndex = 9 [deprecated=true];
373381
}
374382

375383
message CreateInstanceRequest {
@@ -517,6 +525,7 @@ message PurgeInstanceFilter {
517525
google.protobuf.Timestamp createdTimeFrom = 1;
518526
google.protobuf.Timestamp createdTimeTo = 2;
519527
repeated OrchestrationStatus runtimeStatus = 3;
528+
google.protobuf.Duration timeout = 4;
520529
}
521530

522531
message PurgeInstancesResponse {

packages/durabletask-js/src/proto/orchestrator_service_pb.d.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ export class ActivityRequest extends jspb.Message {
6363
getParenttracecontext(): TraceContext | undefined;
6464
setParenttracecontext(value?: TraceContext): ActivityRequest;
6565

66+
getTagsMap(): jspb.Map<string, string>;
67+
clearTagsMap(): void;
68+
6669
serializeBinary(): Uint8Array;
6770
toObject(includeInstance?: boolean): ActivityRequest.AsObject;
6871
static toObject(includeInstance: boolean, msg: ActivityRequest): ActivityRequest.AsObject;
@@ -81,6 +84,8 @@ export namespace ActivityRequest {
8184
orchestrationinstance?: OrchestrationInstance.AsObject,
8285
taskid: number,
8386
parenttracecontext?: TraceContext.AsObject,
87+
88+
tagsMap: Array<[string, string]>,
8489
}
8590
}
8691

@@ -1613,6 +1618,28 @@ export namespace SendEntityMessageAction {
16131618

16141619
}
16151620

1621+
export class RewindOrchestrationAction extends jspb.Message {
1622+
clearNewhistoryList(): void;
1623+
getNewhistoryList(): Array<HistoryEvent>;
1624+
setNewhistoryList(value: Array<HistoryEvent>): RewindOrchestrationAction;
1625+
addNewhistory(value?: HistoryEvent, index?: number): HistoryEvent;
1626+
1627+
serializeBinary(): Uint8Array;
1628+
toObject(includeInstance?: boolean): RewindOrchestrationAction.AsObject;
1629+
static toObject(includeInstance: boolean, msg: RewindOrchestrationAction): RewindOrchestrationAction.AsObject;
1630+
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
1631+
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
1632+
static serializeBinaryToWriter(message: RewindOrchestrationAction, writer: jspb.BinaryWriter): void;
1633+
static deserializeBinary(bytes: Uint8Array): RewindOrchestrationAction;
1634+
static deserializeBinaryFromReader(message: RewindOrchestrationAction, reader: jspb.BinaryReader): RewindOrchestrationAction;
1635+
}
1636+
1637+
export namespace RewindOrchestrationAction {
1638+
export type AsObject = {
1639+
newhistoryList: Array<HistoryEvent.AsObject>,
1640+
}
1641+
}
1642+
16161643
export class OrchestratorAction extends jspb.Message {
16171644
getId(): number;
16181645
setId(value: number): OrchestratorAction;
@@ -1652,6 +1679,11 @@ export class OrchestratorAction extends jspb.Message {
16521679
getSendentitymessage(): SendEntityMessageAction | undefined;
16531680
setSendentitymessage(value?: SendEntityMessageAction): OrchestratorAction;
16541681

1682+
hasRewindorchestration(): boolean;
1683+
clearRewindorchestration(): void;
1684+
getRewindorchestration(): RewindOrchestrationAction | undefined;
1685+
setRewindorchestration(value?: RewindOrchestrationAction): OrchestratorAction;
1686+
16551687
getOrchestratoractiontypeCase(): OrchestratorAction.OrchestratoractiontypeCase;
16561688

16571689
serializeBinary(): Uint8Array;
@@ -1674,6 +1706,7 @@ export namespace OrchestratorAction {
16741706
completeorchestration?: CompleteOrchestrationAction.AsObject,
16751707
terminateorchestration?: TerminateOrchestrationAction.AsObject,
16761708
sendentitymessage?: SendEntityMessageAction.AsObject,
1709+
rewindorchestration?: RewindOrchestrationAction.AsObject,
16771710
}
16781711

16791712
export enum OrchestratoractiontypeCase {
@@ -1685,6 +1718,7 @@ export namespace OrchestratorAction {
16851718
COMPLETEORCHESTRATION = 6,
16861719
TERMINATEORCHESTRATION = 7,
16871720
SENDENTITYMESSAGE = 8,
1721+
REWINDORCHESTRATION = 9,
16881722
}
16891723

16901724
}
@@ -2557,6 +2591,11 @@ export class PurgeInstanceFilter extends jspb.Message {
25572591
setRuntimestatusList(value: Array<OrchestrationStatus>): PurgeInstanceFilter;
25582592
addRuntimestatus(value: OrchestrationStatus, index?: number): OrchestrationStatus;
25592593

2594+
hasTimeout(): boolean;
2595+
clearTimeout(): void;
2596+
getTimeout(): google_protobuf_duration_pb.Duration | undefined;
2597+
setTimeout(value?: google_protobuf_duration_pb.Duration): PurgeInstanceFilter;
2598+
25602599
serializeBinary(): Uint8Array;
25612600
toObject(includeInstance?: boolean): PurgeInstanceFilter.AsObject;
25622601
static toObject(includeInstance: boolean, msg: PurgeInstanceFilter): PurgeInstanceFilter.AsObject;
@@ -2572,6 +2611,7 @@ export namespace PurgeInstanceFilter {
25722611
createdtimefrom?: google_protobuf_timestamp_pb.Timestamp.AsObject,
25732612
createdtimeto?: google_protobuf_timestamp_pb.Timestamp.AsObject,
25742613
runtimestatusList: Array<OrchestrationStatus>,
2614+
timeout?: google_protobuf_duration_pb.Duration.AsObject,
25752615
}
25762616
}
25772617

0 commit comments

Comments
 (0)