kafka-connect-jdbc icon indicating copy to clipboard operation
kafka-connect-jdbc copied to clipboard

Support Postgres partitioned table #1092

Open timtebeek opened this issue 2 years ago • 7 comments

Problem

Postgres partitioned tables are not supported after this change in the driver.

#1092

Solution

Map PARTITIONED TABLE as a valid value; not yet enabled by default, although that could be added still.

Does this solution apply anywhere else?
  • [ ] yes
  • [x] no

Test Strategy

Testing done:
  • [x] Unit tests
  • [x] Integration tests
  • [ ] System tests
  • [ ] Manual tests

Release Plan

? Merge to master I guess; no plans for backports unless specifically requested.

timtebeek avatar Jan 19 '22 15:01 timtebeek

As indicated I've not (yet) run a test using this branch as a plugin in kafka-connect. If this has a chance of getting merged soon-ish I could look into further manual testing.

timtebeek avatar Jan 19 '22 15:01 timtebeek

@ddasarathan (or anyone else) would you mind reviewing this pull request?

timtebeek avatar Feb 25 '22 14:02 timtebeek

Any updates on this issue? We would like to see this code merged as we currently are forced to use version 42.2.10 of the driver which contains a few reported security vulnerabilities, including:

  • https://access.redhat.com/security/cve/CVE-2022-26520
  • https://access.redhat.com/security/cve/CVE-2020-13692
  • https://access.redhat.com/security/cve/CVE-2022-21724 If we can provide any assistance with testing or anything else please let me know. Thanks!

steveratay avatar Jun 17 '22 12:06 steveratay

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 17 '22 13:06 CLAassistant

I've not yet tested this, as I had been waiting for any kind of response from Confluent before I spend more effort on this. If you're willing and able to test these changes that should at least give more confidence for a merge if Confluent get involved. And any feedback on whether partitioned tables should be support by default would be appreciated as well.

I just merged any changes from master into my branch https://github.com/confluentinc/kafka-connect-jdbc/pull/1156/commits/a7190c9ac0d399bd65bea84c7c56df65c82178e5 & signed the CLA.

timtebeek avatar Jun 17 '22 13:06 timtebeek

We are also facing the same issue partition table with postgresql-42.3.3.jar and with io.confluent:kafka-connect-jdbc:10.4.0?

Any plan to merge this one?

kotharironak avatar Jun 24 '22 07:06 kotharironak

@sagarrao12 I've added a PostgresPartitionedIT. Could you help update the docs to see this through?

timtebeek avatar Jul 23 '22 16:07 timtebeek

@rajdangwal or @sagarrao12 could either of you review and help finish this one?

timtebeek avatar Aug 15 '22 17:08 timtebeek

Any news when this could be merged? Would be great if it can be fixed this week as we are going live next week

beer1970 avatar Aug 25 '22 13:08 beer1970

indeed that would be great, that took me a while to find out the error I have was due to this bug.

sgandon avatar Sep 15 '22 06:09 sgandon

Thanks for the changes @timtebeek

sagarrao12 avatar Sep 22 '22 16:09 sagarrao12

Awesome, glad to see this merged. Any hints on how to activate the property?

timtebeek avatar Sep 22 '22 16:09 timtebeek

Great, thanks for the work. It will help us remove an abominable hack.

mdespriee avatar Sep 23 '22 11:09 mdespriee

Awesome, glad to see this merged. Any hints on how to activate the property?

I suppose it would be table.types: PARTITIONED_TABLE,TABLE

but it gives the error

message: |- PUT /connectors/vmaas-vlog-dev-jdbc-sink/config returned 400 (Bad Request): Connector configuration is invalid and contains the following 1 error(s): Invalid value PARTITIONED_TABLE for configuration table.types: Invalid enumerator You can also find the above list of errors at the endpoint/connector-plugins/{connectorType}/config/validate

beer1970 avatar Sep 27 '22 13:09 beer1970

@beer1970 From what I can see we still have a wait for a 10.6.0 release, as the latest is still 10.5.2.

@rajdangwal did a couple of releases two days ago, but no release yet of either 10.5.x or 10.6.x. When can we expect those?

timtebeek avatar Sep 29 '22 13:09 timtebeek

@beer1970 There's a new confluentinc/kafka-connect-jdbc:10.6.0 release that you can try as well; I managed to deploy my connectors with "table.types": "PARTITIONED TABLE,TABLE" as configuration. Note how its using a space rather than underscore, as opposed to your error above. Still waiting to see if records will get pushed through to the partitioned table :crossed_fingers:.

timtebeek avatar Oct 24 '22 15:10 timtebeek

have you resolve it ? i meet same problem kafka-connect-jdbc-10.5.3.jar postgresql-42.3.3.jar, configure "table.types":"PARTITIONED TABLE,TABLE"

heimohe avatar Nov 26 '22 06:11 heimohe

Upgrade to 10.6.0 and it all worked for me.

timtebeek avatar Nov 26 '22 10:11 timtebeek