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 摘要。