You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "yyy-yyy1596936 (via GitHub)" <gi...@apache.org> on 2026/06/02 02:33:17 UTC

[I] Apache SeaTunnel 3.13版本,pg-cdc使用initial模式复制槽创建失败 [seatunnel]

yyy-yyy1596936 opened a new issue, #10992:
URL: https://github.com/apache/seatunnel/issues/10992

   ### 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
   
    Apache SeaTunnel 2.3.13版本,pg-cdc使用initial模式复制槽创建失败
   ,在运行时我已经确认表里没有历史创建的复制槽SELECT * FROM pg_replication_slots
   数据库版本:PostgreSQL 13.23, compiled by Visual C++ build 1944, 64-bit
   数据库驱动:postgresql-42.4.3
   
   ### SeaTunnel Version
   
   2.3.13版本
   
   ### SeaTunnel Config
   
   ```conf
   任务配置
   env {
     execution.parallelism = 1
     job.mode = "STREAMING"
     checkpoint.interval = 10000
   }
   
   source {
     Postgres-CDC {
       username = "postgres"
       password = "123"
       url = "jdbc:postgresql://192.168.108.163:5432/ida50"
       debezium.plugin.name='pgoutput'
       database-names = ["ida50"]
       schema-names = ["baf"]
       table-names = ["ida50.baf.baf_aux_ds"]
       startup.mode = "initial"
   
     }
   }
   
   sink {
     Jdbc {
       url = "jdbc:postgresql://192.168.108.163:5432/ida50_his"
       driver = org.postgresql.Driver
       username = "postgres"
       password = "123"
   
           generate_sink_sql = true
       database = "ida50_his"
       table = "ida50_his.baf.baf_aux_ds"
     }
   }
   ```
   
   ### Running Command
   
   ```shell
   ./bin/seatunnel.sh --config config/test_cdc_disabled_his.conf -m cluster
   ```
   
   ### Error Exception
   
   ```log
   完整日志:
   ===============================================================================
   
   
   2026-06-02 10:20:57,226 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - Fatal Error, 
   
   2026-06-02 10:20:57,226 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - Please submit bug report in https://github.com/apache/seatunnel/issues
   
   2026-06-02 10:20:57,226 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - Reason:SeaTunnel job executed failed 
   
   2026-06-02 10:20:57,227 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - Exception StackTrace:org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:266)
   	at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
   	at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:40)
   Caused by: org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: 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:165)
   	at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:132)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:683)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1012)
   	at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   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: io.debezium.DebeziumException: Creation of replication slot failed
   	at org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.PostgresSourceFetchTaskContext.configure(PostgresSourceFetchTaskContext.java:220)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.submitTask(IncrementalSourceScanFetcher.java:85)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.checkSplitOrStartNext(IncrementalSourceSplitReader.java:186)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.fetch(IncrementalSourceSplitReader.java:84)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.FetchTask.run(FetchTask.java:54)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:162)
   	... 6 more
   Caused by: org.postgresql.util.PSQLException: 错误: 复制槽名 "seatunnel" 已经存在
   	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
   	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
   	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
   	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
   	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)
   	at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.createReplicationSlot(PostgresReplicationConnection.java:394)
   	at org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.PostgresSourceFetchTaskContext.configure(PostgresSourceFetchTaskContext.java:212)
   	... 11 more
   
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:258)
   	... 2 more
    
   2026-06-02 10:20:57,228 ERROR [o.a.s.c.s.SeaTunnel           ] [main] - 
   ===============================================================================
   
   
   
   Exception in thread "main" org.apache.seatunnel.core.starter.exception.CommandExecuteException: SeaTunnel job executed failed
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:266)
   	at org.apache.seatunnel.core.starter.SeaTunnel.run(SeaTunnel.java:40)
   	at org.apache.seatunnel.core.starter.seatunnel.SeaTunnelClient.main(SeaTunnelClient.java:40)
   Caused by: org.apache.seatunnel.engine.common.exception.SeaTunnelEngineException: 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:165)
   	at org.apache.seatunnel.engine.server.task.SourceSeaTunnelTask.call(SourceSeaTunnelTask.java:132)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$BlockingWorker.run(TaskExecutionService.java:683)
   	at org.apache.seatunnel.engine.server.TaskExecutionService$NamedTaskWrapper.run(TaskExecutionService.java:1012)
   	at org.apache.seatunnel.api.tracing.MDCRunnable.run(MDCRunnable.java:43)
   	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
   	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
   	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
   	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   	at java.lang.Thread.run(Thread.java:750)
   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: io.debezium.DebeziumException: Creation of replication slot failed
   	at org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.PostgresSourceFetchTaskContext.configure(PostgresSourceFetchTaskContext.java:220)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.external.IncrementalSourceScanFetcher.submitTask(IncrementalSourceScanFetcher.java:85)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.checkSplitOrStartNext(IncrementalSourceSplitReader.java:186)
   	at org.apache.seatunnel.connectors.cdc.base.source.reader.IncrementalSourceSplitReader.fetch(IncrementalSourceSplitReader.java:84)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.FetchTask.run(FetchTask.java:54)
   	at org.apache.seatunnel.connectors.seatunnel.common.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:162)
   	... 6 more
   Caused by: org.postgresql.util.PSQLException: 错误: 复制槽名 "seatunnel" 已经存在
   	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
   	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
   	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
   	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:333)
   	at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:319)
   	at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:295)
   	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:290)
   	at io.debezium.connector.postgresql.connection.PostgresReplicationConnection.createReplicationSlot(PostgresReplicationConnection.java:394)
   	at org.apache.seatunnel.connectors.seatunnel.cdc.postgres.source.reader.PostgresSourceFetchTaskContext.configure(PostgresSourceFetchTaskContext.java:212)
   	... 11 more
   
   	at org.apache.seatunnel.core.starter.seatunnel.command.ClientExecuteCommand.execute(ClientExecuteCommand.java:258)
   	... 2 more
   2026-06-02 10:20:57,229 INFO  [s.c.s.s.c.ClientExecuteCommand] [SeaTunnel-CompletableFuture-Thread-0] - run shutdown hook because get close signal
   root@yyy:/app/seatunnel/apache-seatunnel-2.3.13#
   ```
   
   ### Zeta or Flink or Spark Version
   
   _No response_
   
   ### Java or Scala Version
   
   java1.8
   
   ### Screenshots
   
   _No response_
   
   ### 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-unsubscribe@seatunnel.apache.org.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo closed issue #10992: Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13
URL: https://github.com/apache/seatunnel/issues/10992


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-6376366371

   Closing this issue as completed after rechecking the original report and its resolution.
   
   The PostgreSQL CDC duplicate-slot path now uses SQLSTATE `42710` rather than depending on the English words "already exists". It therefore handles the localized duplicate-slot exception shown in this thread.
   
   Resolution evidence:
   
   - [PR #10416](https://github.com/apache/seatunnel/pull/10416), merged into `dev` on 2026-03-02 ([merge commit `b4a284ccc6d8`](https://github.com/apache/seatunnel/commit/b4a284ccc6d819e4f285f6d23b8a6b7f6ae8679f)).
   - [PR #11380](https://github.com/apache/seatunnel/pull/11380), merged into `dev` on 2026-07-25 ([merge commit `ddcc764d2099`](https://github.com/apache/seatunnel/commit/ddcc764d209979b9968b5ae9b062041ed341bd43)).
   
   The corresponding implementation remains present in [`dev` at `14a27ac26a0a`](https://github.com/apache/seatunnel/commit/14a27ac26a0a71b56722f86cdf8ec2779094ceaf).
   
   This closes the locale-sensitive duplicate-slot handling defect. PostgreSQL replication prerequisites and genuinely conflicting slot ownership still need valid configuration.
   
   <!-- seatunnel-closure-audit:20261023:10992 -->


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Apache SeaTunnel 3.13版本,pg-cdc使用initial模式复制槽创建失败 [seatunnel]

Posted by "yyy-yyy1596936 (via GitHub)" <gi...@apache.org>.
yyy-yyy1596936 commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-4598500380

   这个问题不知道怎么触发的,我在另一太服务器使用同样版本并没有这个问题


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-4931030156

   I checked the current `dev` branch again, and this specific locale-sensitive path does not look unresolved there anymore.
   
   As of July 10, 2026, the PostgreSQL CDC slot-creation path in `PostgresSourceFetchTaskContext` is already checking SQLSTATE `42710` directly instead of relying only on the English error text. That means the failure mode discussed earlier here — localized PostgreSQL messages causing the duplicate-slot path to be treated as an exception — should now be handled correctly in `dev`.
   
   So the issue is best understood as:
   - a real bug in released versions affected by the old detection path, but
   - likely fixed already in the current `dev` branch.
   
   This appears aligned with the logic now present in PR #10416's code path, even though the earlier discussion here referenced PR #11166 as the candidate fix direction.
   
   If possible, please verify against:
   - the latest `dev` branch build, or
   - the next release that includes the current `dev` branch change
   
   If it still reproduces there, please update this thread with the new logs and config, and we can continue from that point.


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-5155772150

   The pasted error log is truncated. Could you attach the full stack trace (including the root cause, e.g. the PostgreSQL error message about the replication slot) so we can confirm this matches the known issue?
   
   This issue is labeled fixed-in-dev. Could you try the latest dev branch (or a nightly build) and confirm whether the replication slot creation succeeds with your config?
   
   As a sanity check, please confirm the PostgreSQL prerequisites: wal_level=logical, max_replication_slots > 0, and that the 'postgres' user has REPLICATION privilege. Also verify whether a slot name conflict occurs when multiple jobs use the default slot name — setting a unique 'slot.name' in the Postgres-CDC source may work around the problem.
   
   <!-- streview-comment:40 -->


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-4774585839

   There is now a concrete fix in progress for this path: PR #11166.
   
   After the latest code check and reproduction notes, the problem no longer looks like an `initial`-mode logic bug by itself. The failing path is that Postgres CDC currently treats the duplicate-slot case too narrowly when PostgreSQL returns a localized server message, even though the SQLSTATE is still the same duplicate-object code (`42710`).
   
   The open PR changes that detection to rely on SQLSTATE first, with the old English-text match kept only as a fallback. That is the right direction because it makes the behavior independent from the database server locale.
   
   If you have time, please keep an eye on PR #11166 and verify against that patch once it is available in `dev`. If it still reproduces after that, please update this thread with the new logs and we can continue from there.


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "SEZ9 (via GitHub)" <gi...@apache.org>.
SEZ9 commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-5162460049

   The provided error log is truncated. Could you attach the full stack trace (the complete exception chain from the server/job logs), so we can confirm the root cause of the replication slot creation failure?
   
   Could you verify the PostgreSQL prerequisites: wal_level=logical, sufficient max_replication_slots/max_wal_senders, and that the 'postgres' user has REPLICATION privilege? Also confirm whether a slot name conflict occurs when the job retries.
   
   This issue is labeled fixed-in-dev. Could you try building from the dev branch (or the next release once available) and confirm whether the replication slot creation succeeds in initial mode?
   
   <!-- streview-comment:42 -->


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-4608235727

   I checked the Postgres CDC config path, and this does not look like an `initial`-mode bug by itself.
   
   The important detail is that the connector defaults `slot.name` to `seatunnel` when it is not explicitly configured. In your config, `slot.name` is not set, and the PostgreSQL-side error is exactly:
   - replication slot `seatunnel` already exists
   
   So the first thing to try is setting a distinct slot name explicitly, for example:
   
   ```hocon
   slot.name = "seatunnel_baf_aux_ds_01"
   ```
   
   Then please recheck with:
   
   ```sql
   select slot_name, database, plugin, active from pg_replication_slots;
   ```
   
   The reason I am leaning away from a framework bug is that you also mentioned the same version works on another server. That points more toward environment / instance state than toward a deterministic code-path problem.
   
   If it still reproduces after using a unique `slot.name`, please share:
   1. the full `pg_replication_slots` query result before startup
   2. whether another connector on the same PostgreSQL instance is also using the default `seatunnel` slot
   3. the PostgreSQL server log around the failed slot-creation attempt
   
   With that information we can determine whether there is still a connector-side issue to fix.


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "LeonYoah (via GitHub)" <gi...@apache.org>.
LeonYoah commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-4766363631

   One detail here may explain why it only reproduces on one server.
   
   The PostgreSQL error returned through the JDBC driver is localized in Chinese:
   
   ```text
   错误: 复制槽名 "seatunnel" 已经存在
   ```
   
   Is this PostgreSQL server running with Chinese locale settings, for example `lc_messages`, or a localized PostgreSQL build? The JDBC driver is likely just forwarding the server-side error text.
   
   This may matter because SeaTunnel currently detects duplicate replication slot creation by matching the English message text:
   
   [`PostgresSourceFetchTaskContext.java#L215`](https://github.com/apache/seatunnel/blob/2.3.13-release/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/reader/PostgresSourceFetchTaskContext.java#L215)
   
   ```java
   if (ex.getMessage().contains("already exists")) {
   ```
   
   In an English PostgreSQL environment, this path can be recognized and only logged as a warning. In a Chinese PostgreSQL environment, the message is `已经存在`, so the check does not match, and the exception is thrown here:
   
   [`PostgresSourceFetchTaskContext.java#L220`](https://github.com/apache/seatunnel/blob/2.3.13-release/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/source/reader/PostgresSourceFetchTaskContext.java#L220)
   
   So this may not be an `initial` startup-mode issue itself. It looks more like the duplicate-slot handling is locale-sensitive. A safer fix would be to check the PostgreSQL SQLSTATE for duplicate object (`42710`) instead of checking the localized message text.
   
   As a workaround, please set an explicit unique `slot.name`, for example:
   
   ```hocon
   slot.name = "seatunnel_baf_aux_ds_01"
   ```
   
   and verify the environment and slot state with:
   
   ```sql
   show lc_messages;
   select slot_name, database, plugin, active, active_pid from pg_replication_slots;
   ```
   


-- 
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-unsubscribe@seatunnel.apache.org

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


Re: [I] Failed to create replication slot when using the initial mode for pg-cdc in Apache SeaTunnel 3.13 [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10992:
URL: https://github.com/apache/seatunnel/issues/10992#issuecomment-5154871461

   Thanks for keeping this report open.
   
   The current `dev` branch already contains the locale-independent duplicate-slot handling described in the earlier maintainer update, so this thread now looks like a verification follow-up rather than an unresolved current-`dev` bug.
   
   If you have already verified this on a recent `dev` build, or on a release that includes that fix, and the problem is no longer reproducible, please close this issue.
   
   If it still reproduces, please reply with:
   
   1. the exact SeaTunnel version or commit;
   2. `show lc_messages;`
   3. `select slot_name, database, plugin, active, active_pid from pg_replication_slots;`
   4. the PostgreSQL server log around the slot-creation attempt.
   
   With that current evidence, we can quickly tell whether this is still the same path or a different regression.
   


-- 
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-unsubscribe@seatunnel.apache.org

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