curcur commented on a change in pull request #16768:
URL: https://github.com/apache/flink/pull/16768#discussion_r688220104
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/sink/TwoPhaseCommitSinkFunction.java
##########
@@ -383,12 +404,14 @@ public void initializeState(FunctionInitializationContext
context) throws Except
{
TXN transaction =
operatorState.getPendingTransaction().handle;
- recoverAndAbort(transaction);
- handledTransactions.add(transaction);
- LOG.info(
- "{} aborted recovered transaction {}",
- name(),
- operatorState.getPendingTransaction());
+ if (transaction != null) {
Review comment:
This technically is exactly a re-write. The only reason adding a null
check here is because we now may have empty holder that contains null TXN.
However, it is not possible to get the pendingTransaction as an empty one;
as you can see from the adding logic, empty transaction will not be added to
pending.
so I do not think a test is needed here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]