Skip to content
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] Fix transactionMetadata store recover timeout problem. #10162

Conversation

congbobo184
Copy link
Contributor

Motivation

  1. now recover tc use timeout is currentTime + transactionTimeout, it is not right. it need to use startTransactionTime + transactionTimeout.
  2. fix lose time out, the original logical will pop the useful transaction from the priorityQueue

implement

fix the logical of the transaction timeout.

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)

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@@ -40,11 +40,10 @@
private final TripleLongPriorityQueue priorityQueue = new TripleLongPriorityQueue();
private final long tickTimeMillis;
private final Clock clock;
private Timeout currentTimeout;
private volatile Timeout currentTimeout;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need volatile here? Seem it is protected by the synchronized.

congbo added 2 commits April 19, 2021 09:28
…r_problem

# Conflicts:
#	pulsar-transaction/coordinator/src/main/java/org/apache/pulsar/transaction/coordinator/impl/MLTransactionMetadataStore.java
@lhotari
Copy link
Member

lhotari commented Apr 21, 2021

This PR introduced a flaky test #10310 . Please fix.

field.setAccessible(true);
ConcurrentMap<TxnID, Pair<TxnMeta, List<Position>>> txnMap =
(ConcurrentMap<TxnID, Pair<TxnMeta, List<Position>>>) field.get(transactionMetadataStore);
assertEquals(txnMap.size(), 1);
Copy link
Member

@lhotari lhotari Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@congbobo184 This assertion assertEquals(txnMap.size(), 1); is flaky (#10310), could it be removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for removing it.

@lhotari can you please send a PR ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants