From 6be87f25f250536c7396d6a422ae7262271b6b23 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 07:03:46 -0700 Subject: [PATCH 01/13] add recovery policy and process state config --- api-schema/xdb.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 3e3c726..9bb3784 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -499,6 +499,10 @@ components: $ref: '#/components/schemas/RetryPolicy' executeApiRetryPolicy: $ref: '#/components/schemas/RetryPolicy' + stateFailureRecoveryPolicy: + $ref: '#/components/schemas/StateFailureRecoveryPolicy' + stateFailureProceedStateConfig: + $ref: '#/components/schemas/AsyncStateConfig' RetryPolicy: type: object properties: @@ -518,6 +522,11 @@ components: maximumAttemptsDurationSeconds: type: integer description: the maximum duration of all attempts, default to 0, means unlimited + StateFailureRecoveryPolicy: + type: string + enum: + - FAIL_WORKFLOW_ON_STATE_FAILURE + - PROCEED_TO_CONFIGURED_STATE ProcessExecutionStartResponse: type: object description: response of ProcessExecutionStartRequest From 3139171146e532c5c82132da05bac7f396424803 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 09:20:47 -0700 Subject: [PATCH 02/13] fix --- api-schema/xdb.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 9bb3784..ee5aea4 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -501,6 +501,8 @@ components: $ref: '#/components/schemas/RetryPolicy' stateFailureRecoveryPolicy: $ref: '#/components/schemas/StateFailureRecoveryPolicy' + stateFailureProceedStateId: + type: string stateFailureProceedStateConfig: $ref: '#/components/schemas/AsyncStateConfig' RetryPolicy: From b0e5e297c5d13df0f60d89566a93f61fd95d7d44 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 11:36:41 -0700 Subject: [PATCH 03/13] address comment --- api-schema/xdb.yaml | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index ee5aea4..b1c4fe3 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -411,6 +411,15 @@ components: attempt: description: for async state API only(during backoff retry) type: integer + lastFailedStateExecutionId: + description: for async state API only, state id + sequence number + type: string + lastFailedApi: + description: for async state API only + type: string + enum: + - WAIT_UNTIL + - EXECUTE WorkerErrorResponse: type: object required: @@ -500,7 +509,9 @@ components: executeApiRetryPolicy: $ref: '#/components/schemas/RetryPolicy' stateFailureRecoveryPolicy: - $ref: '#/components/schemas/StateFailureRecoveryPolicy' + oneof: + - $ref: '#/components/schemas/FailProcessOnStateFailureRecoveryPolicy' + - $ref: '#/components/schemas/ProceedToConfiguredStateRecoveryPolicy' stateFailureProceedStateId: type: string stateFailureProceedStateConfig: @@ -524,11 +535,30 @@ components: maximumAttemptsDurationSeconds: type: integer description: the maximum duration of all attempts, default to 0, means unlimited - StateFailureRecoveryPolicy: - type: string - enum: - - FAIL_WORKFLOW_ON_STATE_FAILURE - - PROCEED_TO_CONFIGURED_STATE + FailProcessOnStateFailureRecoveryPolicy: + type: object + required: + - name + properties: + name: + type: string + enum: + - FAIL_PROCESS_ON_STATE_FAILURE + ProceedToConfiguredStateRecoveryPolicy: + type: object + required: + - name + - stateId + - stateConfig + properties: + name: + type: string + enum: + - PROCEED_TO_CONFIGURED_STATE + stateId: + type: string + stateConfig: + $ref: '#/components/schemas/AsyncStateConfig' ProcessExecutionStartResponse: type: object description: response of ProcessExecutionStartRequest From 0223ca2a102bd2f62a4545744c1c9f33325d485c Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 11:42:15 -0700 Subject: [PATCH 04/13] failed state exec id and api could be null in context --- api-schema/xdb.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index b1c4fe3..552ae99 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -414,9 +414,11 @@ components: lastFailedStateExecutionId: description: for async state API only, state id + sequence number type: string + nullable: true lastFailedApi: description: for async state API only type: string + nullable: true enum: - WAIT_UNTIL - EXECUTE From 52446ebfb7031c3a348d8da76ecf7ec5aa1ed0ea Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 11:45:40 -0700 Subject: [PATCH 05/13] avoid using null --- api-schema/xdb.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 552ae99..00ba60c 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -414,14 +414,13 @@ components: lastFailedStateExecutionId: description: for async state API only, state id + sequence number type: string - nullable: true lastFailedApi: description: for async state API only type: string - nullable: true enum: - WAIT_UNTIL - EXECUTE + - NONE WorkerErrorResponse: type: object required: From af66022346238b52649b5bfc02716648fb072103 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 11:46:55 -0700 Subject: [PATCH 06/13] description --- api-schema/xdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 00ba60c..d666033 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -415,7 +415,7 @@ components: description: for async state API only, state id + sequence number type: string lastFailedApi: - description: for async state API only + description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE type: string enum: - WAIT_UNTIL From 5f97cc40096a4f1ad0be080d72600397e35b4631 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 11:59:45 -0700 Subject: [PATCH 07/13] not using oneof --- api-schema/xdb.yaml | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index d666033..8695149 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -510,9 +510,19 @@ components: executeApiRetryPolicy: $ref: '#/components/schemas/RetryPolicy' stateFailureRecoveryPolicy: - oneof: - - $ref: '#/components/schemas/FailProcessOnStateFailureRecoveryPolicy' - - $ref: '#/components/schemas/ProceedToConfiguredStateRecoveryPolicy' + type: object + required: + - name + properties: + name: + type: string + enum: + - FAIL_PROCESS_ON_STATE_FAILURE + - PROCEED_TO_CONFIGURED_STATE + stateFailureProceedStateId: # only valid when name is PROCEED_TO_CONFIGURED_STATE + type: string + stateFailureProceedStateConfig: # only valid when name is PROCEED_TO_CONFIGURED_STATE + $ref: '#/components/schemas/AsyncStateConfig' stateFailureProceedStateId: type: string stateFailureProceedStateConfig: @@ -536,30 +546,6 @@ components: maximumAttemptsDurationSeconds: type: integer description: the maximum duration of all attempts, default to 0, means unlimited - FailProcessOnStateFailureRecoveryPolicy: - type: object - required: - - name - properties: - name: - type: string - enum: - - FAIL_PROCESS_ON_STATE_FAILURE - ProceedToConfiguredStateRecoveryPolicy: - type: object - required: - - name - - stateId - - stateConfig - properties: - name: - type: string - enum: - - PROCEED_TO_CONFIGURED_STATE - stateId: - type: string - stateConfig: - $ref: '#/components/schemas/AsyncStateConfig' ProcessExecutionStartResponse: type: object description: response of ProcessExecutionStartRequest From f3c270934bb3bc5eac8d154752baf5e8fbf84356 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 12:00:56 -0700 Subject: [PATCH 08/13] fix --- api-schema/xdb.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 8695149..3c86cd5 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -523,10 +523,6 @@ components: type: string stateFailureProceedStateConfig: # only valid when name is PROCEED_TO_CONFIGURED_STATE $ref: '#/components/schemas/AsyncStateConfig' - stateFailureProceedStateId: - type: string - stateFailureProceedStateConfig: - $ref: '#/components/schemas/AsyncStateConfig' RetryPolicy: type: object properties: From d02263ba5007d36cd2e74c6a11767771f796ed4f Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 18:40:36 -0700 Subject: [PATCH 09/13] address comment --- api-schema/xdb.yaml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 3c86cd5..bc6da18 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -411,16 +411,16 @@ components: attempt: description: for async state API only(during backoff retry) type: integer - lastFailedStateExecutionId: + recoverFromStateExecutionId: description: for async state API only, state id + sequence number type: string - lastFailedApi: + recoverFromApi: description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE type: string enum: - - WAIT_UNTIL - - EXECUTE - - NONE + - WAIT_UNTIL_API + - EXECUTE_API + - NO_API_FAILURE WorkerErrorResponse: type: object required: @@ -509,20 +509,22 @@ components: $ref: '#/components/schemas/RetryPolicy' executeApiRetryPolicy: $ref: '#/components/schemas/RetryPolicy' - stateFailureRecoveryPolicy: + stateFailureRecoveryInfo: type: object required: - - name + - policy properties: - name: - type: string - enum: - - FAIL_PROCESS_ON_STATE_FAILURE - - PROCEED_TO_CONFIGURED_STATE + policy: + $ref: '#/components/schemas/StateFailureRecoveryPolicy' stateFailureProceedStateId: # only valid when name is PROCEED_TO_CONFIGURED_STATE type: string stateFailureProceedStateConfig: # only valid when name is PROCEED_TO_CONFIGURED_STATE $ref: '#/components/schemas/AsyncStateConfig' + StateFailureRecoveryPolicy: + type: string + enum: + - FAIL_PROCESS_ON_STATE_FAILURE + - PROCEED_TO_CONFIGURED_STATE RetryPolicy: type: object properties: From e122efc3de3b9ff9223d603e1356a6f02ed16f26 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 18:44:26 -0700 Subject: [PATCH 10/13] fix --- api-schema/xdb.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index bc6da18..f0b7793 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -416,11 +416,13 @@ components: type: string recoverFromApi: description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE - type: string - enum: - - WAIT_UNTIL_API - - EXECUTE_API - - NO_API_FAILURE + $ref: '#/components/schemas/RecoverFromApiFailureType' + ApiFailureType: + type: string + enum: + - WAIT_UNTIL_API + - EXECUTE_API + - NO_API_FAILURE WorkerErrorResponse: type: object required: From d61ee0e9450d944d8d513c3e7bd081716f310c0c Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 18:44:55 -0700 Subject: [PATCH 11/13] fix --- api-schema/xdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index f0b7793..04c0f44 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -416,7 +416,7 @@ components: type: string recoverFromApi: description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE - $ref: '#/components/schemas/RecoverFromApiFailureType' + $ref: '#/components/schemas/ApiFailureType' ApiFailureType: type: string enum: From eda01ae21ccb95b3a088fe067f4a542bca858253 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 18:47:42 -0700 Subject: [PATCH 12/13] fix --- api-schema/xdb.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 04c0f44..04ce2ce 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -416,13 +416,12 @@ components: type: string recoverFromApi: description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE - $ref: '#/components/schemas/ApiFailureType' - ApiFailureType: + $ref: '#/components/schemas/ApiType' + ApiType: type: string enum: - WAIT_UNTIL_API - EXECUTE_API - - NO_API_FAILURE WorkerErrorResponse: type: object required: From df767ee62bb24e28bb602897afd2385c7d692ab7 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 23 Oct 2023 18:50:40 -0700 Subject: [PATCH 13/13] fix --- api-schema/xdb.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-schema/xdb.yaml b/api-schema/xdb.yaml index 04ce2ce..c3dc579 100644 --- a/api-schema/xdb.yaml +++ b/api-schema/xdb.yaml @@ -416,8 +416,8 @@ components: type: string recoverFromApi: description: if last execution failed, WAIT_UNTIL or EXECUTE, otherwise NONE - $ref: '#/components/schemas/ApiType' - ApiType: + $ref: '#/components/schemas/StateApiType' + StateApiType: type: string enum: - WAIT_UNTIL_API