docs/plans/2026-01-13-task-run-payload-ha-design.md
TaskRunSchedulerInfo is stored in-memory in Bus.sync.Map. This breaks HA:
Add a payload JSONB column to task_run table, storing a TaskRunPayload proto that contains SchedulerInfo. Future fields can be added to the proto without schema changes.
proto/store/store/task_run.proto:
message TaskRunPayload {
SchedulerInfo scheduler_info = 1;
// Future fields added here without schema changes
}
Migration backend/migrator/migration/3.14/0032##task_run_payload.sql:
ALTER TABLE task_run ADD COLUMN payload jsonb NOT NULL DEFAULT '{}';
backend/store/task_run.go:
PayloadProto *storepb.TaskRunPayload to TaskRunMessagepayload to SELECT, unmarshal with protojsonUpdateTaskRunPayload(ctx, taskRunID, payload) methodbackend/runner/taskrun/pending_scheduler.go:
storeParallelLimitCause(): Write TaskRunPayload{SchedulerInfo: ...} to DBpromoteTaskRun(): Write empty TaskRunPayload{} to clearbackend/api/v1/rollout_service_converter.go:
bus *bus.Bus parameterSchedulerInfo from taskRun.PayloadProto.SchedulerInfobackend/component/bus/bus.go:
TaskRunSchedulerInfo sync.Mapproto/store/store/task_run.proto - Add TaskRunPayloadbackend/migrator/migration/3.14/0032##task_run_payload.sql - Newbackend/migrator/migration/LATEST.sql - Add columnbackend/migrator/migrator_test.go - Update versionbackend/store/task_run.go - Add field and methodsbackend/runner/taskrun/pending_scheduler.go - Use storebackend/api/v1/rollout_service_converter.go - Remove Busbackend/api/v1/rollout_service.go - Update converter callsbackend/component/bus/bus.go - Remove field