[FLINK-23473][runtime] Do not create transaction in TwoPhaseCommitSinkFunction after finish #16768
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Do not create transactions in TwoPhaseCommitSinkFunction after finish() is called. The reason is that after finish() is called, no more input is expected and hence no more transactions are needed.
The problem of creating transactions is that there would be one/or possibly several open transactions that would be never closed after the task finishes.
Brief change log
Introduce empty transaction holder; so that after sink function is closed, we will place empty transaction as a holder.
Verifying this change
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)