-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Configure DLog Bookie, Pulsar, and Admin clients via pass through config #15818
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
Configure DLog Bookie, Pulsar, and Admin clients via pass through config #15818
Conversation
dave2wave
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - nicely done!
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff
| } | ||
|
|
||
| @Override | ||
| public PulsarAdminBuilder loadConf(Map<String, Object> config) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great ! I have seen a few issues requesting this feature !
lhotari
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…fig (apache#15818) (cherry picked from commit aa67349) (cherry picked from commit d144f1e)
…fig (apache#15818) (cherry picked from commit aa67349) (cherry picked from commit d384076)
|
Hi @michaeljmarshall , thanks for updating the docs. I have a quick question regarding the label "release/2.10.1". The doc changes you made in this PR are not shown in 2.10/2.10.1 documentation, but only in the latest (master). Should they be synced to 2.10/2.10.1 doc or it's just mislabeled? BTW, there is something wrong with the table formatting. //cc @Anonymitaet |
|
@michaeljmarshall thanks for the clarification. |
|
@momo-jun - sure, I agree we could improve the process. This partially comes down to how we version docs. We could use some kind of |
…fig (apache#15818) (cherry picked from commit aa67349) (cherry picked from commit e5d035a)
…19674) ### Motivation When we merged #15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. ### Modifications * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` ### Verifying this change I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. ### Does this pull request potentially affect one of the following parts: This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. ### Documentation - [x] `doc-not-needed` Docs are automatically updated by these changes.
…19674) When we merged #15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3)
…19674) When we merged #15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3) (cherry picked from commit b8083b0)
…19674) When we merged #15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3) (cherry picked from commit b8083b0) (cherry picked from commit a3a242c)
…19674) When we merged #15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3) (cherry picked from commit b8083b0) (cherry picked from commit a3a242c) (cherry picked from commit c84c3b7)
…pache#19674) When we merged apache#15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3) (cherry picked from commit b8083b0) (cherry picked from commit a3a242c)
…pache#19674) When we merged apache#15818 in order to make the broker's client configurable, we did not add an explicit config for hostname verification. This PR adds that config to the broker and the websocket proxy. I chose the name `tlsHostnameVerificationEnabled` because that is what is already used in the proxy. It diverges from the function worker's config of `tlsEnableHostnameVerification`. Before this PR, you would have enabled hostname verification by configuring `brokerClient_tlsHostnameVerificationEnable=true` in the broker and WS proxy configs. (Note that the variable name is slightly different because the `ClientConfiguration` does not have a `d` at the end of its name. The remaining follow up work will be to update the `ClusterData` objects to configure hostname verification there to make it easier to configure hostname verification for remote clusters. * Add `tlsHostnameVerificationEnabled` to the `broker.conf` and the `proxy.conf` * Update all of the relevant locations that were previously only relying on `brokerClient_tlsHostnameVerificationEnable` I added a single test to ensure that the `WebSocketProxyConfiguration` properly converts to the `ServiceConfiguration` object. Otherwise, I verified that anywhere we are using `"brokerClient_"`, this PR also adds the right configuration. This PR introduces a "new" configuration key, but not a new concept. All underlying behaviors are unchanged. - [x] `doc-not-needed` Docs are automatically updated by these changes. (cherry picked from commit 6621fd3) (cherry picked from commit b8083b0) (cherry picked from commit a3a242c)

Motivation
The Pulsar broker, proxy, websocket proxy, and function worker each start several clients, including the Pulsar Client, the Pulsar Admin Client, and the Bookkeeper Client. Until now, there hasn't been an easy way to pass arbitrary configuration to these clients, which can cause problems. A recent example is the client memory limit that we fixed here: #15752. I propose that we enable pass through configuration for these clients, so that users can override any default configuration.
Enable pass through configuration support for the bookkeeper clients created by
DistributedLogandBookKeeperPackagesStorage. This support is already present for the managed ledger bookkeeper client, which takes allbookkeeper_prefixed configs. In order to simplify configuration, I reused thebookkeeper_prefix since it's reasonable to assume that these configs will be the same.Enable pass through configuration support for the broker clients using the
brokerClient_prefix. Note that setting this once affects all clients. I think this is ideal, but it could lead to some confusion. A good secondary feature might be to add another prefix that targets specific clients, like the replication client.Initially implemented as #15763, but instead of submitting many PRs, I am just submitting one larger one.
Modifications
brokerClient_. The Bookkeeper Client and the DLog Bookeeper Client take configuration starting withbookkeeper_.PropertiesUtilsclass to reduce code duplication for mapping prefixed properties to theMap<String, Object>PulsarAdminBuilder#loadConfmethod to the interface to match the same method in the Pulsar Client builder.BookKeeperPackagesStorageConfigurationto expose the underlyingpropertiesobject.broker.conf, theproxy.conf, thewebsocket.confand thefunctions_worker.ymlfiles.Verifying this change
I added several tests and also manually verified that the configuration overrides applied.
Alternative Implementation
I had initially wanted to run the override logic at the end of all other configuration. However, it doesn't work correctly because of the issue highlighted here #8509. It might be helpful to change the implementation of the
loadConflogic so that it doesn't serialize secrets as****.Does this pull request potentially affect one of the following parts:
This is a backwards compatible change. The only nuance is that the package management dlog bookie client will inherit the same configs that the broker already uses for the bookie client. I think this is preferable.