[ 
https://issues.apache.org/jira/browse/FLINK-22239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17380505#comment-17380505
 ] 

Maciej BryƄski edited comment on FLINK-22239 at 7/14/21, 11:14 AM:
-------------------------------------------------------------------

[~roman_khachatryan] 
 Changing defaults from this PR gives me following error on Oracle
{code:java}
09:35:18.980 [Source: Custom Source -> Sink: Unnamed (1/1)#0] WARN  
org.apache.flink.runtime.taskmanager.Task - Source: Custom Source -> Sink: 
Unnamed (1/1)#0 (0485d1334319956f744b35249e94ae7d) switched from INITIALIZING 
to FAILED with failure cause: org.apache.flink.util.FlinkRuntimeException: 
unable to recover, error -3: resource manager error has occurred. [null]
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.wrapException(XaFacadeImpl.java:356)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.lambda$execute$12(XaFacadeImpl.java:267)
        at java.base/java.util.Optional.orElseThrow(Optional.java:408)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.execute(XaFacadeImpl.java:267)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.recover(XaFacadeImpl.java:227)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadePoolingImpl.recover(XaFacadePoolingImpl.java:120)
        at 
org.apache.flink.connector.jdbc.xa.XaGroupOpsImpl.recoverAndRollback(XaGroupOpsImpl.java:109)
        at 
org.apache.flink.connector.jdbc.xa.JdbcXaSinkFunction.open(JdbcXaSinkFunction.java:261)
        at 
org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34)
        at 
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
        at 
org.apache.flink.streaming.api.operators.StreamSink.open(StreamSink.java:46)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:437)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:582)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.call(StreamTaskActionExecutor.java:100)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:562)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:647)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:537)
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
        at java.base/java.lang.Thread.run(Thread.java:829)
{code}


was (Author: maver1ck):
[~roman_khachatryan] 
Changing defaults gives me following error on Oracle
{code:java}
09:35:18.980 [Source: Custom Source -> Sink: Unnamed (1/1)#0] WARN  
org.apache.flink.runtime.taskmanager.Task - Source: Custom Source -> Sink: 
Unnamed (1/1)#0 (0485d1334319956f744b35249e94ae7d) switched from INITIALIZING 
to FAILED with failure cause: org.apache.flink.util.FlinkRuntimeException: 
unable to recover, error -3: resource manager error has occurred. [null]
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.wrapException(XaFacadeImpl.java:356)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.lambda$execute$12(XaFacadeImpl.java:267)
        at java.base/java.util.Optional.orElseThrow(Optional.java:408)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.execute(XaFacadeImpl.java:267)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadeImpl.recover(XaFacadeImpl.java:227)
        at 
org.apache.flink.connector.jdbc.xa.XaFacadePoolingImpl.recover(XaFacadePoolingImpl.java:120)
        at 
org.apache.flink.connector.jdbc.xa.XaGroupOpsImpl.recoverAndRollback(XaGroupOpsImpl.java:109)
        at 
org.apache.flink.connector.jdbc.xa.JdbcXaSinkFunction.open(JdbcXaSinkFunction.java:261)
        at 
org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:34)
        at 
org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102)
        at 
org.apache.flink.streaming.api.operators.StreamSink.open(StreamSink.java:46)
        at 
org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:437)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restoreGates(StreamTask.java:582)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.call(StreamTaskActionExecutor.java:100)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.executeRestore(StreamTask.java:562)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:647)
        at 
org.apache.flink.streaming.runtime.tasks.StreamTask.restore(StreamTask.java:537)
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:759)
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566)
        at java.base/java.lang.Thread.run(Thread.java:829)
{code}

> Improve support for JdbcXaSinkFunction
> --------------------------------------
>
>                 Key: FLINK-22239
>                 URL: https://issues.apache.org/jira/browse/FLINK-22239
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC
>            Reporter: Yuan Mei
>            Assignee: Roman Khachatryan
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>
> JdbcXaSinkFunction uses Xa protocol/interface to implement exactly-once 
> guarantee (within each subtask partition).
> Xa is a protocol/interface designed for two-phase commit of distributed DBS 
> (RMs).
> XA guarantees that transactional updates are committed in all of the 
> participating databases, or are fully rolled back out of all of the 
> databases, reverting to the state prior to the start of the transaction.
> Hence some of the dbs that support XA treats XA transaction as global trans, 
> and some of them does not support multiple global trans (per connection) at a 
> time, MYSQL for example (see FLINK-21743).
> This ticket is a follow-up to address such limitations.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to