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 2021/03/19 09:27:34 UTC
[GitHub] [pulsar] congbobo184 opened a new pull request #9974: [Transaction] Transaction buffer clear abort transactions
congbobo184 opened a new pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974
## Motivation
Transaction buffer clear abort transactions.
## implement
check the aborts position's ledgerId whether exist in topic ```ManagedLedgerImpl``` ledgers.
### Verifying this change
Add the tests for it
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)
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on a change in pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#discussion_r599396168
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
+ while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger())
Review comment:
```ledgerExists``` it not the ```ManagedLedger``` interface method.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli merged pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
eolivelli merged pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on a change in pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#discussion_r599391143
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
Review comment:
good suggestion
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#issuecomment-804996855
/pulsarbot run-failure-checks
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] eolivelli commented on a change in pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#discussion_r598453212
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
+ while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger())
+ .ledgerExists(aborts.get(aborts.firstKey()).getLedgerId())) {
+ aborts.remove(aborts.firstKey());
Review comment:
Should be log the txid of the transactions that we are clearing?
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
+ while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger())
Review comment:
IIRC there is an ongoing effort to not use ManafedLedgerImpl but only the interface.
Is it necessary to do this cast?
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
Review comment:
What about 'clearAbortedTransactions' ?
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on a change in pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#discussion_r599396168
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
+ while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger())
Review comment:
```ledgerExists``` it is not the ```ManagedLedger``` interface method.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on a change in pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on a change in pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#discussion_r599393863
##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/transaction/buffer/impl/TopicTransactionBuffer.java
##########
@@ -322,8 +322,12 @@ private void takeSnapshot() {
});
}
-
-
+ private void clearAbortTransaction() {
+ while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger())
+ .ledgerExists(aborts.get(aborts.firstKey()).getLedgerId())) {
+ aborts.remove(aborts.firstKey());
Review comment:
good, i will add the debug level log for clear aborted transaction.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] congbobo184 commented on pull request #9974: [Transaction] Transaction buffer clear abort transactions
Posted by GitBox <gi...@apache.org>.
congbobo184 commented on pull request #9974:
URL: https://github.com/apache/pulsar/pull/9974#issuecomment-803979772
/pulsarbot run-failure-checks
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org