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

Close the replicator and replication client when delete cluster. #11342

Merged
merged 3 commits into from
Jul 19, 2021

Conversation

codelipenghui
Copy link
Contributor

Motivation

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

Verifying this change

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.

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

This is a bug fix, no need documentation.

Currently, when a cluster been deleted, the replicator and the replication client will not been closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and cleanup the replicator and the replication client for the deleted cluster.
@codelipenghui codelipenghui self-assigned this Jul 16, 2021
@codelipenghui codelipenghui added this to the 2.9.0 milestone Jul 16, 2021
@codelipenghui codelipenghui added release/2.7.3 release/2.8.1 type/bug The PR fixed a bug or issue reported a bug release/2.7.4 and removed release/2.7.3 labels Jul 16, 2021
if (ot.isPresent()) {
Replicator r = ot.get().getReplicators().get(clusterName);
if (r != null && r.isConnected()) {
r.disconnect(true).whenComplete((v, e) -> f.complete(null));
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we should let failIfHasBacklog=false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, changed to false.

@codelipenghui codelipenghui requested a review from 315157973 July 18, 2021 15:03
Copy link
Contributor

@315157973 315157973 left a comment

Choose a reason for hiding this comment

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

LGTM

@sijie sijie merged commit 8a4147e into apache:master Jul 19, 2021
@codelipenghui codelipenghui deleted the penghui/close-replication-client branch July 19, 2021 06:36
Technoboy- added a commit to Technoboy-/pulsar that referenced this pull request Jul 20, 2021
Technoboy- added a commit to Technoboy-/pulsar that referenced this pull request Jul 21, 2021
Technoboy- pushed a commit to Technoboy-/pulsar that referenced this pull request Jul 22, 2021
…che#11342)

### Motivation

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

### Verifying this change

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.
codelipenghui pushed a commit that referenced this pull request Jul 23, 2021
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jul 23, 2021
codelipenghui added a commit that referenced this pull request Jul 23, 2021
)

### Motivation

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

### Verifying this change

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.

(cherry picked from commit 8a4147e)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jul 23, 2021
lhotari pushed a commit to datastax/pulsar that referenced this pull request Feb 8, 2022
…che#11342)

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.

(cherry picked from commit 8a4147e)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Feb 28, 2022
…che#11342)

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.

(cherry picked from commit 8a4147e)
(cherry picked from commit 60d462a)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…che#11342)

### Motivation

Currently, when a cluster has been deleted, the replicator and the replication client will not be closed.
The producer of the replicator will try to reconnect to the deleted cluster continuously.
We should close and clean up the replicator and the replication client for the deleted cluster.

### Verifying this change

A new test was added for verifying the replicator and the replication client will be closed after the cluster is deleted.
@codelipenghui codelipenghui restored the penghui/close-replication-client branch May 17, 2022 01:21
@codelipenghui codelipenghui deleted the penghui/close-replication-client branch May 17, 2022 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.7 Archived: 2.7 is end of life cherry-picked/branch-2.8 Archived: 2.8 is end of life release/2.7.4 release/2.8.1 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants