azure-durable-functions - PurgeInstanceHistoryAsync 是否删除使用 ContinueAsNew 的无限编排的旧历史记录
问题描述
我有一个编排,它每次都使用相同的实例 ID 作为单例运行。它还通过在每次迭代结束时使用 ContinueAsNew 无限运行以保持历史可管理。但是,我注意到每次过去迭代的历史都保存在历史表中,每个都有不同的执行 ID(正如调用 ContinueAsNew 时所预期的那样)。
我还每天使用一次 PurgeInstanceHistoryAsync 来删除任何超过 14 天的已完成、失败、终止或取消的业务流程。但是,由于无限单例编排永远不会处于这些状态中的任何一个,PurgeInstanceHistoryAsync 是否会清理旧的执行历史记录?
可以针对周期性单例编排(即定期运行但每次使用相同实例 ID 的编排)提出相同的问题。如果清除过程在编排运行时发生,是否会删除任何旧的历史记录,或者在清除执行时编排实际上没有运行是否是幸运的问题?
解决方案
If you look in your history table in the azure storage account and query for your instance you should see that using ContinueAsNew will actually purge history automatically. (In my test it seemed to be at most 1 execution behind.)
When ContinueAsNew is called, the instance enqueues a message to itself before it exits. The message restarts the instance with the new input value. The same instance ID is kept, but the orchestrator function's history is effectively truncated.
推荐阅读
- python - 在python的geoJson文件中提取多边形中心的坐标
- android - Flutter 应用程序在 Android 上运行一段时间后变为空白?
- javascript - 如何使javascript适用于while循环中的每个图像?
- mysql - SQL 数据库 - 更改属性的部分文本内容
- amazon-web-services - 我可以在 S3 策略中使用 Cognito 用户池用户名吗?
- generics - 如何为两个或三个属性或属性数量制作下面的代码泛型
- java - loesung.charAt(i) 给出错误:预期的意外类型:变量,找到值
- algorithm - 在二叉搜索树中,如果它与父节点相等,我们将节点放在哪一边
- asp.net - 在 web.config 中将 Debug 值更改为 false 后出现请求超时错误
- reactjs - React:将 mount 事件与 useEffect 与 useReducer 进行比较