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
[BEAM-7192] Fix partitioning of buffered elements during checkpointing #8441
Conversation
Run Java PreCommit |
Run Java PreCommit |
Flaky Dataflow test in https://builds.apache.org/job/beam_PreCommit_Java_Phrase/1066/ |
I don't think we need a lock for the output buffer since elements are only emitted by the operator thread. I will look at the changes in more detail later. |
Thanks for taking an initial look.
I think we need a lock because elements are buffered to the state backend while the SDK harness can still process elements and make state requests. |
Output elements are buffered by the same thread (the operator thread) that also performs shapshotState. That is why I think that no lock is necessary. |
There are two threads:
So there can be concurrent writes to the state backend which must be avoided. We don't need the lock in case only the main operator thread can have access, as it is the case for |
Run Java PreCommit |
There is no need to buffer output except during |
That's correct. |
...src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/DoFnOperator.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/DoFnOperator.java
Show resolved
Hide resolved
...src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/DoFnOperator.java
Show resolved
Hide resolved
When a Flink checkpoint is taken, the current bundle is finalized. The finalization happens when the checkpoint barrier has already been sent downstream; emitting elements at this point would violate the checkpoint barrier alignment. When elements are emitted during checkpointing they are buffered until the checkpoint is complete. We should ensure that they are keyed correctly and emission of the buffered elements does not interfere with any concurrent state requests (in case of portability).
Run Flink ValidatesRunner |
When a Flink checkpoint is taken, the current bundle is finalized. The
finalization happens when the checkpoint barrier has already been sent
downstream; emitting elements at this point would violate the checkpoint barrier
alignment.
When elements are emitted during checkpointing they are buffered until the
checkpoint is complete. We should ensure that they are keyed correctly and
emission of the buffered elements does not interfere with any concurrent state
requests (in case of portability).
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.