Skip to content

KAFKA-7895: fix stream-time reckoning for Suppress (2.1) (#6286)#6325

Merged
bbejeck merged 3 commits intoapache:2.1from
vvcephei:KAFKA-7895-fix-suppress-2.1
Mar 5, 2019
Merged

KAFKA-7895: fix stream-time reckoning for Suppress (2.1) (#6286)#6325
bbejeck merged 3 commits intoapache:2.1from
vvcephei:KAFKA-7895-fix-suppress-2.1

Conversation

@vvcephei
Copy link
Copy Markdown
Contributor

Even within a Task, different Processors have different perceptions
of time, due to record caching on stores and in suppression itself,
and in general, due to any processor logic that may hold onto
records arbitrarily and emit them later. Thanks to this, we can't rely
on the whole task existing in the same "instant" of stream-time. The
solution is for each processor node that cares about stream-time to
track it independently.

On the side, backporting some internally-facing code maintainability updates

Committer Checklist (excluded from commit message)

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

Even within a Task, different Processors have different perceptions
of time, due to record caching on stores and in suppression itself,
and in general, due to any processor logic that may hold onto
records arbitrarily and emit them later. Thanks to this, we can't rely
on the whole task existing in the same "instant" of stream-time. The
solution is for each processor node that cares about stream-time to
track it independently.
Copy link
Copy Markdown
Contributor Author

@vvcephei vvcephei left a comment

Choose a reason for hiding this comment

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

@guozhangwang @bbejeck Here's the backport to 2.1 of (#6286), when you have a chance to review.

I haven't had a chance to run the tests yet, which we should definitely do before merging, but I just wanted to push my branch and open the PR, since the cherry-pick was so messy.

private final TimeDefinition<K> bufferTimeDefinition;
private final BufferFullStrategy bufferFullStrategy;
private final boolean shouldSuppressTombstones;
private final boolean safeToDropTombstones;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was an unrelated change in trunk/2.2 to improve the code legibility.

I'm proposing to backport it to keep the Suppress code consistent and improve maintainability.

* figure out when to forget the fact that we have emitted some result (currently, the
* buffer immediately forgets all about a key when we emit, which helps to keep it
* compact).
*/
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Likewise, this is part of the Suppress code legibility change.

Copy link
Copy Markdown
Member

@bbejeck bbejeck left a comment

Choose a reason for hiding this comment

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

Thanks, @vvcephei for the separate PR for 2.1.
LGTM, pending passing tests.

But I do have one question - AbstractSegments.java and KTableSuppressProcessorMetricsTest.java show up with no changes but in #6286 they had some minor changes. Is this intentional?

@guozhangwang guozhangwang changed the title KAFKA-7895: fix stream-time reckoning for Suppress (2.2) (#6286) KAFKA-7895: fix stream-time reckoning for Suppress (2.1) (#6286) Feb 26, 2019
@guozhangwang
Copy link
Copy Markdown
Contributor

But I do have one question - AbstractSegments.java and KTableSuppressProcessorMetricsTest.java show up with no changes but in #6286 they had some minor changes. Is this intentional?

AbstractSegments in 2.1 does not exist yet (it was refactored in 2.2 only), and KTableSuppressProcessorMetricsTest is also only added in 2.2. as well.

@guozhangwang
Copy link
Copy Markdown
Contributor

retest this please

@guozhangwang
Copy link
Copy Markdown
Contributor

@vvcephei failed with

Execution failed for task ':streams:checkstyleMain'.

@vvcephei
Copy link
Copy Markdown
Contributor Author

vvcephei commented Mar 4, 2019

Thanks for the reviews, @guozhangwang and @bbejeck .

Did that answer your question, @bbejeck ? The reason AbstractSegments showed up in the diff was actually a mistake on my part. I pushed an empty file. I've removed it. In the 2.1 branch, all that functionality is part of Segments.

Thanks for the catch @guozhangwang . That was due to cherry-pick noise. I've pushed a fix for it now, and will monitor the test results.

@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 4, 2019

Did that answer your question, @bbejeck ? The reason AbstractSegments showed up in the diff was actually a mistake on my part. I pushed an empty file. I've removed it. In the 2.1 branch, all that functionality is part of Segments.

Yep, just waiting for a green build at this point.

@vvcephei
Copy link
Copy Markdown
Contributor Author

vvcephei commented Mar 5, 2019

Hi @bbejeck and @guozhangwang , the tests have passed. Is this ready to merge?

Thanks,
john

@vvcephei
Copy link
Copy Markdown
Contributor Author

vvcephei commented Mar 5, 2019

@vvcephei
Copy link
Copy Markdown
Contributor Author

vvcephei commented Mar 5, 2019

Ok, the system tests passed as well. I think it's ready to merge now.

@bbejeck bbejeck merged commit 0953cd8 into apache:2.1 Mar 5, 2019
@bbejeck
Copy link
Copy Markdown
Member

bbejeck commented Mar 5, 2019

merged #6325 into 2.1

@vvcephei vvcephei deleted the KAFKA-7895-fix-suppress-2.1 branch March 5, 2019 19:39
@vvcephei
Copy link
Copy Markdown
Contributor Author

vvcephei commented Mar 5, 2019

Thanks, @bbejeck !

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants