Flink CDC Issue Import created FLINK-34815:
----------------------------------------------
Summary: [Bug] Sqlserver transaction hung when get change data.
Key: FLINK-34815
URL: https://issues.apache.org/jira/browse/FLINK-34815
Project: Flink
Issue Type: Bug
Components: Flink CDC
Reporter: Flink CDC Issue Import
### Search before asking
- [X] I searched in the
[issues|https://github.com/ververica/flink-cdc-connectors/issues) and found
nothing similar.
### Flink version
1.17.1
### Flink CDC version
master
### Database and its version
Sqlserver 2016SP3
### Minimal reproduce step
1. Prepare a long running flink cdc sql job to synchronize sqlserver data to
postgresql
2. The Job works fine at first.
3. After a few days, the job will no longer synchronize data any more. and
there is no error in flink log.
### What did you expect to see?
A long running job should be always works fine
### What did you see instead?
Hi,
There is no flink error log but we found one sql blocked for a long time in
sqlserver database:
```
(@P0 varbinary(8000),@P1 varbinary(8000)]
SELECT *, TODATETIMEOFFSET([XXXX].sys.fn_cdc_map_lsn_to_time([__$start_lsn]),
DATEPART(TZOFFSET, SYSDATETIMEOFFSET()))
FROM [XXXXXX].cdc.[fn_cdc_get_all_changes_XXXXX|@P0, @P1, N'all update old']
order by [__$start_lsn] ASC, [__$seqval] ASC, [__$operation] ASC
```
it looks the db transaction blocked for some reason when get change data,
and we have checked code in SqlServerStreamingChangeEventSource.java(L460),
dispatcher.dispatchDataChangeEvent() blocked because it have no timeout
settings for transaction.
Any suggestions about this issue?
Thanks a lot for your help ~
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
---------------- Imported from GitHub ----------------
Url: https://github.com/apache/flink-cdc/issues/2507
Created by: [YongkuiYang|https://github.com/YongkuiYang]
Labels: bug,
Created at: Tue Sep 19 17:11:14 CST 2023
State: open
--
This message was sent by Atlassian Jira
(v8.20.10#820010)