apoorvmittal10 commented on code in PR #19863: URL: https://github.com/apache/kafka/pull/19863#discussion_r2123150297
########## docs/ops.html: ########## @@ -213,11 +224,54 @@ <h4 class="anchor-heading"><a id="basic_ops_consumer_group" class="anchor-link"> <p> For example, to reset offsets of a consumer group to the latest offset: - <pre><code class="language-bash">$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --reset-offsets --group consumergroup1 --topic topic1 --to-latest + <pre><code class="language-bash">$ bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --reset-offsets --group my-group --topic topic1 --to-latest TOPIC PARTITION NEW-OFFSET topic1 0 0</code></pre> - <p> + <h4 class="anchor-heading"><a id="basic_ops_share_group" class="anchor-link"></a><a href="#basic_ops_share_group">Managing share groups</a></h4> + + With the ShareGroupCommand tool, we can list, describe, or delete the share groups. The share group can be deleted only if the group does not have any active members. + + For example, to list all share groups in the cluster: + + <pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --list +my-share-group</code></pre> + + To view the current start offset, the "--describe" option can be used: + + <pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --describe --group my-share-group +GROUP TOPIC PARTITION START-OFFSET +my-share-group topic1 0 4</code></pre> + + Note that the admin client needs DESCRIBE access to all the topics used in the group. + + There are a number of additional "describe" options that can be used to provide more detailed information about a share group: + <ul> + <li>--members: This option provides the list of all active members in the share group. + <pre><code class="language-bash">bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --describe --group my-share-group --members +GROUP CONSUMER-ID HOST CLIENT-ID #PARTITIONS ASSIGNMENT +my-share-group 94wrSQNmRda9Q6sk6jMO6Q /127.0.0.1 console-share-consumer 1 topic1:0 +my-share-group EfI0sha8QSKSrL_-I_zaTA /127.0.0.1 console-share-consumer 1 topic1:0</code></pre> + You can see that both members have been assigned the same partition which they are sharing. + </li> + <li>--offsets: This is the default describe option and provides the same output as the "--describe" option.</li> + <li>--state: This option provides useful group-level information. + <pre><code class="language-bash">bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --describe --group my-share-group --state +GROUP COORDINATOR (ID) STATE #MEMBERS +my-share-group localhost:9092 (1) Stable 2</code></pre> + </li> + </ul> + + <p>To delete the offsets of individual topics in the share group, the "--delete-offsets" option can be used: Review Comment: Just asking: do we need to write that group should be empty prior deleting offsets or group? -- 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. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org