rdhabalia opened a new pull request, #20362:
URL: https://github.com/apache/pulsar/pull/20362
### Motivation
Right now, during blue-green cluster migration, broker sends redirect url of
green cluster to the client and producer/consumer tries to reconnect with new
URL to directly create producer or subscribe consumer without first even doing
lookup on green cluster and try to create producer/consumer on incorrect
broker. Therefore, incorrect green broker fails producer/consumer creation as
that broker doesn't own the namespace or topic and gives below error to
pulsar-client:
```
2023-05-16T18:23:16,859-0700 [pulsar-client-io-1-1] WARN
org.apache.pulsar.client.impl.ClientCnx -
[id: 0xb4862e31, L:/127.0.0.1:63224 - R:localhost/127.0.0.1:6652]
Received error from server: Namespace bundle for topic
(persistent://migration-test1/ns1/t1-2) not served by this instance. Please
redo the lookup. Request is denied: namespace=tenant/ns1
```
Therefore, once client gets disconnected from blue cluster and try to
connect to green cluster, client should first perform lookup on green cluster
which allows green cluster to assign topic ownership and redirect client to the
correct owner broker of that topic.
### Modifications
Fix client produce/consumer redirected-migration URL handling by performing
topic lookup and connecting to the correct broker to complete producer/consumer
creation.
### 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:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update
later -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: <!-- ENTER URL HERE -->
<!--
After opening this PR, the build in apache/pulsar will fail and instructions
will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since
the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed
in
a forked repository.
The tests will be run in the forked repository until all PR review comments
have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]