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

Default NumTaskqueue*Partitions to 4, use this value when listing partitions #618

Merged
merged 2 commits into from
Jul 28, 2020

Conversation

markmark206
Copy link

What changed?

Fix tctl tq lp command to return the list of partititions, based on config.NumTasklistWritePartitions. Default config.NumTasklistWritePartitions to 4, which gives us a reasonable default behavior.

Why?

Fixing a bug (incomplete implementation?), where the functionality of listing partitions was disassociated from its configuration parameters.

How did you test it?

I tested using cli:

  ~/src/temporal $ ./tctl --ns benchtest tq lp --tq temporal-bench
     WORKFLOWTASKQUEUEPARTITION    |      HOST
  temporal-bench                   | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/1 | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/2 | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/3 | 127.0.0.1:7235
     ACTIVITYTASKQUEUEPARTITION    |      HOST
  temporal-bench                   | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/1 | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/2 | 127.0.0.1:7235
  /__temporal_sys/temporal-bench/3 | 127.0.0.1:7235

Potential risks

If any code relies on the old behavior (which doesn't seem likely, since the old behavior was broken), it will need to be updated.

@markmark206 markmark206 requested review from mastermanu, a team and samarabbas July 28, 2020 15:01
Copy link
Member

@mastermanu mastermanu left a comment

Choose a reason for hiding this comment

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

is it possible to add some form of unit testing to cover this?

@markmark206
Copy link
Author

is it possible to add some form of unit testing to cover this?

Ah yes, thank you for mentioning tests!

We should def have unit tests for ListTaskQueuePartitions. I spend a bit of time looking into adding one, however, I ran into a problem passing a mock namespace into ListTaskQueuePartitionsRequest.

--- FAIL: TestMatchingEngineSuite (3.90s)
    --- FAIL: TestMatchingEngineSuite/TestListTaskQueuePartitions (0.00s)
        matchingEngine.go:655: Unexpected call to *cache.MockNamespaceCache.GetNamespaceID([chicken]) at /Users/markmark/src/temporal-mm/common/cache/namespaceCache_mock.go:141 because: there are no expected calls of the method "GetNamespaceID" for that receiver

It seems like there is a bit of work that needs to happen to enable this. I will look into adding that as a separate change, probably after Code Complete.

In the meantime, we will have our cicd pipelines exercise this functionality via tctl cli.

@markmark206 markmark206 merged commit 463fc8a into temporalio:master Jul 28, 2020
@markmark206 markmark206 deleted the tqcli branch July 28, 2020 19:33
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