microsoft / microsoft/durabletask-java

ContinueAsNew does not support specifying a new orchestration version

未關閉
#276 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Needs: Triage :mag:
主要語言
Java
星號
29
分支
18
平均合併
1 天 10 小時
30 天內合併 PR
2

描述

Summary

The continueAsNew() API does not expose a way to specify a new orchestration version for the restarted instance. The underlying protobuf field (CompleteOrchestrationAction.newVersion, field 4) has existed since the initial proto commit, but the Java SDK never populates it.

Problem

TaskOrchestrationContext.continueAsNew() only accepts (Object input, boolean preserveUnprocessedEvents). There is no parameter to pass a new version. In TaskOrchestrationExecutor, when building the CompleteOrchestrationAction, setNewVersion() is never called — the field is always left empty.

This prevents version migration scenarios for long-running/eternal orchestrations (e.g., monitoring loops that need to evolve their logic over time via continueAsNew with a new version).

What exists today

  • Proto layer: CompleteOrchestrationAction.newVersion (field 4) is defined and supported by all backends (DurableTask.Core since 2014, DTS/Beskar, gRPC sidecar)
  • Java API: continueAsNew(Object input) and continueAsNew(Object input, boolean preserveUnprocessedEvents) — no version parameter
  • Java executor: CompleteOrchestrationAction.Builder never calls setNewVersion()

Proposed fix

Follow the pattern from the .NET SDK (microsoft/durabletask-dotnet#682):

  1. Add a ContinueAsNewOptions class with newInput, preserveUnprocessedEvents, and newVersion properties
  2. Add a continueAsNew(ContinueAsNewOptions options) overload to TaskOrchestrationContext
  3. In TaskOrchestrationExecutor, when newVersion is non-null, call builder.setNewVersion(StringValue.of(newVersion)) on the CompleteOrchestrationAction

Related

  • .NET SDK implementation: microsoft/durabletask-dotnet#682
  • Azure Functions extension: Azure/azure-functions-durable-extension#3404
  • Proto field: CompleteOrchestrationAction.newVersion (field 4) in orchestrator_service.proto

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先定位 TaskOrchestrationContext 和 TaskOrchestrationExecutor,接著檢查現有的 continueAsNew 多載以及 CompleteOrchestrationAction 的建構。使用描述中連結的 .NET SDK issue 作為所提議 options 形狀的參考。當 Java 呼叫端可以提供新版本,且 executor 在保留目前行為的同時填入 CompleteOrchestrationAction.newVersion 時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
backend-api-design, distributed-systems
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。