You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "CCCLL (via GitHub)" <gi...@apache.org> on 2026/10/14 05:47:57 UTC

[PR] MINOR: Sort kafka-get-offsets output by topic and partition number [kafka]

CCCLL opened a new pull request, #23811:
URL: https://github.com/apache/kafka/pull/23811

   `kafka-get-offsets.sh` prints one `topic:partition:offset` line per
   partition. Since the tool was rewritten in Java (KAFKA-14581, 3.7.0)
   the lines are ordered by `TopicPartition.toString()`, that is by the
   string `topic-partition`, whereas the Scala version ordered them by
   topic and then by partition number. Partition 10 is therefore printed
   before partition 2, and the partitions of a topic can be interleaved
   with those of another topic. For a topic `a` with 12 partitions and a
   topic `a-1` with 2 partitions the output is:
   
       a:0:0
       a:1:0
       a-1:0:0
       a-1:1:0
       a:10:0
       a:11:0
       a:2:0
       ...
   
   Order the output by topic name and then by partition number again.
   
   The existing tests compare the output as an ordered list but only use
   topics with up to 4 partitions, so the new test uses a topic with 11
   partitions next to a topic named `foo-1`. It fails without the fix.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINOR: Sort kafka-get-offsets output by topic and partition number [kafka]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23811:
URL: https://github.com/apache/kafka/pull/23811#issuecomment-6331862553

   A label of 'needs-attention' was automatically added to this PR in order to raise the
   attention of the committers. Once this issue has been triaged, the `triage` label
   should be removed to prevent this automation from happening again.


-- 
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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org