Skip to content

Apply parallel group policy eligibility to query and validation tasks - #1384

Merged
rmcdaniel merged 1 commit into
mainfrom
general/server-1382-replay-task-policies
Nov 26, 2026
Merged

rmcdaniel merged 1 commit into
mainfrom
general/server-1382-replay-task-policies

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Fixes #1382. Follow-up to #1381 for durable-workflow/.github#232. It must land before any explicit policy is advertised.

What changes

  • The problem. Query tasks and update-validation tasks replay the run's history, but they skipped the existing replay-eligibility checks.
  • Same check as workflow tasks. Both now apply the same parallel_group_policies eligibility as workflow tasks (group_policies_supported, from Route explicit-policy runs only to workers that register their policies #1381):
    • query claims (claim_query_in) and query offers (peek_query_offer)
    • validation claims (claim_update_validation_in) and validation offers (peek_validation_offer)
  • Effect on workers. A worker whose registered descriptor lacks a policy the run recorded is skipped. Legacy runs are unaffected.
  • Queries. A query waits for a capable worker, within its own deadline.
  • Updates. The validator route gains one last link. If every fresh validator that serves the update lacks a recorded policy, the update is refused at once with 409 update_validator_parallel_group_policy_unsupported, and nothing is recorded.

Tests (tests/execution/parallel_group_replay_tasks.rs)

  • On an explicit propagate run, a legacy query worker keeps polling and never receives the query. A capable worker claims it.
  • On the same run with only a legacy validator, the update is refused with the stable reason and history is unchanged. Once a capable validator registers, the validation task goes to it and never to the legacy validator.
  • With the source change reverted, both tests fail: the legacy worker receives the query, and the update is left unclaimed.
  • Local runs:
    • the new tests on SQLite, PostgreSQL 17 and MySQL 8.4
    • the existing update_validation, query_* and queries_* execution tests on SQLite (57 in total)
    • CI runs the full matrices.

🤖 Generated with Claude Code

Query tasks and update-validation tasks replay a run's history, but
they skipped the replay eligibility checks. A worker without a policy
the run recorded could answer a query from a misread replay, or record
an update validation decision from one.

Query and update-validation dispatch now apply the same policy check as
workflow tasks, in claims and in task offers. A query waits for a
capable worker. An update whose fresh validators cannot replay the run
is refused at once with update_validator_parallel_group_policy_unsupported,
and nothing is recorded.

Fixes #1382
Refs durable-workflow/.github#232

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Independent review: PASS at head 12dd9f6

This closes the routing gap I asked to be fixed before advertisement on server#1381.

What I verified

  • Query tasks. Both peek_query_offer and claim_query_in apply group_policies_supported. They use the full registration row, so capability_manifest is read. The query task document carries run_id (queries.rs field list), so the check cannot fall back to an empty run id.
  • Update-validation tasks. Both peek_validation_offer and claim_update_validation_in apply the same check.
  • validation_route. It gains a last link: if no fresh, capable validator that serves the update registers every recorded policy, the update is refused with 409 update_validator_parallel_group_policy_unsupported, marked retryable. This runs after the existing links, so the existing refusal reasons keep their order. It reads on a pooled connection, as the existing route query does.
  • History unchanged on refusal. The refusal leaves history untouched. As with the existing route refusals, the validation task row is inserted before the route check.
  • Tests. The new tests show that a legacy worker never receives the explicit run's query or validation, and that a capable worker does.
  • Local run. 71 of 71 tests pass on SQLite: the new file plus update_validation, the query suites and parallel_group_policies.
  • CI. Fully green at this head: 63 pass, and the conditional candidate-qualification job was skipped. This branch is based on main before Admit settle parallel groups and wake once every member has an outcome #1383. The merge queue tests the combination, and the two PRs touch disjoint files.

Non-blocking notes

  1. Queries have no matching route link. A query against an explicit run where only legacy query workers are present waits until its deadline and then times out, rather than being refused with a stable reason as updates now are. A query_route link would make that failure faster and clearer.
  2. When the new refusal fires, the pending validation task row stays behind. A capable validator that registers later may claim it, even though no caller is waiting. This is the same as the existing route refusals, so it is not new here.

@rmcdaniel
rmcdaniel added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit c11eb6a Nov 26, 2026
64 checks passed
@rmcdaniel
rmcdaniel deleted the general/server-1382-replay-task-policies branch November 26, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apply parallel-group policy eligibility to query and update-validation tasks

1 participant