JsChen2Casiku opened a new issue, #9032:
URL: https://github.com/apache/seatunnel/issues/9032

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### What happened
   
   Using PostgreSQL CDC to synchronize data to the Oceanbase database, 
executing tasks using startup.mode: initial will result in an error, but 
executing tasks using startup.mode: latest will work normally
   
   ### SeaTunnel Version
   
   2.3.9
   
   ### SeaTunnel Config
   
   ```conf
   {
       "env" : {
           "job.mode" : "STREAMING",
           "job.name" : "250321-1758",
           "parallelism" : 2,
           "checkpoint.interval" : 300000,
           "checkpoint.timeout" : 3600000,
           "job.retry.times" : 3,
           "job.retry.interval.seconds" : 3
       },
       "source" : [
           {
               "plugin_name" : "Postgres-CDC",
               "plugin_output" : "250321-1758",
               "base-url" : "jdbc:postgresql://***.***.***.***:25432/hyu",
               "username" : "******",
               "password" : "******",
               "database-names" : [
                   "hyu"
               ],
               "schema-names" : [
                   "daos"
               ],
               "table-names" : [
                   "hyu.daos.user_source_2w"
               ],
               "table-names-config" : [
                   {
                       "table" : "hyu.daos.user_source_2w",
                       "primaryKeys" : [
                           "id"
                       ]
                   }
               ],
               "exactly_once" : true,
               "decoding.plugin.name" : "pgoutput",
               "startup.mode" : "initial",
               "server-time-zone" : "UTC",
               "debezium" : {
                   "snapshot.fetch.size" : 1024,
                   "max.queue.size" : 8192,
                   "max.batch.size" : 1024,
                   "poll.interval.ms" : 1000
               }
           }
       ],
       "sink" : [
           {
               "db_type" : "oceanbase",
               "plugin_name" : "jdbc",
               "plugin_input" : "250321-1758",
               "url" : "jdbc:oceanbase://***.***.***.***:2881/sync",
               "driver" : "com.oceanbase.jdbc.Driver",
               "user" : "root@haiyu",
               "password" : "******",
               "database" : "sync",
               "table" : "user_source_2w_02",
               "primary_keys" : [
                   "id"
               ],
               "compatible_mode" : "mysql",
               "batch_size" : 10000,
               "generate_sink_sql" : true
           }
       ]
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config ./job/st.conf -m local
   ```
   
   ### Error Exception
   
   ```log
   [955403849664626689] 2025-03-21 17:58:50,672 ERROR 
[o.a.s.e.s.d.p.PhysicalVertex  ] [hz.main.generic-operation.thread-0] - Job 
250321-1758 (955403849664626689), Pipeline: [(1/1)], task: [pipeline-1 
[Source[0]-Postgres-CDC]-SourceTask (1/2)] end with state FAILED and Exception: 
java.lang.RuntimeException: One or more fetchers have encountered exception
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcherManager.checkErrors(SplitFetcherManager.java:147)
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:167)
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:93)
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceReader.pollNext(IncrementalSourceReader.java:119)
        at 
org.apache.seatunnel.engine.server.task.flow.SourceFlowLifeCycle.collect(SourceFlowLifeCycle.java:159)
        at 
org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.collect(SourceSeaTunnelTask.java:127)
        at 
org.apache.seatunnel.engine.server.task.SeaTunnelTask.stateProcess(SeaTunnelTask.java:169)
        at 
org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:132)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:694)
        at 
org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1019)
        at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43)
        at 
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
   Caused by: java.lang.RuntimeException: SplitFetcher thread 0 received 
unexpected exception while polling the records
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:165)
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:81)
        ... 5 more
   Caused by: java.io.IOException: Source fetch execution was fail
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.FetchTask.run(FetchTask.java:73)
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:162)
        ... 6 more
   Caused by: java.io.IOException: 
org.apache.seatunnel.common.utils.SeaTunnelException: Read split 
SnapshotSplit(tableId=haiyu.daos.user_source_2w, splitKeyType=ROW<id BIGINT>, 
splitStart=null, splitEnd=[8097], lowWatermark=null, highWatermark=null) error 
due to java.lang.NullPointerException.
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.fetch(IncrementalSourceSplitReader.java:78)
        at 
org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.FetchTask.run(FetchTask.java:54)
        ... 7 more
   Caused by: org.apache.seatunnel.common.utils.SeaTunnelException: Read split 
SnapshotSplit(tableId=haiyu.daos.user_source_2w, splitKeyType=ROW<id BIGINT>, 
splitStart=null, splitEnd=[8097], lowWatermark=null, highWatermark=null) error 
due to java.lang.NullPointerException.
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.checkReadException(IncrementalSourceScanFetcher.java:216)
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.pollSplitRecordsIfExactlyOnce(IncrementalSourceScanFetcher.java:159)
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.pollSplitRecords(IncrementalSourceScanFetcher.java:121)
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.fetch(IncrementalSourceSplitReader.java:75)
        ... 8 more
   Caused by: io.debezium.DebeziumException: java.lang.NullPointerException
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotSplitReadTask.execute(PostgresSnapshotSplitReadTask.java:112)
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotFetchTask.execute(PostgresSnapshotFetchTask.java:65)
        at 
org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.lambda$submitTask$0(IncrementalSourceScanFetcher.java:96)
        ... 5 more
   Caused by: java.lang.NullPointerException
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotSplitReadTask.createDataEventsForTable(PostgresSnapshotSplitReadTask.java:183)
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotSplitReadTask.createDataEvents(PostgresSnapshotSplitReadTask.java:170)
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotSplitReadTask.doExecute(PostgresSnapshotSplitReadTask.java:136)
        at 
org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.snapshot.PostgresSnapshotSplitReadTask.execute(PostgresSnapshotSplitReadTask.java:107)
        ... 7 more
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   jdk17
   
   ### Screenshots
   
   
![Image](https://github.com/user-attachments/assets/85e533ea-689c-47d7-8640-199310fb46dd)
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscr...@seatunnel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to