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

Fix legacy DescribeTaskQueue for non-root partitions #6596

Merged
merged 8 commits into from
Oct 21, 2024
Merged

Conversation

ShahabT
Copy link
Contributor

@ShahabT ShahabT commented Oct 3, 2024

What changed?

DescribeTaskQueue has to support non-root partitions for legacy mode to keep supporting tctl and temporal CLIs.

This PR is fixing a regression caused by https://github.com/temporalio/temporal/pull/6419/files

Why?

The mentioned PR is validating DescribeTaskQueue input similar to other APIs and rejects when task queue name is a non-root partition (starts with /_sys/ prefix). This is not correct, DescribeTaskQueue is different from other API and it has to keep accepting names with this prefix to remain compatible with supported CLIs.

How did you test it?

Added functioonal and unit tests.

Potential risks

Documentation

Is hotfix candidate?

Yes

@ShahabT ShahabT requested review from dnr and justinp-tt October 3, 2024 23:17
@ShahabT ShahabT requested a review from a team as a code owner October 3, 2024 23:17
@ShahabT
Copy link
Contributor Author

ShahabT commented Oct 3, 2024

cc @rodrigozhou

@@ -67,14 +102,14 @@ func NormalizeAndValidate(
taskQueue.Name = defaultName
}

if err := Validate(taskQueue.GetName(), maxIDLengthLimit); err != nil {
if err := validate(taskQueue.GetName(), maxIDLengthLimit, expectNonRootPartition); err != nil {
return err
}

if taskQueue.GetKind() == enumspb.TASK_QUEUE_KIND_STICKY {
normalName := taskQueue.GetNormalName()
if normalName != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Not changing in this PR, but this might deserve a comment that old SDKs send sticky without a normal name, so we don't require that it be set here.

taskQueue *taskqueue.TaskQueue,
defaultName string,
maxIDLengthLimit int,
expectNonRootPartition bool,
Copy link
Member

Choose a reason for hiding this comment

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

expectNonRootPartition feels slightly misleading since it's not "expect non-root", it's "expect root or non-root". So maybe invert it and call it expectRoot?

@ShahabT ShahabT enabled auto-merge (squash) October 11, 2024 19:58
@@ -247,6 +247,7 @@ func (handler *WorkflowTaskCompletedHandler) Invoke(
}
}()

// TODO: this check is only
Copy link
Member

Choose a reason for hiding this comment

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

finish this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops this sneaked in from an unrelated work. removed the line.

@ShahabT ShahabT removed the request for review from justinp-tt October 21, 2024 18:13
@ShahabT ShahabT merged commit ec6a11c into main Oct 21, 2024
48 checks passed
@ShahabT ShahabT deleted the shahab/fix-dtq branch October 21, 2024 18:28
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