This message was deleted.
# general
s
This message was deleted.
p
The transaction coordinator will retry the commit to broker-2 until it gets committed.
k
@Penghui: Thank you for your reply. This is useful. Can you please explain little more. how many retry the TC will perform? Because the client is awaiting for the commit response
txn.commit.get()
, so if the retry is indefinite, how long will the client wait for a response? if there is any timeout happens, the client assume the commit is failed eventhough transaction coordinator still performing the retry.
p
No limitation right now. If your client can't get the response in a period of time (IO timeout), you will get an operation timeout exception. In this case, your client doesn't know what the transaction state exactly is. If the coordinator receives the request and marks the transaction as
COMMITTING
,the coordinator will retry and finally complete the transaction with
COMMITTED
with infinite retry. Another case is your client crashed while waiting for the response of the transaction commit. In this case, the client also doesn't know the transaction state. The transaction coordinator will work the same as above. You can try to re-commit the transaction for both of the above cases. The transaction coordinator will respond to an exception if the transaction has already been committed or aborted.
k
@Penghui: Thank you for your prompt response. If the transaction coordinator mark the transaction status as
COMMITTING
can I safely assume that the transaction will be guaranteed to be fully
COMMITTED
by 100%?
p
Yes
thankyou 1
k
Thank you so much for this clarification !!!
🙏 1
a
@Penghui Quick question on the statement:
You can try to re-commit the transaction for both of the above cases. The transaction coordinator will respond to an exception if the transaction has already been committed or aborted.
Please can you elaborate on how the client could re-commit the transaction if it has crashed? If the client were to create a new transaction, then how will the coordinator know if the old txn and the new one is the same?
p
@Apurva Telang Here is an example https://github.com/apache/pulsar/blob/beed0cfc52e566f3a5293f7ea37fdcc6e334b0f0/pul[…]java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java The code snippet:
Copy code
TransactionCoordinatorClient tcClient = recoverPulsarClient.getTcClient();
for (TxnID txnID : txnIDList) {
     tcClient.commit(txnID);
}
a
Understood. Thanks for the examples @Penghui!