You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/11/18 13:25:23 UTC

[GitHub] [pulsar] candlerb opened a new issue #5685: Documentation: skip-all versus clear-backlog

candlerb opened a new issue #5685: Documentation: skip-all versus clear-backlog
URL: https://github.com/apache/pulsar/issues/5685
 
 
   **Is your feature request related to a problem? Please describe.**
   Documentation shows [skip-all](https://pulsar.apache.org/docs/en/pulsar-admin/#skip-all) followed by [clear-backlog](https://pulsar.apache.org/docs/en/pulsar-admin/#clear-backlog-1), both at the topic with no description of what the difference is.
   
   I don't know when it's appropriate to use one or the other.
   
   Note: there is a separate [clear-backlog](https://pulsar.apache.org/docs/en/pulsar-admin/#clear-backlog) command documented at the namespace level (rather than the topic level)
   
   UPDATE 1: pulsar-admin doesn't seem to recognise `topics skip-all` at all. 
   
   ```
   ubuntu@ldex-pulsar:~$ apache-pulsar-2.4.1/bin/pulsar-admin topics clear-backlog
   The following option is required: -s, --subscription
   
   Skip all the messages for the subscription
   Usage: clear-backlog [options] persistent://tenant/namespace/topic
     Options:
     * -s, --subscription
          Subscription to be cleared
   
   ubuntu@ldex-pulsar:~$ apache-pulsar-2.4.1/bin/pulsar-admin topics skip-all
   Expected a command, got skip-all
   
   Exception in thread "main" com.beust.jcommander.ParameterException: Asking description for unknown command: null
   	at com.beust.jcommander.JCommander.getCommandDescription(JCommander.java:1003)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:988)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:980)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:972)
   	at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:49)
   	at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:218)
   	at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:260)
   ^C
   
   ubuntu@ldex-pulsar:~$ apache-pulsar-2.4.1/bin/pulsar-admin topics skip-all persistent://public/default/my-topic -s my-subscription
   Expected a command, got skip-all
   
   Exception in thread "main" com.beust.jcommander.ParameterException: Asking description for unknown command: null
   	at com.beust.jcommander.JCommander.getCommandDescription(JCommander.java:1003)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:988)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:980)
   	at com.beust.jcommander.JCommander.usage(JCommander.java:972)
   	at org.apache.pulsar.admin.cli.CmdBase.run(CmdBase.java:49)
   	at org.apache.pulsar.admin.cli.PulsarAdminTool.run(PulsarAdminTool.java:218)
   	at org.apache.pulsar.admin.cli.PulsarAdminTool.main(PulsarAdminTool.java:260)
   ^C
   ```
   
   But there appears to be a test case for it in [pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/PulsarAdminToolTest.java](https://github.com/apache/pulsar/blob/master/pulsar-client-tools-test/src/test/java/org/apache/pulsar/admin/cli/PulsarAdminToolTest.java#L714)
   
   ```
           topics.run(split("skip-all persistent://myprop/clust/ns1/ds1 -s sub1"));
           verify(mockTopics).skipAllMessages("persistent://myprop/clust/ns1/ds1", "sub1");
   ```
   
   `clear-backlog` works at the topic+subscription level:
   
   ```
   ubuntu@ldex-pulsar:~$ apache-pulsar-2.4.1/bin/pulsar-admin topics clear-backlog persistent://public/default/my-topic -s my-subscription
   ubuntu@ldex-pulsar:~$
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services