kafka-jira mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KAFKA-6057) Users forget `--execute` in the offset reset tool
Date Mon, 26 Feb 2018 17:01:00 GMT

    [ https://issues.apache.org/jira/browse/KAFKA-6057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16377170#comment-16377170
] 

ASF GitHub Bot commented on KAFKA-6057:
---------------------------------------

hachikuji closed pull request #4069: KAFKA-6057: Users forget `--execute` in the offset reset
tool
URL: https://github.com/apache/kafka/pull/4069
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
index 68186315a42..cb9fbe3313e 100755
--- a/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
+++ b/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala
@@ -1033,16 +1033,16 @@ object ConsumerGroupCommand extends Logging {
         CommandLineUtils.printUsageAndDie(parser, s"Option $deleteOpt either takes $groupOpt,
$topicOpt, or both")
 
       if (options.has(resetOffsetsOpt)) {
-        if (!options.has(dryRunOpt) && !options.has(executeOpt)) {
-          Console.err.println("WARN: In a future major release, the default behavior of this
command will be to " +
-            "prompt the user before executing the reset rather than doing a dry run. You
should add the --dry-run " +
-            "option explicitly if you are scripting this command and want to keep the current
default behavior " +
-            "without prompting.")
-        }
-
         if (options.has(dryRunOpt) && options.has(executeOpt))
           CommandLineUtils.printUsageAndDie(parser, s"Option $resetOffsetsOpt only accepts
one of $executeOpt and $dryRunOpt")
 
+        if (!options.has(dryRunOpt) && !options.has(executeOpt)) {
+          Console.err.println("WARN: No action will be performed as the --execute option
is missing." +
+            "In a future major release, the default behavior of this command will be to prompt
the user before " +
+            "executing the reset rather than doing a dry run. You should add the --dry-run
option explicitly " +
+            "if you are scripting this command and want to keep the current default behavior
without prompting.")
+        }
+
         CommandLineUtils.checkRequiredArgs(parser, options, groupOpt)
         CommandLineUtils.checkInvalidArgs(parser, options, resetToOffsetOpt, allResetOffsetScenarioOpts
- resetToOffsetOpt)
         CommandLineUtils.checkInvalidArgs(parser, options, resetToDatetimeOpt, allResetOffsetScenarioOpts
- resetToDatetimeOpt)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


> Users forget `--execute` in the offset reset tool
> -------------------------------------------------
>
>                 Key: KAFKA-6057
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6057
>             Project: Kafka
>          Issue Type: Improvement
>          Components: consumer, core, tools
>            Reporter: Yeva Byzek
>            Assignee: Gilles Degols
>            Priority: Major
>              Labels: newbie
>
> Sometimes users try to reset offsets using {{kafka-consumer-groups}} but forget the {{--execute}}
parameter. If this is omitted, no action was performed, but this is not conveyed to users.

> This JIRA is to augment the tool such that if the parameter is omitted, then give users
feedback that no action was performed unless {{--execute}} is provided.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message