Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgsql 主从复制 的集群 如果主从切换了 CDC是不是就没办法了 只能手动改代码? #2419

Closed
1 of 2 tasks
JasonFang1993 opened this issue Aug 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@JasonFang1993
Copy link

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

pgsql 主从复制 的集群 如果主从切换了 CDC是不是就没办法了 只能手动改代码? 希望能支持这种情况

Solution

No response

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@JasonFang1993 JasonFang1993 added the enhancement New feature or request label Aug 22, 2023
@wallkop
Copy link
Contributor

wallkop commented Aug 24, 2023

My personal opinion is that this should not be supported by the CDC.
Master-slave switching is the behavior of the database itself. Users should develop peripheral programs for automatic monitoring, such as using timed tasks or notification mechanisms.

@loserwang1024
Copy link
Contributor

Hi, @JasonFang1993 , See https://debezium.io/documentation/reference/connectors/postgresql.html#how-the-postgresql-connector-works
Logical decoding replication slots are supported on only primary servers When there is a cluster of PostgreSQL servers, the connector can run on only the active primary server. It cannot run on hot or warm standby replicas. If the primary server fails or is demoted, the connector stops. After the primary server has recovered, you can restart the connector. If a different PostgreSQL server has been promoted to primary, adjust the connector configuration before restarting the connector.

It's the limitation of the mechanism of the postgresql database itself. Now that only primary servers has logical decoding replication slots, postgres cdc can do nothing without replication slot

@loserwang1024
Copy link
Contributor

Hi, @JasonFang1993 , from pg16, can read replication data from slave databse, and we also upgrade version of debezium to support it, SEE #3034.

Please closing this issue as it is no longer valid or requires additional information. If the issue still exists, please report it on Apache Jira under the project Flink, using the component tag Flink CDC. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants