Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test and fix Deployment SAs #7293

Merged
merged 5 commits into from
Feb 7, 2025
Merged

Test and fix Deployment SAs #7293

merged 5 commits into from
Feb 7, 2025

Conversation

ShahabT
Copy link
Collaborator

@ShahabT ShahabT commented Feb 7, 2025

What changed?

Making sure the following SAs are populated correctly for Versioning v3.1

  • TemporalWorkerDeployment
  • TemporalWorkerDeploymentVersion
  • TemporalWorkflowVersioningBehavior
  • BuildIds

Why?

How did you test it?

Potential risks

Documentation

Is hotfix candidate?

@ShahabT ShahabT requested a review from a team as a code owner February 7, 2025 09:06
@ShahabT ShahabT enabled auto-merge (squash) February 7, 2025 09:07
if ms.GetMostRecentWorkerVersionStamp().GetUseVersioning() &&
//nolint:staticcheck // SA1019 deprecated stamp will clean up later
!request.GetWorkerVersionStamp().GetUseVersioning() &&
request.GetDeploymentOptions().GetWorkerVersioningMode() != enumspb.WORKER_VERSIONING_MODE_VERSIONED {
// Mutable state wasn't changed yet and doesn't have to be cleared.
releaseLeaseWithError = false
return nil, serviceerror.NewInvalidArgument("Workflow using versioning must continue to use versioning.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how does "ramp to unversioned" work with this? If someone uses versioning in a version stamp, they can't ramp to unversioned? (It makes sense to me that v1/v2 can't ramp to unversioned, but v3.1 should be able to, right?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah they could not in v1-2. now that I exclude v3.1 from the condition it should be possible for v3.1 even if stamp is not sent.

oldVersioningUsed := handler.mutableState.GetMostRecentWorkerVersionStamp().GetUseVersioning()
oldVersioningUsed := handler.mutableState.GetMostRecentWorkerVersionStamp().GetUseVersioning() &&
// for V3 versioning it's ok to dispatch eager activities
handler.mutableState.GetEffectiveVersioningBehavior() == enumspb.VERSIONING_BEHAVIOR_UNSPECIFIED
newVersioningUsed := handler.mutableState.GetExecutionInfo().GetAssignedBuildId() != ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is newVersioningUsed correct? it seems like this only checks that the WF never used versioning v2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is correct. once a wf uses v2 it cannot go back! in here I just want to exclude v3 from the check. not touching v1-2 suff.

@@ -580,7 +581,7 @@ func (d *VersionWorkflowRunner) handleSyncState(ctx workflow.Context, args *depl

// stopped accepting new workflows --> start drainage child wf
if wasAcceptingNewWorkflows && !isAcceptingNewWorkflows {
d.startDrainage(ctx, true)
d.startDrainage(ctx, false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:o nice catch!

DeploymentOptions: &deploymentpb.WorkerDeploymentOptions{
BuildId: tv.BuildID(),
DeploymentName: tv.DeploymentSeries(),
WorkerVersioningMode: enumspb.WORKER_VERSIONING_MODE_VERSIONED,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need a version stamp here too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, I someone whats to check the SAs after wf completion yes but I didn't have that use and left it out for now because wanted to make sure the request goes through without stamp as well.

@ShahabT ShahabT merged commit 850101f into main Feb 7, 2025
50 checks passed
@ShahabT ShahabT deleted the shahab/wv-sa branch February 7, 2025 18:24
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.

2 participants