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 2022/06/24 05:03:08 UTC
[GitHub] [pulsar] congbobo184 commented on a diff in pull request #15157: [feature][transaction] Add a configuration to control max active transaction of coordinator
congbobo184 commented on code in PR #15157:
URL: https://github.com/apache/pulsar/pull/15157#discussion_r905718699
##########
pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java:
##########
@@ -219,44 +222,50 @@ public CompletableFuture<TxnMeta> getTxnMeta(TxnID txnID) {
@Override
public CompletableFuture<TxnID> newTransaction(long timeOut) {
- CompletableFuture<TxnID> completableFuture = new CompletableFuture<>();
- internalPinnedExecutor.execute(() -> {
- if (!checkIfReady()) {
- completableFuture.completeExceptionally(new CoordinatorException
- .TransactionMetadataStoreStateException(tcID, State.Ready, getState(), "new Transaction"));
- return;
- }
+ if (this.maxActiveTransactionsPerCoordinator == 0
+ || this.maxActiveTransactionsPerCoordinator > txnMetaMap.size()) {
Review Comment:
Not an exact number, so no need to consider the race condition
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org