redpanda-data / redpanda

Redpanda is a streaming data platform for developers. Kafka API compatible. 10x faster. No ZooKeeper. No JVM!
https://redpanda.com
9.37k stars 576 forks source link

listOffsets returns UnsupportedVersionException when using OffsetSpec.maxTimestamp() #17829

Open pmw-rp opened 4 months ago

pmw-rp commented 4 months ago

Version & Environment

23.3

What went wrong?

When calling listOffsets() with OffsetSpec.maxTimestamp() (to determine the timestamp of the latest message), I received the following:

Exception in thread "main" java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.UnsupportedVersionException: The node does not support LIST_OFFSETS with version in range [7,8]. The supported range is [0,4].
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:165)
at Clean.lastProduced(Clean.java:60)
at Clean.main(Clean.java:97)
Caused by: org.apache.kafka.common.errors.UnsupportedVersionException: The node does not support LIST_OFFSETS with version in range [7,8]. The supported range is [0,4].

What should have happened instead?

A valid ListOffsetsResult object is returned, containing the timestamp of the latest message.

How to reproduce the issue?

  1. Create admin client
  2. Query any topic-partition with OffsetSpec.maxTimestamp()
  3. See the error message

Additional information

JIRA Link: CORE-2345

twmb commented 4 months ago

Note this is KIP-734, introduced in Kafka 3.0. The client can use -3 to request the max timestamp.

While at it we should also address KIP-405, introduced in Kafka 3.4. The client can use -4 to request the local log start offset (in the context of tiered storage; we already have this information available via the admin API).

github-actions[bot] commented 1 month ago

This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.