You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/07 23:53:12 UTC
[GitHub] [pulsar] rdhabalia opened a new pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
rdhabalia opened a new pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473
### Motivation
We are having frequent issues when user removes cluster from the global namespace where broker from removed-cluster fails to unload topic and namespace bundle still loaded with the broker. It happens when broker from removed-cluster receives below error
```
17:38:52.199 [pulsar-io-22-28] ERROR org.apache.pulsar.broker.service.persistent.PersistentReplicator - [persistent://prop/global/ns/tp1][east -> west] Failed to close dispatch rate limiter: org.apache.pulsar.client.api.PulsarClientException: Producer was not registered on the connection
:
17:38:52.199 [pulsar-io-22-28] WARN org.apache.pulsar.broker.service.AbstractReplicator - [persistent://prop/global/ns/tp1][east -> west]] Exception: 'org.apache.pulsar.client.api.PulsarClientException: Producer was not registered on the connection' occured while trying to close the producer. retrying again in 0.1 s
:
17:38:52.351 [pulsar-io-22-37] ERROR org.apache.pulsar.broker.service.persistent.PersistentTopic - [persistent://prop/global/ns/tp1] Error closing topic
java.util.concurrent.CompletionException: org.apache.pulsar.client.api.PulsarClientException: Producer was not registered on the connection
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331) ~[?:?]
```
### Modification
Source Broker should return explicit error-code when producer is already closed and dest-broker from removed-cluster should handle this error and clean up the replicator and topic gracefully.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] rdhabalia commented on pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
rdhabalia commented on pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473#issuecomment-655206225
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] merlimat merged pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
merlimat merged pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] rdhabalia commented on a change in pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
rdhabalia commented on a change in pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473#discussion_r451810264
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
##########
@@ -760,11 +761,13 @@ private void checkReplicatedSubscriptionMarker(Position position, MessageImpl<?>
final CompletableFuture<Void> future = new CompletableFuture<>();
super.disconnect(failIfHasBacklog).thenRun(() -> {
- dispatchRateLimiter.ifPresent(DispatchRateLimiter::close);
- future.complete(null);
+ cleanAfterDisconnect(future);
}).exceptionally(ex -> {
Throwable t = (ex instanceof CompletionException ? ex.getCause() : ex);
- if (t instanceof TopicBusyException == false) {
+ if (t instanceof AlreadyClosedException) {
+ cleanAfterDisconnect(future);
Review comment:
@merlimat Yes, I don't see any issue by returning success on non-existing producer or consumer. I made that change. Can you please review it again.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] rdhabalia commented on pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
rdhabalia commented on pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473#issuecomment-656965741
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] merlimat commented on a change in pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
merlimat commented on a change in pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473#discussion_r451586412
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentReplicator.java
##########
@@ -760,11 +761,13 @@ private void checkReplicatedSubscriptionMarker(Position position, MessageImpl<?>
final CompletableFuture<Void> future = new CompletableFuture<>();
super.disconnect(failIfHasBacklog).thenRun(() -> {
- dispatchRateLimiter.ifPresent(DispatchRateLimiter::close);
- future.complete(null);
+ cleanAfterDisconnect(future);
}).exceptionally(ex -> {
Throwable t = (ex instanceof CompletionException ? ex.getCause() : ex);
- if (t instanceof TopicBusyException == false) {
+ if (t instanceof AlreadyClosedException) {
+ cleanAfterDisconnect(future);
Review comment:
Since we're treating it as a "success" case here, another option would be to have the close request to return "ok" when closing a non-existing producer. what do you think?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #7473: [pulsar-broker] Cleanup already deleted namespace topics
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #7473:
URL: https://github.com/apache/pulsar/pull/7473#issuecomment-655513948
/pulsarbot run-failure-checks
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org