Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-5353: baseTimestamp should always have a create timestamp #3177

Closed

Conversation

ijuma
Copy link
Contributor

@ijuma ijuma commented May 31, 2017

This makes the case where we build the records from scratch consistent
with the case where update the batch header "in place". Thanks to
@edenhill who found the issue while testing librdkafka.

The reason our tests don’t catch this is that we rely on the maxTimestamp
to compute the record level timestamps if log append time is used.

@ijuma
Copy link
Contributor Author

ijuma commented May 31, 2017

Review by @hachikuji

@ijuma ijuma changed the title MINOR: Set baseSequence correctly if log append time and no broker recompression KAFKA-5353: Set baseSequence correctly if log append time and no broker recompression May 31, 2017
@ijuma ijuma changed the title KAFKA-5353: Set baseSequence correctly if log append time and no broker recompression KAFKA-5353: Set baseTimestamp correctly if log append time and no broker recompression May 31, 2017
@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4639/
Test PASSed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4624/
Test PASSed (JDK 8 and Scala 2.12).

@hachikuji
Copy link
Contributor

Thanks for the patch. We should definitely fix the inconsistent behavior. It does seem a bit unfortunate to lose the create timestamp information though if we don't have to. Alternatively, we can let base timestamp always be the create time and ensure that the relative timestamps are preserved when recompressing on the broker. Since we have the timestamp type field in the batch, we can still override the individual timestamps to use the log append time before returning to users. And perhaps in the future we will have a use case which calls for having the create time available regardless of the timestamp type. At a minimum, it may be useful for debugging.

@ijuma ijuma force-pushed the set-base-sequence-for-log-append-time branch from 12777a5 to d19c9eb Compare May 31, 2017 21:35
@ijuma ijuma changed the title KAFKA-5353: Set baseTimestamp correctly if log append time and no broker recompression KAFKA-5353: baseTimestamp should always have a create timestamp May 31, 2017
Copy link
Contributor

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

LGTM

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.11/4677/
Test PASSed (JDK 7 and Scala 2.11).

@asfbot
Copy link

asfbot commented May 31, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/4661/
Test PASSed (JDK 8 and Scala 2.12).

asfgit pushed a commit that referenced this pull request May 31, 2017
This makes the case where we build the records from scratch consistent
with the case where update the batch header "in place". Thanks to
edenhill who found the issue while testing librdkafka.

The reason our tests don’t catch this is that we rely on the maxTimestamp
to compute the record level timestamps if log append time is used.

Author: Ismael Juma <ismael@juma.me.uk>

Reviewers: Jason Gustafson <jason@confluent.io>

Closes #3177 from ijuma/set-base-sequence-for-log-append-time

(cherry picked from commit 647afef)
Signed-off-by: Ismael Juma <ismael@juma.me.uk>
@asfgit asfgit closed this in 647afef May 31, 2017
@ijuma ijuma deleted the set-base-sequence-for-log-append-time branch September 5, 2017 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants