Skip to content

Conversation

@thomaskwscott
Copy link
Contributor

See https://cwiki.apache.org/confluence/display/KAFKA/KIP-734%3A+Improve+AdminClient.listOffsets+to+return+timestamp+and+offset+for+the+record+with+the+largest+timestamp

More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.

Tested with new Integration test

Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@rajinisivaram rajinisivaram requested a review from dajac May 25, 2021 13:31
@dajac
Copy link
Member

dajac commented May 25, 2021

I will review it in the next few days.

Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaskwscott Thanks for the PR. I just made a first read over it and I left few high level questions and few nits.

I feel like we need to add more tests to cover the changes done in the PR. I can think of the following places where we might need to add and/or extend tests:

  • RequestResponseTest
  • ListOffsetsRequestTest
  • KafkaAdminClientTest - Here we need to test all the edge cases.
  • LogTest - We need to test the changes in Log.
  • ListOffsetsRequestTest and/or LogOffsetTest

There might other places as well.

Comment on lines +1326 to +1328
Some(new TimestampAndOffset(latestTimestampSegment.maxTimestampSoFar,
latestTimestampSegment.offsetOfMaxTimestampSoFar,
epochOptional))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get a maxTimestampSoFar and offsetOfMaxTimestampSoFar which does not correspond to each others? It seems that we have no guarantee here. Is it an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In all cases I can find the 2 are updated together so I think we can assume consistency. For the topic liveness case in the KIP absolute consistency is not required but there will be other cases that will need this (e.g. topic inspection).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should address this as well. I am fine with doing it in a follow-up PR though so we can keep this focused. Ok for you?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we file a JIRA as a subtask in the Jira of the KIP to not forget about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaskwscott thomaskwscott requested a review from dajac June 8, 2021 17:13
@dajac
Copy link
Member

dajac commented Jun 11, 2021

@thomaskwscott Thanks for the update. I will review it next week.

Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaskwscott Thanks for the update. I left few more comments.

@thomaskwscott thomaskwscott requested a review from dajac June 21, 2021 15:48
Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaskwscott Thanks for the update. I left a few more comments/questions.

@thomaskwscott thomaskwscott requested a review from dajac June 23, 2021 12:11
@thomaskwscott thomaskwscott requested a review from dajac June 24, 2021 13:50
Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thomaskwscott The PR looks pretty good. I left a few minor comments.

Copy link
Member

@dajac dajac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the patch!

@dajac
Copy link
Member

dajac commented Jun 25, 2021

Failures are not related:

Build / JDK 16 and Scala 2.13 / kafka.server.ReplicationQuotasTest.shouldThrottleOldSegments()
Build / JDK 16 and Scala 2.13 / org.apache.kafka.streams.integration.KTableKTableForeignKeyJoinDistributedTest.shouldBeInitializedWithDefaultSerde
Build / JDK 8 and Scala 2.12 / org.apache.kafka.common.network.SslTransportLayerTest.[1] tlsProtocol=TLSv1.2, useInlinePem=false
Build / JDK 8 and Scala 2.12 / org.apache.kafka.common.network.SslTransportLayerTest.[2] tlsProtocol=TLSv1.2, useInlinePem=true
Build / JDK 8 and Scala 2.12 / org.apache.kafka.common.network.SslTransportLayerTest.[1] tlsProtocol=TLSv1.2, useInlinePem=false
Build / JDK 8 and Scala 2.12 / org.apache.kafka.common.network.SslTransportLayerTest.[2] tlsProtocol=TLSv1.2, useInlinePem=true
Build / JDK 16 and Scala 2.13 / kafka.server.RaftClusterTest.testCreateClusterAndCreateAndManyTopics()
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[1] tlsProtocol=TLSv1.2, useInlinePem=false
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[2] tlsProtocol=TLSv1.2, useInlinePem=true
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[3] tlsProtocol=TLSv1.3, useInlinePem=false
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[1] tlsProtocol=TLSv1.2, useInlinePem=false
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[2] tlsProtocol=TLSv1.2, useInlinePem=true
Build / JDK 11 and Scala 2.13 / org.apache.kafka.common.network.SslTransportLayerTest.[3] tlsProtocol=TLSv1.3, useInlinePem=false

@dajac dajac changed the title KAFKA-12541 Extend ListOffset to fetch offset with max timestamp KAFKA-12541; Extend ListOffset to fetch offset with max timestamp (KIP-734) Jun 25, 2021
@dajac dajac merged commit bd72ef1 into apache:trunk Jun 25, 2021
@ijuma
Copy link
Member

ijuma commented Jun 28, 2021

@vvcephei filed https://issues.apache.org/jira/browse/KAFKA-13002, please take a look and see if it's related to this.

@dajac
Copy link
Member

dajac commented Jun 28, 2021

Looking at it now.

@dajac
Copy link
Member

dajac commented Jun 28, 2021

We have found the issue. @thomaskwscott is working on the fix. My bad, I missed one case.

@ijuma
Copy link
Member

ijuma commented Jun 28, 2021

Thanks for the quick investigation!

@zhishengzhang
Copy link

good job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants