Skip to content

Commit 21a84ee

Browse files
Shivs11claude
andcommitted
Send targetDeploymentRevisionNumber for pinned workflows in matching
Previously, matching hardcoded revision number to 0 for pinned workflow tasks. This meant history could not use revision-based comparison to detect stale routing configs from lagging partitions. Now we send the actual targetDeploymentRevisionNumber (already computed from the routing config) so history can suppress stale target version signals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 68f8c22 commit 21a84ee

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

service/matching/task_queue_partition_manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ func (pm *taskQueuePartitionManagerImpl) getPhysicalQueuesForAdd(
18191819
if wfBehavior == enumspb.VERSIONING_BEHAVIOR_PINNED {
18201820
if pm.partition.Kind() == enumspb.TASK_QUEUE_KIND_STICKY {
18211821
// TODO (shahab): we can verify the passed deployment matches the last poller's deployment
1822-
return dbq, dbq, userDataChanged, 0, targetDeploymentVersion, nil
1822+
return dbq, dbq, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
18231823
}
18241824

18251825
err = worker_versioning.ValidateDeployment(deployment)
@@ -1849,15 +1849,15 @@ func (pm *taskQueuePartitionManagerImpl) getPhysicalQueuesForAdd(
18491849
if !isIndependentPinnedActivity {
18501850
pinnedQueue, err := pm.getVersionedQueue(ctx, "", "", deployment, true)
18511851
if err != nil {
1852-
return nil, nil, nil, 0, nil, err // TODO (Shivam): Please add the comment in the proto to explain that pinned tasks and sticky tasks get 0 for the rev number.
1852+
return nil, nil, nil, 0, nil, err
18531853
}
18541854
if forwardInfo == nil {
18551855
// Task is not forwarded, so it can be spooled if sync match fails.
18561856
// Spool queue and sync match queue is the same for pinned workflows.
1857-
return pinnedQueue, pinnedQueue, userDataChanged, 0, targetDeploymentVersion, nil
1857+
return pinnedQueue, pinnedQueue, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
18581858
} else {
18591859
// Forwarded from child partition - only do sync match.
1860-
return nil, pinnedQueue, userDataChanged, 0, targetDeploymentVersion, nil
1860+
return nil, pinnedQueue, userDataChanged, targetDeploymentRevisionNumber, targetDeploymentVersion, nil
18611861
}
18621862
}
18631863
}

0 commit comments

Comments
 (0)