feat: recover poll activations within original round budgets

This commit is contained in:
2026-09-18 05:40:08 +08:00
parent 1d1a441167
commit 56b9a2ccfe
32 changed files with 1051 additions and 65 deletions

View File

@@ -13,13 +13,17 @@ type PollState struct {
core.Record
// WorkflowID 所属流程实例标识。
WorkflowID core.ID `db:"workflow_id"`
// ActivationID 所属步骤激活,区分旧轮次和人工恢复后的新轮次。
// ActivationID 所属步骤激活;人工恢复可在新激活沿用同一业务轮编号。
ActivationID core.ID `db:"activation_id"`
// MaxRounds 业务查询最多轮次,不等于单轮请求重试次数。
MaxRounds uint32 `db:"max_rounds"`
// UsedRounds 已创建的查询轮次,重启或暂停继续不得重置。
// UsedRounds 从首次激活起已创建的业务轮次数;当前激活的本地行数需扣除FirstRound之前的历史。
UsedRounds uint32 `db:"used_rounds"`
// MaxAttemptsPerRound 每轮 Pulse 任务最多尝试数,包含该轮首次请求。
// FirstRound 本激活保存的首个业务查询轮次;恢复保留原编号,之前轮次仍留在旧激活。
FirstRound uint32 `db:"first_round"`
// FirstRoundAttemptsUsed 首个业务轮次在旧激活已用的执行尝试;从原单轮预算扣除,不能通过换激活重置。
FirstRoundAttemptsUsed uint32 `db:"first_round_attempts_used"`
// MaxAttemptsPerRound 每业务轮跨激活的Pulse尝试总上限,包含该轮首次请求。
MaxAttemptsPerRound uint32 `db:"max_attempts_per_round"`
// IntervalMS 相邻业务查询轮次的等待间隔,单位毫秒。
IntervalMS uint64 `db:"interval_ms"`