Skip to content

Commit 7b09531

Browse files
MINOR: Docs for kafka-share-groups.sh --reset-offsets (#20867)
Adds a tiny missing piece of documentation for share groups. Reviewers: Apoorv Mittal <[email protected]>, Chia-Ping Tsai <[email protected]>
1 parent 05fd35a commit 7b09531

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

docs/ops.html

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ <h4 class="anchor-heading"><a id="basic_ops_consumer_group" class="anchor-link">
190190
</ul>
191191

192192
<p>
193-
--reset-offsets also has the following scenarios to choose from (at least one scenario must be selected):
193+
--reset-offsets also has the following scenarios to choose from:
194194
<ul>
195195
<li>
196196
--to-datetime &lt;String: datetime&gt; : Reset offsets to offsets from datetime. Format: 'YYYY-MM-DDThh:mm:ss.sss'
@@ -237,11 +237,11 @@ <h4 class="anchor-heading"><a id="basic_ops_share_group" class="anchor-link"></a
237237
<pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --list
238238
my-share-group</code></pre>
239239

240-
To view the current start offset, use the "--describe" option:
240+
To view the current start offset and lag, use the "--describe" option:
241241

242242
<pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --describe --group my-share-group
243-
GROUP TOPIC PARTITION START-OFFSET
244-
my-share-group topic1 0 4</code></pre>
243+
GROUP TOPIC PARTITION START-OFFSET LAG
244+
my-share-group topic1 0 4 0</code></pre>
245245

246246
NOTE: The admin client needs DESCRIBE access to all the topics used in the group.
247247

@@ -262,6 +262,40 @@ <h4 class="anchor-heading"><a id="basic_ops_share_group" class="anchor-link"></a
262262
</li>
263263
</ul>
264264

265+
<p>To reset the offsets of a share group, use the "--reset-offsets" option:
266+
267+
<p>
268+
It has 2 execution options:
269+
<ul>
270+
<li>
271+
--dry-run: to display which offsets to reset.
272+
</li>
273+
<li>
274+
--execute : to execute --reset-offsets process.
275+
</li>
276+
</ul>
277+
278+
<p>
279+
--reset-offsets also has the following scenarios to choose from:
280+
<ul>
281+
<li>
282+
--to-datetime &lt;String: datetime&gt; : Reset offsets to offsets from datetime. Format: 'YYYY-MM-DDThh:mm:ss.sss'
283+
</li>
284+
<li>
285+
--to-earliest : Reset offsets to earliest offset.
286+
</li>
287+
<li>
288+
--to-latest : Reset offsets to latest offset.
289+
</li>
290+
</ul>
291+
292+
<p>
293+
For example, to reset offsets of a share group to the latest offset:
294+
295+
<pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --reset-offsets --group my-share-group --topic topic1 --to-latest --execute
296+
GROUP TOPIC PARTITION NEW-OFFSET
297+
my-share-group topic1 0 10</code></pre>
298+
265299
<p>To delete the offsets of individual topics in the share group, use the "--delete-offsets" option:
266300

267301
<pre><code class="language-bash">$ bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --delete-offsets --group my-share-group --topic topic1

0 commit comments

Comments
 (0)