Skip to content
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

[fix][broker] Fix consumers are not redirected to migrated cluster #20928

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

vineeth1995
Copy link
Contributor

@vineeth1995 vineeth1995 commented Aug 3, 2023

Motivation

Right now, when we mark topic migrated during blue-green cluster migration then broker disconnects consumers of the subscriptions once it reaches end of managed-leger data and consumer will be redirected to green cluster. However, if consumer is connected to topic without any backlog then consumer stays connected and broker didn't trigger consumer migration. Therefore, this PR makes sure that all the consumers of subscriptions which are not having backlog will be migrated and broker also checks topic migration when new consumer connects and notifies those consumers immediately if there is no backlog on that subscription.

Modifications

  1. Add a function "checkAndApplyTopicMigration" to check and disconnect consumers if subscription is already migrated under Consumer.java.
  2. Call the function in checkClusterMigration() periodic job in PersistentTopic.java
  3. Call the function in ServerCnx.java when new consumer tries to connect.

Verifying this change

This change added tests and can be verified as follows:

Added unit tests to verify the change

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

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

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Aug 3, 2023
@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

3 similar comments
@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

4 similar comments
@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@vineeth1995
Copy link
Contributor Author

/pulsarbot run-failure-checks

@rdhabalia rdhabalia merged commit 4a9fec6 into apache:master Aug 18, 2023
@Technoboy- Technoboy- added this to the 3.2.0 milestone Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/broker doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants