-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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]No TransactionCoordinatorNotFound, but automatic reconnect #13135
Conversation
…ction ### Motivation we should not throw a TransactionCoordinatorNotFound to client. Beacuse that exception is a normal behavior. ### Modification Try the operation again when the client receives a TransactionCoordinatorNotFound.
2. add requestArgs 3. remove semaphore.release 4. add backoff in op
2. Split four opCallBack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should handle ManagedLedgerFenceException as the same as TCNotFoundException, because this exception, customer also don't need to know.
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
...-broker/src/test/java/org/apache/pulsar/broker/transaction/TransactionClientConnectTest.java
Outdated
Show resolved
Hide resolved
2. optimize recycle, safeRelease, cnx(), backoff 3. optimize test
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
…need to be try again. 2. modify Result.h, Result.cc, ClientConnection.cc
2. Improve code reuse
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
1. backoff 2. code reuse
1. optimize log 2. code reuse 3. fix Result.h by adding ,
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
2. clear map and add send check for connecting and cnx 3. optimize test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This work looks great.
But it is a big patch and also in includes a little wire protocol change.
What about the compatibility with 2.9 clients ?
would you like to discuss about this work on dev@pulsar.apache.org ?
this way the community will be more informed and everybody will be able to contribute to the review and the discussion
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionRetryTest.java
Outdated
Show resolved
Hide resolved
/pulsarbot run-failure-checks |
pulsar-broker/src/main/java/org/apache/pulsar/broker/TransactionMetadataStoreService.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/TransactionMetaStoreHandler.java
Outdated
Show resolved
Hide resolved
2. move TransactionClientConnectTest to the package: rg.apache.pulsar.client.impl
2. remove the judge of cnx = null 3. add canSendRequest
2. remove the judge of cnx = null 3. Extract the data of the deposit response
2. details
…ct (apache#13135) ### Motivation and Modification We should not throw the following exceptions to the user to deal with. 1. `TransactionCoordinatorNotFound` or `ManagerLedgerFenceException` --- we should retry the operation and reconnect to TC 2. `TransactionMetaStoreHandler` was connecting ---- add the operation into `pendingRequests`, and executed the requests in `pendingRequests` when the connected completely. 3. The complexity of concurrent operations is too high. For operations in a TransactionMetaStoreHandler, consider using single-threaded operations --- use `internalPinnedExecutor`
…ct (#13135) ### Motivation and Modification We should not throw the following exceptions to the user to deal with. 1. `TransactionCoordinatorNotFound` or `ManagerLedgerFenceException` --- we should retry the operation and reconnect to TC 2. `TransactionMetaStoreHandler` was connecting ---- add the operation into `pendingRequests`, and executed the requests in `pendingRequests` when the connected completely. 3. The complexity of concurrent operations is too high. For operations in a TransactionMetaStoreHandler, consider using single-threaded operations --- use `internalPinnedExecutor` (cherry picked from commit 56323e4)
Motivation and Modification
We should not throw the following exceptions to the user to deal with.
TransactionCoordinatorNotFound
orManagerLedgerFenceException
--- we should retry the operation and reconnect to TC
TransactionMetaStoreHandler
was connecting---- add the operation into
pendingRequests
, and executed the requests inpendingRequests
when the connected completely.--- use
internalPinnedExecutor
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If
yes
was chosen, please highlight the changesDocumentation
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
doc-required
(If you need help on updating docs, create a doc issue)
no-need-doc
(Please explain why)
doc
(If this PR contains doc changes)