Skip to content

Add remaining 1.32 labeled PRs - #11938

Merged
simvlad merged 11 commits into
release/v1.32.xfrom
awln/backport-1.32-labeled-only
Sep 4, 2026
Merged

simvlad merged 11 commits into
release/v1.32.xfrom
awln/backport-1.32-labeled-only

Conversation

@awln-temporal

@awln-temporal awln-temporal commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

Backports the 12 merged PRs labeled release/1.32.0 that were not yet on release/v1.32.x, applied in main merge order. Also fixes mixedbrain test by bumping go version to 1.26.8 in mixedbrain folder (broken by #11928).

# PR Author What / Why
1 #11546 fix(batcher): scope deterministic request IDs to the batch job ID @spkane31 Two batch operations sending the same signal to the same workflow/run ID only delivered one — the request ID was hashed from workflow ID / run ID / signal name, so the second was de-duped in signal logic. Including the batch job ID in the hash keeps separate signals distinct.
2 #11642 Fix batch operations targeting paused executions @fretz12 A paused execution is still non-terminal, but the old Running-only filter silently skipped paused targets. Users issuing a batch terminate/signal/cancel reasonably expect it to apply to them.
3 #11666 Fix activity timeout regeneration after unpause @fretz12 Timeout tasks that fired while an activity was paused were discarded, but the activity's timer-task status still claimed they existed — preventing recreation after unpause and potentially making the timeout ineffective. Also fixes ResetActivity bypassing normal unpause handling, and running activities returning early without clearing paused state.
4 #11696 Treat missing Worker Deployment Version as deleted @rkannan82 Treats NotFound from the Version workflow delete update as success. When a Version workflow is already closed or its history is gone, NotFound blocked the Deployment workflow from removing its stale version reference. Fixes #11539.
5 #11725 Fix batch activity unpause visibility query scope @fretz12 The server replaced the caller's visibility query with the activity-type predicate, which could broaden the batch scope and unpause activities in workflows the caller never selected.
6 #11806 Fix activity operator command metric label collision @fretz12 WFA and SAA emitted the same Prometheus metric names (activity_pause/unpause/reset/update_options) with different label sets, causing descriptor registration failures and dropped metrics. Both now use the standard per-activity label schema and emit once per affected activity. See "Backport adaptation" below.
7 #11930 Prioritize worker versioning workflows @ShahabT Worker versioning workflows share the per-namespace worker task queue with other system workflows. Raising their initial workflow-task priority above default keeps versioning operations from queueing behind default-priority work.
8 #11910 [Visibility] Fix legacy visibility query converter @rodrigozhou Fixes to the legacy visibility query converter for both SQL and Elasticsearch.
9 #11699 dynamic partitioning: use probability of AddTask to root partition to estimate overall add task rate @carlydf A previous PR changed AddTask load-balancing from uniform random to backlog-aware, invalidating the uniform-distribution assumption behind the add-task-rate estimate. Now estimates from the probability of AddTask hitting the root partition, and guarantees the root retains at least a 1% chance of selection regardless of its backlog.
10 #11935 [Visibility] Enable unified query converter by default @rodrigozhou Flips the default now that the unified query converter is stable and ready to replace the old one. Depends on #11910 and #11801.

How did you test it?

  • built — go build ./...
  • make fmt — no changes
  • go vet -tags disable_grpc_modules,test_dep ./tests/... — clean
  • make GOLANGCI_LINT_FIX=false GOLANGCI_LINT_BASE_REV=origin/release/v1.32.x lint-code — 0 issues
  • covered by existing tests — 21 affected packages, 20 pass

@awln-temporal
awln-temporal marked this pull request as ready for review September 4, 2026 20:06
@awln-temporal
awln-temporal requested review from a team as code owners September 4, 2026 20:06
spkane31 and others added 10 commits September 4, 2026 14:28
…1546)

## What changed?
Use the `jobID` parameter in the `deterministicRequestID` function to
allow multiple batch operations to signal the same workflow.

## Why?
Two batch operations that send the same signal to the same workflow/run
ID will only send one signal, the second will be de-duped in the signal
logic because the request ID was hashed from workflow id / run id /
signal name. Including the batch job ID gives proper hashing to prevent
these separate signals from being de-duped

## How did you test it?
- [x] added new unit test(s)
- [x] added new functional test(s)

## Potential risks
NA, this is a bug fix.

(cherry picked from commit 0d60f98)
## What changed?
Batch operations now target Paused executions in addition to Running
ones. The filter auto-appended by adjustQueryBatchTypeEnum changed from
ExecutionStatus='Running' to ExecutionStatus='Running' OR
ExecutionStatus='Paused', affecting all workflow batch types
(terminate/signal/cancel/update-options) and activity batch types
(unpause/update-options/reset/terminate/cancel).

## Why?
A paused execution is still non-terminal. Users issuing a batch
terminate/signal/cancel reasonably expect it to apply to paused targets,
but the old Running-only filter silently skipped them.

## How did you test it?
- [X] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [X] added new unit test(s)
- [X] added new functional test(s)

## Potential risks
- The filter now references ExecutionStatus='Paused' on every batch
operation. This is ok as it's an additive clause to the visibilty query
- This would be changing behavior for batch callers as paused activities
are now affected.

(cherry picked from commit bfb8142)
## What changed?
- Clear an activity’s timer-task status when it is unpaused so timeout
tasks are regenerated.
- Make ResetActivity with keepPaused=false fully unpause both scheduled
and running activities, including clearing pause metadata.
- Add and strengthen unit and functional coverage for unpause,
reset-unpause, timer regeneration, and keepPaused=true.

## Why?
Timeout tasks can fire while an activity is paused and be discarded.
Previously, the activity’s timer-task status still indicated that those
tasks existed, preventing them from being recreated after unpause and
potentially making the timeout ineffective.
ResetActivity also bypassed normal unpause handling, and running
activities returned early without clearing their paused state.

## How did you test it?
- [X] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [X] added new unit test(s)
- [X] added new functional test(s)

## Potential risks
Unpausing now invalidates existing timeout tasks and recreates the next
applicable timer during transaction close. This is correct, but a
behavioral change. Stale queued tasks may still be processed and
discarded through the existing stamp validation.

(cherry picked from commit abeeabd)
## What

Treat `NotFound` from the Version workflow delete update as success, so
the Deployment workflow can clean up its stale version reference.

## Why

When a Version workflow is already closed or its history is gone, the
delete update returns `NotFound`, blocking the Deployment workflow from
removing the reference. Fixes #11539.

## How did you test it?

Unit test covering the `NotFound` → success path and verifying other
History errors still propagate.

(cherry picked from commit c9b9929)
## What changed?
Preserved the caller-provided visibility scope when starting type-based
batch activity unpause operations. The activity-type predicate is now
safely combined with the original query.

## Why?
The server previously replaced the caller’s visibility query with the
activity-type predicate. This could broaden the batch scope and unpause
activities in workflows the caller did not select.

## How did you test it?
- [X] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [X] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
Type-based unpause batches now strictly honor the caller’s visibility
scope, so they may process fewer workflows than before, but this is the
correct design

(cherry picked from commit ee5b0d8)
- Changed activity_{pause,unpause,reset,update_options} to emit once per
affected activity when the mutation is applied.
- Updated both WFA and SAA to use the standard per-activity label
schema: namespace, operation, activity type, workflow type, task queue,
versioning behavior, and service name.
- Added shared construction for the standard per-activity metric scope.
- Added functional coverage comparing one WFA request affecting multiple
activities with equivalent SAA per-ID requests.
- Added unit coverage verifying metrics capture the activity’s updated
labels.

WFA and SAA emitted the same Prometheus metric names with different
label sets, causing descriptor registration failures and dropped
metrics.

Recording these metrics per affected activity makes their semantics and
labels consistent with other activity event metrics such as cancel,
terminate, success, and failure, while eliminating the Prometheus
collision.

- [x] built
- [ ] run locally and tested manually
- [X] covered by existing tests
- [ ] added new unit test(s)
- [X] added new functional test(s)

WFA metrics change from one recording per API request to one per
affected activity and no longer include activity_targeting_method. This
may increase metric volume for multi-activity requests and require
dashboards using the previous label or request-count semantics to be
updated. This is intentional to establish one consistent per-activity
schema across WFA and SAA.

(cherry picked from commit 935fdf5)
## What changed?
- assign priority key 1 to Worker Deployment and Worker Deployment
Version workflow starts
- cover the shared start-request builder with a unit test

## Why?
Worker versioning workflows run on the per-namespace worker task queue
alongside other system workflows. Giving their initial workflow tasks
higher-than-default priority prevents versioning operations from being
delayed behind default-priority work.

## How did you test it?
- `go test -tags test_dep ./service/worker/workerdeployment -run
TestMakeStartRequestSetsHighPriority`
- `go vet -tags test_dep ./service/worker/workerdeployment`

(cherry picked from commit eb8f340)
## What changed?
- Fix parsing negative double values.
- Consolidated the function to resolve alias (there were two, and not
behaving the same way, the legacy was missing some cases).
- Added more unit tests to verify the legacy query converter behaves the
same as in the new one except for the expected differences.

## Why?
Fixes to legacy visibility query converter for SQL and Elasticsearch.

## How did you test it?
- [x] built
- [ ] run locally and tested manually
- [x] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks

(cherry picked from commit 9979699)
… estimate overall add task rate (#11699)

## What changed?
- use probability of AddTask to root partition to estimate overall add
task rate, instead of assuming uniform distribution
- to enable this, change the AddTask loadbalancing to ensure that there
is at least 1% chance of hitting the root, regardless of how much
backlog the root has

## Why?
A previous PR changed AddTask load-balancing from uniform random to
backlog-aware

## How did you test it?
- [x] built
- [x] run locally and tested manually
- [ ] covered by existing tests
- [x] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks
Changes AddTask computation and AddTask load balancing, but improves the
estimation of the former, and we are ok with the tradeoff for the latter

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches AddTask write routing and dynamic partition scaling inputs;
behavior changes when backlog-aware routing heavily favors child
partitions, though a 1% root floor and fallback estimates limit
worst-case drift.
>
> **Overview**
> Backlog-aware write routing no longer assumes one root add implies
uniform load on every partition. The matching client now returns an
**estimated tasks across all partitions** when load-balancing picks the
**root** partition, sends it on gRPC metadata (`etap`), and the root
partition scaler uses that instead of multiplying by write partition
count.
>
> **Write load balancing** enforces at least a **1% chance** of routing
to the root (`writePartitionRootProbabilityFloor`) so sampling stays
viable when the root backlog is full. When the root is chosen, the
estimate is derived from gap-weighted routing
(`randomRound(total/gap0)`); non-root picks carry zero estimate.
Fallback paths (uniform random, forced partition via test hooks) still
return `partitionCount` on root samples.
>
> **Scale manager** batches and wakes the partition scaler on
**estimated** queue-wide task volume
(`AddedTasks(estimatedTasksAllPartitions)`), with threshold `batchSize ×
currentWrite` once write count is known.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1ee95df. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 2220587)
## What changed?
Enable the new Visibility unified query converter introduced in v1.30.0
by default.

## Why?
The unified query converter is stable, and ready to replace the old one.

## How did you test it?
- [ ] built
- [ ] run locally and tested manually
- [ ] covered by existing tests
- [ ] added new unit test(s)
- [ ] added new functional test(s)

## Potential risks

(cherry picked from commit ad7b229)
@simvlad
simvlad force-pushed the awln/backport-1.32-labeled-only branch from 4008066 to 2eefc0c Compare September 4, 2026 21:33
@simvlad
simvlad merged commit 851ddf5 into release/v1.32.x Sep 4, 2026
71 checks passed
@simvlad
simvlad deleted the awln/backport-1.32-labeled-only branch September 4, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants