Skip to content

Conversation

@ericsyh
Copy link
Contributor

@ericsyh ericsyh commented Mar 8, 2022

Signed-off-by: Eric Shen ericshenyuhao@outlook.com

Motivation

The YAML sample of debezium mysql source missing a config of pulsar.service.url on io-debezium-source

Modifications

Add the missing config of pulsar.service.url

Verifying this change

  • Make sure that the change passes the CI checks.

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (10MB)
  • Extended integration test for recovery after broker failure

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below or label this PR directly (if you have committer privilege).

Need to update docs?

  • doc-required

    (If you need help on updating docs, create a doc issue)

  • no-need-doc

    (Please explain why)

  • doc

    (If this PR contains doc changes)

Signed-off-by: Eric Shen <ericshenyuhao@outlook.com>
@github-actions github-actions bot added the doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. label Mar 8, 2022
Copy link
Member

@nodece nodece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

database.history.pulsar.topic: "history-topic"
database.history.pulsar.service.url: "pulsar://127.0.0.1:6650"

pulsar.service.url: "pulsar://127.0.0.1:6650"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find any code to read pulsar.service.url, could you provide this code? The database.history.pulsar.service.url is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i just checked the code and also not found the pulsar.service.url. In my test i used the sample YAML on https://pulsar.apache.org/docs/en/io-debezium-source/#configuration-1 but functions gave me an ERROR about the missing config of pulsar.service.url then i noticed the following sample

bin/pulsar-admin source localrun \
--archive connectors/pulsar-io-debezium-mysql-2.9.1.nar \
--name debezium-mysql-source --destination-topic-name debezium-mysql-topic \
--tenant public \
--namespace default \
--source-config '{"database.hostname": "localhost","database.port": "3306","database.user": "debezium","database.password": "dbz","database.server.id": "184054","database.server.name": "dbserver1","database.whitelist": "inventory","database.history": "org.apache.pulsar.io.debezium.PulsarDatabaseHistory","database.history.pulsar.topic": "history-topic","database.history.pulsar.service.url": "pulsar://127.0.0.1:6650","key.converter": "org.apache.kafka.connect.json.JsonConverter","value.converter": "org.apache.kafka.connect.json.JsonConverter","pulsar.service.url": "pulsar://127.0.0.1:6650","offset.storage.topic": "offset-topic"}'

Used the config of "pulsar.service.url": "pulsar://127.0.0.1:6650" and i also added it then passed the test.

I will do the test again to verify it.

Copy link
Member

@nodece nodece left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a comment.

@gaoran10
Copy link
Contributor

gaoran10 commented Mar 8, 2022

Could you provide the error logs?

@ericsyh
Copy link
Contributor Author

ericsyh commented Mar 8, 2022

@gaoran10 @nodece Pulsar and debezium-mysql uses 2.8.1, the ERROR from functions is like below:

13:59:00.824 [public/default/debezium-mysql-source-0] ERROR org.apache.pulsar.functions.instance.JavaInstanceRunnable - Source open produced uncaught exception:
java.lang.IllegalArgumentException: Pulsar service URL not provided.
        at org.apache.pulsar.io.debezium.DebeziumSource.open(DebeziumSource.java:84) ~[pulsar-io-debezium-core-2.8.1.jar:2.8.1]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setupInput(JavaInstanceRunnable.java:735) [org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setup(JavaInstanceRunnable.java:219) [org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:243) [org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]
13:59:00.829 [public/default/debezium-mysql-source-0] ERROR org.apache.pulsar.functions.instance.JavaInstanceRunnable - [public/default/debezium-mysql-source:0] Uncaught exception in Java Instance
java.lang.IllegalArgumentException: Pulsar service URL not provided.
        at org.apache.pulsar.io.debezium.DebeziumSource.open(DebeziumSource.java:84) ~[?:?]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setupInput(JavaInstanceRunnable.java:735) ~[org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.setup(JavaInstanceRunnable.java:219) ~[org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:243) [org.apache.pulsar-pulsar-functions-instance-2.8.1.jar:?]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292]

The mysql.yaml config file is

tenant: "public"
namespace: "default"
name: "debezium-mysql-source"
topicName: "debezium-mysql-topic"
archive: "connectors/pulsar-io-debezium-mysql-2.8.1.nar"
parallelism: 1

configs:
    ## config for mysql, docker image: debezium/example-mysql:0.8
    database.hostname: "x.x.x.x"
    database.port: "3306"
    database.user: "ericsyh"
    database.password: "x.x.x.x.x.x"
    database.server.id: "1840"
    database.server.name: "streamnative"
    database.whitelist: "pulsar"
    database.history: "org.apache.pulsar.io.debezium.PulsarDatabaseHistory"
    database.history.pulsar.topic: "history-topic"
    database.history.pulsar.service.url: "pulsar://127.0.0.1:6650"
    ## KEY_CONVERTER_CLASS_CONFIG, VALUE_CONVERTER_CLASS_CONFIG
    key.converter: "org.apache.kafka.connect.json.JsonConverter"
    value.converter: "org.apache.kafka.connect.json.JsonConverter"

    ## OFFSET_STORAGE_TOPIC_CONFIG
    offset.storage.topic: "offset-topic"

The status for the sources

{
  "numInstances" : 1,
  "numRunning" : 0,
  "instances" : [ {
    "instanceId" : 0,
    "status" : {
      "running" : false,
      "error" : "UNAVAILABLE: io exception",
      "numRestarts" : 0,
      "numReceivedFromSource" : 0,
      "numSystemExceptions" : 0,
      "latestSystemExceptions" : [ ],
      "numSourceExceptions" : 0,
      "latestSourceExceptions" : [ ],
      "numWritten" : 0,
      "lastReceivedTime" : 0,
      "workerId" : "standalone"
    }
  } ]
}

@gaoran10
Copy link
Contributor

gaoran10 commented Mar 8, 2022

It seems that there is a new configuration database.history.pulsar.service.url after 2.9.1. Please take a look at the PR #11251. Maybe you need to modify the docs before 2.9.1. Could you try to use the 2.9.1?

@ericsyh
Copy link
Contributor Author

ericsyh commented Mar 9, 2022

It seems that there is a new configuration database.history.pulsar.service.url after 2.9.1. Please take a look at the PR #11251. Maybe you need to modify the docs before 2.9.1. Could you try to use the 2.9.1?

OK, i will test in on 2.9.1 later. Now seems the problem is debezium connectors docs is not fully accurate, the database.history.pulsar.service.url config only apply for 2.9.x and previously version should still use pulsar.service.url. But previsou docs also change this to use database.history.pulsar.service.url config.

@nodece
Copy link
Member

nodece commented Mar 9, 2022

We can add a compatible for old configuration.

@github-actions
Copy link

github-actions bot commented Apr 9, 2022

The pr had no activity for 30 days, mark with Stale label.

@github-actions
Copy link

The pr had no activity for 30 days, mark with Stale label.

@tisonkun
Copy link
Member

tisonkun commented Dec 6, 2022

Closed as no consensus.

@tisonkun tisonkun closed this Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connector doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. lifecycle/stale Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants