timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.73k stars 885 forks source link

support for debezium postgresql connector #2073

Open young118 opened 4 years ago

young118 commented 4 years ago

Does timescaledb hypertable support logical replication? I want to use debezium postgresql connector with kafka connect to monitor database change events. It works with postgresql, but not with timescaledb, I don't know why, could you offer me some infomation? Thanks

majun9129 commented 4 years ago

I have the same problem. I've tried a lot of versions and a lot of different approaches, but they don't work. Some error messages: Error while fetching metadata with correlation id 1 : {fullfillment._timescaledb_internal._hyper_1_13_chunk=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient:882)

majun9129 commented 4 years ago

Get some answer:

  1. Postgresql Replication is only possible from base tables to base tables. That is, the tables on the publication and on the subscription side must be normal tables, not views, materialized views, partition root tables, or foreign tables. In the case of partitions, you can therefore replicate a partition hierarchy one-to-one, but you cannot currently replicate to a differently partitioned setup. Attempts to replicate tables other than base tables will result in an error. https://www.postgresql.org/docs/12/logical-replication-restrictions.html
  2. TimescaleDB Logical replication only replicates DML events, not DDL changes, and are mapped to specific tables. Unfortunately, TimescaleDB is built around automated chunk creation — inserting a row can lead to the creation of a new chunk. But your logical replication is not “listening” on that new chunk, and that chunk creation isn’t pushed out the logical replication stream. Hope help.
canelhasmateus commented 2 years ago

Any news about this issue? How one would go about improving things in this front?