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

Add flags for using the default build id set #273

Merged
merged 2 commits into from
Apr 24, 2023

Conversation

Sushisource
Copy link
Member

What changed?
Add flags to activity/child/c-a-n to explicitly use the default version set rather than the compatible set when sticking to the same queue.

Why?
Flexibility with the versioning feature

Breaking changes

@Sushisource Sushisource requested review from a team as code owners April 19, 2023 17:37
Copy link
Member

@bergundy bergundy left a comment

Choose a reason for hiding this comment

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

Overall LGTM.
I'm just not convinced that for continue-as-new (and maybe even child workflow) we should stay within the compatible set by default.
It's of course a tradeoff between safety and being able to retire workers.
I have a feeling some users will be surprised by these defaults but I'm okay with starting out on the safer side.
I do think we should at least discuss this a bit more before making a call because up until recently the understanding was that CAN will go to the default since the expectation is that workflows are external APIs and cannot arbitrarily change their signatures, that's of course case dependent, and some workflows are public while others are private but we don't have this concept in the SDKs.

@Sushisource
Copy link
Member Author

@bergundy
Right, good point about about CAN. I am fine with inverting its flag.

The other two, I have fairly high confidence that's the right choice there.

@bergundy
Copy link
Member

Oh and you're going to want to propagate this intent to the relevant history events.
For example a workflow will need to know which compatible set to use.

@bergundy
Copy link
Member

I have this thought that maybe if we see that a workflow was started within a compatible set, when it continues as new, it stays within that set.
It might give an indication that it's a "private" child workflow but I'd need to think about this some more, it's definitely harder to explain to users.

Copy link
Member

@dnr dnr left a comment

Choose a reason for hiding this comment

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

shouldn't this go to the feature branch instead of master?

I think my leanings are:

  • CAN should go to the same set by default if the task queue and workflow type are the same. that feels very "private". the typical use for that kind of CAN is to make an infinite loop (given our limitations). it would be surprising to me if it started running some other code on another binary.
  • if the task queue is different I agree it should go to the overall default.
  • if the task queue is the same but the workflow type is different... I don't know.
  • whatever the behavior, it seems easier to explain/learn if all three of these are consistent

// is the default behavior) and instead will use the current overall default for the queue.
// If this command's `task_queue` field differs from the executing workflow's task queue, then
// this flag has no effect.
bool use_default_build_id_set = 13;
Copy link
Member

Choose a reason for hiding this comment

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

not sure about the name.. "build id set" isn't really what users are thinking in terms of, right?

Suggested change
bool use_default_build_id_set = 13;
bool use_latest_version = 13;

?

Suggested change
bool use_default_build_id_set = 13;
bool use_latest_build_id = 13;

?

Copy link
Member Author

Choose a reason for hiding this comment

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

use_latest_build_id is probably better

@Sushisource Sushisource changed the base branch from master to worker-versioning April 24, 2023 17:04
@Sushisource
Copy link
Member Author

I have this thought that maybe if we see that a workflow was started within a compatible set, when it continues as new, it stays within that set. It might give an indication that it's a "private" child workflow but I'd need to think about this some more, it's definitely harder to explain to users.

By that logic, it would always continue within the set. The only case a workflow starts without being pinned to some set is if it started before there were any versions, and then we add one. Otherwise, the workflow's version set is determined once its first task starts. Alternatively, you could interpret that as they never start with some defined set. The only case where it seems clear they are predestined for some specific set is when they're run as child workflows, for example - if that's what you're getting at?

I think there's merit to both approaches for CAN. The above feels much too annoying to explain.

I'm inclined to say they should start on the same compat set for two reasons:

  1. Makes all the commands consistent.
  2. If you have already been smart enough to make a one-arg input which is wire-compatible, you know this, and probably are comfortable with setting a flag that says "start using the latest default" because you've had the expectation in your head all along that you were going to do that. Contrastingly, users who didn't think ahead as much get behavior that doesn't surprise them with an error. Seems like a fairly strong reason to me.

@Sushisource Sushisource merged commit 7787438 into worker-versioning Apr 24, 2023
@Sushisource Sushisource deleted the add-use-default-build-id-flags branch April 24, 2023 18:02
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.

3 participants