mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
## What changed?
- WISOTT
- Also added a cache per history host so that we don't overburden
matching with these calls.
- Also added a whole new unit test testing the function
`ValidateVersioningOverride`
- TODO in a follow-up PR: add metrics for this cache. Doing this as a
follow-up in the interest of time but have it tracked in JIRA.
## Why?
- Versioning correctness.
## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [x] added new functional test(s)
## Potential risks
- I don't think this is risky
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Validate versioning overrides by ensuring pinned versions exist in the
task queue via matching RPC with a per-host cache, refactor validation
into history APIs, and add configs and tests.
>
> - **Worker Versioning / Validation**:
> - Add `ValidateVersioningOverride(ctx, ...)` to verify pinned versions
exist in a task queue via `matching.CheckTaskQueueVersionMembership`.
> - Introduce per-host `versionMembershipCache` to cache membership
results; reject with `FailedPrecondition` if not present.
> - Remove frontend/batcher inline override validation; perform it in
history layer (start, signal-with-start, update options, reset
post-ops).
> - **History Service Wiring**:
> - Thread `matchingClient` and `versionMembershipCache` through history
engine, starter, multi-op, signal-with-start, reset, and
update-workflow-options APIs.
> - Mark batch UpdateWorkflowOptions non-retryable for "Pinned version
is not present in the task queue".
> - **Config / Dynamic Config**:
> - Add `history.versionMembershipCacheTTL` and
`history.versionMembershipCacheMaxSize`; provide cache in `fx` with
lifecycle management.
> - **Testing**:
> - Add unit tests for `ValidateVersioningOverride` covering cache
hits/misses and v0.31/v0.32 paths.
> - Extend functional tests to assert membership checks, cache behavior,
batch update failures, and reset with post-reset options.
> - Test helpers: `TestVars.WithDeploymentSeries`, `WithBuildID`, and
utilities to ensure versions are present via matching RPC.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
d8b755273f. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->