-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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] Transaction buffer clear abort transactions #9974
[Transaction] Transaction buffer clear abort transactions #9974
Conversation
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.
Overall looks good to me.
I left a few questions, can you please take a look?
@@ -322,8 +322,12 @@ private void takeSnapshot() { | |||
}); | |||
} | |||
|
|||
|
|||
|
|||
private void clearAbortTransaction() { |
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.
What about 'clearAbortedTransactions' ?
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.
good suggestion
|
||
|
||
private void clearAbortTransaction() { | ||
while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger()) |
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.
IIRC there is an ongoing effort to not use ManafedLedgerImpl but only the interface.
Is it necessary to do this cast?
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.
ledgerExists
it is not the ManagedLedger
interface method.
private void clearAbortTransaction() { | ||
while (!aborts.isEmpty() && !((ManagedLedgerImpl) topic.getManagedLedger()) | ||
.ledgerExists(aborts.get(aborts.firstKey()).getLedgerId())) { | ||
aborts.remove(aborts.firstKey()); |
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.
Should be log the txid of the transactions that we are clearing?
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.
good, i will add the debug level log for clear aborted transaction.
/pulsarbot run-failure-checks |
/pulsarbot run-failure-checks |
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.
LGTM
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)