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

[Issue 8340] [pulsar-testclient] Fix to support to specify topics and subscriptions #9716

Merged
merged 2 commits into from Mar 3, 2021

Conversation

murong00
Copy link
Contributor

Motivation

Fixes #8340

Modifications

  • Fix option main parameter for CLI pulsar-perf produce/consume/read to specify multi topics.
  • Add option --subscriptions for CLI pulsar-perf consume to specify multi subscriptions.
  • Deprecate and hide the option --subscriber-name.
  • Modify the corresponding doc.

@murong00
Copy link
Contributor Author

/pulsarbot run-failure-checks

@murong00
Copy link
Contributor Author

murong00 commented Mar 1, 2021

@codelipenghui Please help to take a review about this when you are available.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

I appreciate this work, happy to see that

Please do not break compatibility with the previous signature.
We have scripts that are used to work with many different versions of pulsar (just by changing the docker image name).

IMHO in general it is fine to add new feature, but we should not change the behaviour if it is not strictly nececessary

@Parameter(description = "persistent://prop/ns/my-topic", required = true)
public List<String> topic;
@Parameter(description = "A list of topics to consume from (e.g. persistent://prop/ns/topic1 persistent://prop/ns/topic2)", required = true)
public List<String> topics;
Copy link
Contributor

Choose a reason for hiding this comment

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

are we breaking compatibility with the old format ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, just keep the old format.

@@ -109,7 +108,7 @@
@Parameter(names = { "-s", "--size" }, description = "Message size (bytes)")
public int msgSize = 1024;

@Parameter(names = { "-t", "--num-topic" }, description = "Number of topics")
@Parameter(names = { "-t", "--num-topics" }, description = "Number of topics")
Copy link
Contributor

Choose a reason for hiding this comment

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

are we breaking compatibility with the previous version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, use the previous version.

@murong00 murong00 added this to the 2.8.0 milestone Mar 2, 2021
@murong00
Copy link
Contributor Author

murong00 commented Mar 2, 2021

/pulsarbot run-failure-checks

Copy link
Member

@zymap zymap left a comment

Choose a reason for hiding this comment

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

Please avoid changing the document and the code with the same PR. Pulsar's document does not need to cherry-pick to the release branch and this may introduce some unnecessary work when we cherry-pick this to the target branch.

@zymap zymap merged commit e137f26 into apache:master Mar 3, 2021
zymap pushed a commit that referenced this pull request Mar 3, 2021
… subscriptions (#9716)

### Motivation

Fixes #8340

### Modifications

- Fix option `main parameter` for CLI `pulsar-perf produce/consume/read` to specify multi topics.
- Add option `--subscriptions` for CLI `pulsar-perf` consume to specify multi subscriptions.
- Deprecate and hide the option `--subscriber-name`.
- Modify the corresponding doc.

(cherry picked from commit e137f26)
@zymap zymap added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Mar 3, 2021
zymap pushed a commit to streamnative/pulsar-archived that referenced this pull request Mar 5, 2021
… subscriptions (apache#9716)

### Motivation

Fixes apache#8340

### Modifications

- Fix option `main parameter` for CLI `pulsar-perf produce/consume/read` to specify multi topics.
- Add option `--subscriptions` for CLI `pulsar-perf` consume to specify multi subscriptions.
- Deprecate and hide the option `--subscriber-name`.
- Modify the corresponding doc.

(cherry picked from commit e137f26)
mlyahmed pushed a commit to mlyahmed/pulsar that referenced this pull request Mar 5, 2021
… subscriptions (apache#9716)

### Motivation

Fixes apache#8340

### Modifications

- Fix option `main parameter` for CLI `pulsar-perf produce/consume/read` to specify multi topics.
- Add option `--subscriptions` for CLI `pulsar-perf` consume to specify multi subscriptions.
- Deprecate and hide the option `--subscriber-name`.
- Modify the corresponding doc.
@eolivelli
Copy link
Contributor

@zymap
This patch broke compatibility with the previous version.
I have tools that used the useful feature, that is to auto create many topics on demand and automatically

I left comments and you committed the patch anyway.

This is not the right way to behave IMHO.

Can you please revert this patch ?

Otherwise I will be happy to send a patch that at least restores the auto-topic creation behaviour

bin/pulsar-perf produce -t 10 test

should create 10 topics, now it does not work anymore

The size of topics list should be equal to --num-topic
Usage: pulsar-perf produce [options] persistent://prop/ns/my-topic
  Options:

@codelipenghui
Copy link
Contributor

Currently, we don't have any tests that cover the test client, we'd better add tests to avoid the broken.

@eolivelli
Copy link
Contributor

@codelipenghui I agree.
But I added a comment and asked explicitly to not change the behaviour.

IMHO This is not about tests, it is about taking care of comments of the users in the community.

In my experience in OSS projects, and especially in the ASF,
if anyone "request changes" or anyway has a perplexity regarding a change,
it is necessary to understand the problem deeper before moving forward with committing the patch.

Think about any other user/contributor that tries to comment and express his opinion on a change, but the owners of the project ignore his comments and go forward.......
how can the newcomer feel ?
This is not a good behaviour indeed.

Please take this into consideration for the next time.

The is no hurry in committing a patch in Apache projects,
but we must ensure that everybody feels well in the community
:-)

@zymap
Copy link
Member

zymap commented Mar 6, 2021

@eolivelli I am sorry for my mistake and the inconvenience.
I saw your all suggested changes already addressed by him and the command arguments look good for compatibility.
I will revert the change from branch 2.7 and we can fix the issue at master.

Also, it's a good idea to add some test case for this so we can keep the compatibility when creating PRs.

zymap added a commit that referenced this pull request Mar 6, 2021
@zymap zymap removed cherry-picked/branch-2.7 Archived: 2.7 is end of life release/2.7.1 labels Mar 6, 2021
@eolivelli
Copy link
Contributor

@zymap no problem.
Thanks.

I can send a patch on Monday.

I also have other improvements for pulsar-perf to contribute as well ;)

@codelipenghui
Copy link
Contributor

@eolivelli

But I added a comment and asked explicitly to not change the behaviour.
IMHO This is not about tests, it is about taking care of comments of the users in the community.

You have mentioned 2 points and the author has fixed them. I'm not sure why to make you feel we are not taking care of your comments. If some other places break the behavior, we'd better point out? Otherwise, other reviewers may not understand where the break is.

@murong00
Copy link
Contributor Author

murong00 commented Mar 8, 2021

@eolivelli I'm so sorry that I misunderstood your comment about the breaking compatibility. Actually, I have discussed this with penghui on the issue page:
image

Both you and penghui are right about the behaviour. I think we can just fix this by adding an option to cover the compatibility. I can send a patch if you needed @eolivelli, sorry again about the mistake.

@eolivelli
Copy link
Contributor

@murong00
don't worry at all!
let's fix this together.

I appreciate that you are volunteering to follow up. Thank you very much.

I really would like to see that same behaviour as before, otherwise the behaviour of the tool is different from one version to another and you cannot know which version of the tool you are using.
I am maintaining a suite of tests that are to be run against several different versions of Pulsar.
It is fine to ADD new features, but NOT to change the behaviour.

So out-of-the-box it would be great that the behaviour does not change.
So adding a new "compatibility mode" flag won't work for me, because I cannot pass that flag to old versions.

I was going to start writing a patch in order to fallback to 2.7 mode in case you pass only one topic to the command.
pulsar-perf produce -n 10 test
here we see that the user is selecting only one topic and asking for 10...so we can expand the list of topics to
test-1, test-2, test-3....

this way we are 100% compatible with previous behaviour and your new behaviour works as well

The same is for pulsar-perf consume please

I will be happy to test your patch

@murong00
Copy link
Contributor Author

murong00 commented Mar 8, 2021

@eolivelli Thanks for your tips, I will send a patch later to cover this.

zymap added a commit to streamnative/pulsar-archived that referenced this pull request Mar 8, 2021
…pics and subscriptions (apache#9716)"

This reverts commit f4a3f4a.

(cherry picked from commit 8ea4a39)
codelipenghui pushed a commit that referenced this pull request Mar 10, 2021
### Motivation

Fixes #9821

### Modifications

Add the logic to cover the default behaviour of previous versions. More details can be found in #9716.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants