[HUDI-3798] Fixing ending of a transaction by different owner and removing some extraneous methods in trxn manager#5255
Conversation
…xtra methods in trxn manager
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java
Outdated
Show resolved
Hide resolved
| writer2.start(); | ||
| countDownLatch.await(30, TimeUnit.SECONDS); | ||
| // should not have reset the state within transaction manager since the owner is different. | ||
| Assertions.assertTrue(transactionManager.getCurrentTransactionOwner().isPresent()); |
There was a problem hiding this comment.
iiuc, even in this scenario, without this patch, reset would be called and it would return w/o resetting but then unlock would also be called which we don't want. And this patch fixes this behavior. So, can we verify that not only state is not reset but also unlock is not called?
There was a problem hiding this comment.
maybe make reset method just visible for testing?
There was a problem hiding this comment.
we usually don't use VisibleForTesting annotation. lets sync up on this. we might have tests in InProcessLockProvider to assert for the condition you are talking about
There was a problem hiding this comment.
Ok found it: TestInProcessLockProvider#testLockReAcquisitionByDifferentThread. That's good enough.
Since we already use Mocito, maybe we can use its verify API to just verify calls.
…oving some extraneous methods in trxn manager (#5255)
What is the purpose of the pull request
Brief change log
Verify this pull request
This change added tests and can be verified as follows:
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.