Skip to content

Skip reactivation signals for current/ramping/draining versions#9778

Open
Shivs11 wants to merge 5 commits intomainfrom
fixing-reactivation-signals
Open

Skip reactivation signals for current/ramping/draining versions#9778
Shivs11 wants to merge 5 commits intomainfrom
fixing-reactivation-signals

Conversation

@Shivs11
Copy link
Copy Markdown
Member

@Shivs11 Shivs11 commented Apr 2, 2026

Summary

  • Extends CheckTaskQueueVersionMembership matching RPC response with a VersionReactivationEligibility message that indicates whether the version is drained or inactive
  • Threads this information through ValidateVersioningOverride → call sites → ReactivateVersionWorkflowIfPinned to skip signals for versions that don't need reactivation
  • Uses a proto message wrapper for backwards compatibility: absent = unknown (old matching server) → signal sent unconditionally

Key changes

  • Proto: Added VersionReactivationEligibility message and reactivation_eligibility field to CheckTaskQueueVersionMembershipResponse
  • Matching engine: Populates the new field by checking version status in deployment data via new IsVersionDrainedOrInactive helper
  • History API: ReactivateVersionWorkflowIfPinned skips signal when matching confirms version is NOT drained/inactive
  • Cache: VersionMembershipCache renamed to VersionMembershipAndReactivationStatusCache, now also caches the reactivation eligibility status

Backwards/forwards compatibility

  • Old matching, new history: field is nil → history sends signal unconditionally (preserves current behavior)
  • New matching, old history: field is populated but ignored → no behavioral change
  • New matching, new history: signal only sent for drained/inactive versions

Test plan

  • Unit tests for ValidateVersioningOverride — cache hit (drained/active), RPC (drained/active/old matching), fallback path
  • Unit tests for GetIsWFTaskQueueInVersionDetector — cache and RPC paths
  • Integration: TestUpdateWorkflowExecutionOptions_ReactivateVersionOnPinned
  • Integration: TestStartWorkflowExecution_ReactivateVersionOnPinned
  • Integration: TestStartWorkflowExecution_ReactivateVersionOnPinned_WithConflictPolicy
  • Integration: TestSignalWithStartWorkflowExecution_ReactivateVersionOnPinned
  • Integration: TestResetWorkflowExecution_ReactivateVersionOnPinned
  • Integration: TestReactivationSignalCache_Deduplication_StartWorkflow
  • Integration: TestReactivationSignalCache_Deduplication_SignalWithStart
  • Integration: TestReactivationSignalCache_Deduplication_UpdateOptions
  • Integration: TestReactivationSignalCache_Deduplication_Reset

🤖 Generated with Claude Code


Note

Medium Risk
Touches cross-service worker versioning flow (proto + matching + history) and changes when reactivation signals are emitted; incorrect eligibility computation could suppress needed signals or cause extra ones during rolling upgrades.

Overview
Extends CheckTaskQueueVersionMembershipResponse with optional reactivation_eligibility (new VersionReactivationEligibility message) so callers can know if a version is drained/inactive.

Threads this eligibility through worker-versioning validation and caching (renaming VersionMembershipCache to VersionMembershipAndReactivationStatusCache) and updates history start/signal-with-start/reset/update-options paths to skip ReactivateVersionWorkflowIfPinned signals when matching confirms the version is not drained/inactive (nil/absent preserves backwards-compatible “signal unconditionally” behavior).

Reviewed by Cursor Bugbot for commit 6e53f2d. Bugbot is set up for automated code reviews on this repo. Configure here.

Reactivation signals were being sent to version workflows for all pinned
versions, including those that are CURRENT, RAMPING, or DRAINING. While
the version workflow handler already ignored these signals, they still
created unnecessary RPCs and added events to the workflow history.

This change piggybacks on the existing CheckTaskQueueVersionMembership
matching RPC to also return whether the version is drained or inactive.
The matching service already loads the full deployment data but previously
discarded the version status. The new VersionReactivationEligibility
message in the response uses a proto message wrapper to provide nil
semantics for backwards compatibility during rolling deploys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Shivs11 Shivs11 changed the title Skip reactivation signals for non-drained/inactive versions Skip reactivation signals for current/ramping/draining versions Apr 2, 2026
Shivs11 and others added 2 commits April 1, 2026 21:17
…ld format check

- Rename checkTaskQueueVersionMembership → checkVersionMembershipAndReactivationEligibility
- Rename validatePinnedVersionInTaskQueue → validateVersionAndGetReactivationEligibility
- Rename ValidateVersioningOverride → ValidateVersioningOverrideAndGetReactivationEligibility
- Fix cache comment: "whether the task queue exists in the version"
- Add old format (deprecated versions list) check to IsVersionDrainedOrInactive
- Improve proto comment explaining why only drained/inactive versions get signals
- Improve validatePostResetOperationInputs comment about per-operation eligibility

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Shivs11 Shivs11 marked this pull request as ready for review April 2, 2026 01:21
@Shivs11 Shivs11 requested review from a team as code owners April 2, 2026 01:21
Shivs11 and others added 2 commits April 2, 2026 21:12
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Skip deleted versions (return nil) in IsVersionDrainedOrInactive,
  consistent with how HasDeploymentVersion treats deleted versions as absent.
  This prevents sending reactivation signals to deleted version workflows.
- Add dedicated TestIsVersionDrainedOrInactive covering: nil deployments,
  not found, DRAINED, INACTIVE, CURRENT, RAMPING, deleted (new format),
  and old format (DRAINED, CURRENT).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant