Skip to content

Conversation

@Shivs11
Copy link
Member

@Shivs11 Shivs11 commented Dec 8, 2025

What changed?

  • Added a new RPC method, scoped to matching only, which shall check if a specific version exists in the userData of a task queue.

Why?

  • Currently, versioning has several places in history which call the method GetTaskQueueUserData to validate if a version exists in a task queue or not.
  • However, with this going in very soon, one of the biggest changes put forward by it is the fact that a task queue's userData could go on to become big (if a task queue was part of a large number of versions). The main reason for this is because we keep an entry for versions that are deleted inside the task-queue's user data so that we can ensure read-after-write consistencies.
  • Thus, to prevent large number of bytes flowing across the wire, it's best to just make this new RPC that does the check in matching and only sends a boolean across.

How did you test it?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Potential risks

  • No risk honestly I think this is an optimization

Note

Introduces a matching RPC to check if a task queue belongs to a deployment version, wires it through proto, gRPC, clients, engine, quotas, and tests, and updates worker versioning to use it.

  • API/Protobuf:
    • Add CheckTaskQueueVersionMembershipRequest/Response messages in api/matchingservice/v1/request_response.proto and generated Go files.
    • Add CheckTaskQueueVersionMembership method to MatchingService in service.proto and generated gRPC stubs.
  • Server:
    • Implement handler Handler.CheckTaskQueueVersionMembership forwarding to engine.
    • Implement engine method matchingEngineImpl.CheckTaskQueueVersionMembership to read user data and return membership via worker_versioning.HasDeploymentVersion.
    • Include new RPC in rate-limiting quotas and logtags switch.
  • Clients/Mocks:
    • Add client methods in generated client_gen.go, metric_client_gen.go, and retryable_client_gen.go.
    • Update gRPC client/server interfaces and register handler; add mocks in matchingservicemock.
  • Worker Versioning:
    • Replace GetTaskQueueUserData check with CheckTaskQueueVersionMembership in detector.
  • Tests:
    • Add functional test TestCheckTaskQueueVersionMembership validating false-before/true-after worker registration.

Written by Cursor Bugbot for commit ff2ea79. This will update automatically on new commits. Configure here.

message CheckTaskQueueVersionMembershipRequest {
string namespace_id = 1;
temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
temporal.api.enums.v1.TaskQueueType task_queue_type = 3;
Copy link
Member Author

@Shivs11 Shivs11 Dec 8, 2025

Choose a reason for hiding this comment

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

Technically, we don't need this (right now) since all the version presence checks for a task queue go through the workflow task queue type. However, I just wanted to be consistent with other matching API's since those that accept task-queue also accept the type. Moreover, we could have a future use-case of involving the activity task queue type of a task queue.

@Shivs11 Shivs11 marked this pull request as ready for review December 8, 2025 16:53
@Shivs11 Shivs11 requested review from a team as code owners December 8, 2025 16:53
Copy link
Contributor

@ShahabT ShahabT left a comment

Choose a reason for hiding this comment

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

looks good otherwise


message CheckTaskQueueVersionMembershipRequest {
string namespace_id = 1;
temporal.api.taskqueue.v1.TaskQueue task_queue = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

we're trying to move away from this proto as much as possible because it mixes multiple levels of TQs. In this case the API is only relevant to normal TQs, so just a string field is enough.

@Shivs11 Shivs11 enabled auto-merge (squash) December 10, 2025 18:32
@Shivs11 Shivs11 merged commit 2cb8b30 into main Dec 11, 2025
60 checks passed
@Shivs11 Shivs11 deleted the ss/matching-rpc-task-queue-in-version branch December 11, 2025 15:36
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