[Prism] Handle pending adjustment for processing time bundle correctly - #36384
Conversation
Summary of ChangesHello @shunping, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a crucial fix within the Prism runner's element management system to correctly handle pending element adjustments during the creation of processing time bundles. This ensures that the system accurately tracks the number of elements awaiting processing, resolving issues where processing time triggers could lead to incorrect or duplicate element processing, thereby improving the correctness and reliability of data processing in Prism. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
34c9edb to
18e3622
Compare
| state.Pane = computeNextTriggeredPane(state.Pane, endOfWindowReached) | ||
|
|
||
| // We're going to process this trigger! | ||
| elems, _ := ss.buildTriggeredBundle(em, string(e.keyBytes), e.window) |
There was a problem hiding this comment.
The pendingAdjustment from buildTriggerBundle was discarded previously, which leads to the issue when handling processing time bundle in accumulating mode.
|
cc'ed @lostluck |
|
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
| 'org.apache.beam.sdk.metrics.MetricsTest$CommittedMetricTests.testCommittedGaugeMetrics', | ||
|
|
||
| // negative WaitGroup counter when failing bundle | ||
| // Instead of 42, Prism got 84, which suggests two early panes of 42 are fired. |
There was a problem hiding this comment.
This is what's happening in the "testAfterProcessingTimeContinuationTriggerUsingState" after this change?
There was a problem hiding this comment.
Yes. I think the previous negative WaitGroup counter masked the true error in this test.
The interesting thing is that it has a sister test at
, which uses TestStream rather than stateful DoFn to generate the upstream data. That test passes.|
The failed test in Python Coverage seems to a flake. |
Re-enable test:
org.apache.beam.sdk.testing.TestStreamTest.testEarlyPanesOfWindowin prism.This test uses accumulating mode in window strategy and the previous failure is due to not handling pendingAdjustment from
buildTriggeredBundle(pointed out in the comment below). The fix is to plumb the pendingAdjustment out and correctly address it.