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

[Transaction] Guarantee transaction metadata handlers connect #8563

Merged

Conversation

gaoran10
Copy link
Contributor

Motivation

Currently, the transaction metadata handlers start with pulsar client start, but the handlers connect with the broker asynchronously, if the client restart, the metadata handler may not be available.

Modifications

Add the connection future for the metadata handler.

Verifying this change

This change added tests and can be verified as follows:

  • org.apache.pulsar.client.impl.TransactionEndToEndTest#txnMetadataHandlerRecoverTest

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)

});
} else {
return FutureUtil.failedFuture(new CoordinatorClientStateException("Can not start while current state is " + state));
}
}

private String getTCAssignTopicName(int partition) {
if (partition > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (partition > 0) {
if (partition >= 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll fix this.

@gaoran10
Copy link
Contributor Author

/pulsarbot run-failure-checks

1 similar comment
@gaoran10
Copy link
Contributor Author

/pulsarbot run-failure-checks

@codelipenghui codelipenghui merged commit 8394dca into apache:master Nov 14, 2020
@gaoran10 gaoran10 deleted the txn-metadata-handler-connect-guarantee branch November 14, 2020 08:09
@reswqa
Copy link
Member

reswqa commented Nov 14, 2020

Thanks @gaoran10 for fixing this problem so quickly, this is very valuable to me.

flowchartsman pushed a commit to flowchartsman/pulsar that referenced this pull request Nov 17, 2020
…#8563)

### Motivation

Currently, the transaction metadata handlers start with pulsar client start, but the handlers connect with the broker asynchronously, if the client restart, the metadata handler may not be available.

### Modifications

Add the connection future for the metadata handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants