Ohara: Use wk as the connect worker name will produce a different name

Created on 10 May 2019  ·  11Comments  ·  Source: oharastream/ohara

Describe the bug

_Note that this behavior can only be reproduced in k8s mode_

Normally, when creating a new connect worker, the user supplied worker names should be returned after a successful request call. For example:

Given a request like this:

POST /v0/workers

clientPort: null
jars: []
name: "myawesomeworker"
nodeNames: ["ohara-dev-103"]

The response will include the supplied name from the above request we just made

imageName: "oharastream/connect-worker:0.4-SNAPSHOT"
jarIds: []
jarNames: []
jarUrls: []
jmxPort: 8084
name: "myawesomeworker"
...

When using __wk__ as the connect worker name, the response from the API will be __wk__, but when fetching the worker list with GET /v0/workers. The worker name will be __"k8soccl"__

To Reproduce
This can be repro with our web UI

  • Prepare necessary configurator, manager, zookeeper and broker services.
  • And in our UI, go to services page and click on the _New cluster_ button
  • Use __wk__ as the name, and fill out the form with normal data. Then hit the add button
  • The newly created connect worker name will be __"k8soccl"__

Expected behavior
The worker names return from GET /v0/workers should be the same from POST `/v0/workers/

Screenshots
Nope

Operation System (please complete the following information):
Services are running on CentOS
Manager is running on macOS

Additional context
Using other names as the connect worker's name won't produce the abovementioned result

bug v0.4.1 v0.6.0

All 11 comments

/cc @jackyoh

OK, 收到. 我再來研究就這個 issue

OK, 收到. 我再來研究就這個 issue

Updated the issue :)

This issue is due to the "parsing" logic problem on backend:

container.name.split(s"$DIVIDER${serviceName}$DIVIDER").head -> container

we use the wk as serviceName ; the above regrex will split the wrong part (the clusterName)

這個是 parser 字串的問題, 我再去解.

@saivirtue Thank you

這個 issue 沒有合併到 master, 重新 reopen 把 code 合併到 master

@jackyoh you will need to add 0.6.0 label to this issue :)

@jackyoh I'll need to add 0.6.0 label to this issue :)

我已經加入 0.6.0 的標籤了

@jackyoh 你推到master的PR是不是破壞了build? see https://builds.is-land.com.tw/job/PreCommit-OHARA/2940/

@jackyoh 你推到master的PR是不是破壞了build? see https://builds.is-land.com.tw/job/PreCommit-OHARA/2940/

我來研究看看

我剛才有測試過這個 commit id, 看起來 build 沒問題. 主要的問題是在 #1438, 在測試程式裡少傳一個參數
ping @saivirtue, 先 revert code 看是否可以 build code

Was this page helpful?
0 / 5 - 0 ratings