shuke987 opened a new pull request, #65587:
URL: https://github.com/apache/doris/pull/65587
### What problem does this PR solve?
Issue Number: None
Related PR: #62221
Problem Summary:
`BDBEnvironmentTest.testReadTxnIsNotMatched` exercises the case where a
transaction is committed locally but majority acknowledgement fails, then
verifies that the old master can still read the local transaction after restart.
The test had two timing/lifecycle gaps:
1. It read the initial record from followers immediately after the master
write, so a follower could legitimately return `NOTFOUND` before replication
became visible.
2. The Mockito `RepImpl` spy used to inject `InsufficientAcksException`
remained installed during environment shutdown and restart, allowing the mock
to affect unrelated BDB lifecycle work.
This change waits for the baseline value on each follower, limits the spy to
the injected write and restores the original implementation in `finally`, and
verifies the exact locally committed value after restart.
The assertion is intentionally limited to local durability.
`InsufficientAcksException` does not guarantee that the record was never
delivered to a follower before acknowledgement failed.
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [x] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason
Focused validation:
```text
./run-fe-ut.sh --run
'org.apache.doris.journal.bdbje.BDBEnvironmentTest#testReadTxnIsNotMatched'
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
```
Only one successful focused round was completed; additional local rounds
were skipped before PR creation.
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]