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

Unload bundle: close topic forcefully and enable bundle on ownership removal failure #164

Merged
merged 1 commit into from
Jan 20, 2017

Conversation

rdhabalia
Copy link
Contributor

Motivation

while unloading namespace bundle if topic.close() fails then bundle gets stuck by staying in disable state. Therefore, unload bundle should close topic forcefully and failure in deletion of bundle-ownership node should revert bundle state to enable back so, it can serve new topics again.

Modifications

  • close topic forcefully while unloading namespace bundle
  • enable namespace bundle if unloading namespace fails

Result

bundle will not be in stuck state in case of failure in unloading namespace bundle.

@yahoocla
Copy link

CLA is valid!

2 similar comments
@yahoocla
Copy link

CLA is valid!

@yahoocla
Copy link

CLA is valid!

@rdhabalia rdhabalia added the type/bug The PR fixed a bug or issue reported a bug label Jan 11, 2017
@rdhabalia rdhabalia added this to the 1.16 milestone Jan 11, 2017
@rdhabalia rdhabalia self-assigned this Jan 11, 2017
@rdhabalia rdhabalia changed the title Unload bundle: close topic forcefully and enable bundle on ownership removal Unload bundle: close topic forcefully and enable bundle on ownership removal failure Jan 11, 2017
@rdhabalia
Copy link
Contributor Author

@merlimat can you also please take a look of this PR.

@rdhabalia
Copy link
Contributor Author

@saandrews @merlimat : can you please review this PR.

@saandrews
Copy link
Contributor

👍

@@ -101,16 +101,29 @@ public void handleUnloadRequest(PulsarService pulsar) throws Exception {
this.nsLock.writeLock().unlock();
}

int unloadedTopics = 0;
int unloadedTopics = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

-1 is a bit confusing here

try {
unloadedTopics = pulsar.getBrokerService().unloadServiceUnit(bundle).get();
} catch (Exception e) {
// ignore topic-close failure to unload bundle
Copy link
Contributor

Choose a reason for hiding this comment

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

We should also make sure the MLs are removed from the ML factory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

while closing the topic we disconnects producers, subscribers and replicator and if it is successful then we remove it from the MLFactory immediately.
Disconnecting prod,sub,repl should be clean but if not for one of the topic then additionally we can schedule a retry only for unloading-bundle : if there was a failure while closing any topic and if we successfully remove the ownership-node later.
any thought?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was saying to verify that ML.close() will remove the ML from the factory even in the presence of errors. Errors could happen when closing the cursor or closing the last data ledger.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, ML.close() removes ML from MLFactory first and then tries to close ledger the cursors.

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

👍

@rdhabalia rdhabalia merged commit 8818eea into apache:master Jan 20, 2017
@rdhabalia rdhabalia deleted the unload0 branch January 23, 2017 22:00
sijie added a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
Bumps `log4j2.version` from 2.10.0 to 2.13.3.
Updates `log4j-core` from 2.10.0 to 2.13.3

Updates `log4j-slf4j-impl` from 2.10.0 to 2.13.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

4 participants