Skip to content

branch-4.0: [fix](test) stabilize BDB unmatched transaction test#65758

Open
shuke987 wants to merge 1 commit into
apache:branch-4.0from
shuke987:pick-65587-branch-4.0
Open

branch-4.0: [fix](test) stabilize BDB unmatched transaction test#65758
shuke987 wants to merge 1 commit into
apache:branch-4.0from
shuke987:pick-65587-branch-4.0

Conversation

@shuke987

@shuke987 shuke987 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

Issue Number: None

Related PR: #65587

Problem Summary:

Backport the stabilization of BDBEnvironmentTest.testReadTxnIsNotMatched to branch-4.0. The release-branch test partially mocked a live JE RepImpl with JMockit, which could miss or intercept registerVLSN inconsistently while BDB background threads were active. It also read follower state before asynchronous replication was guaranteed visible.

This tailored pick waits for the baseline value on followers, uses a method-scoped Mockito spy that throws only from postLogCommitHook, restores both original JE environment fields in finally, and verifies the exact locally committed value after restart.

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Validation:

  • Target FE UT passed twice locally.
  • git diff --check passed.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@shuke987

Copy link
Copy Markdown
Collaborator Author

run buildall

@shuke987

Copy link
Copy Markdown
Collaborator Author

/review

@shuke987
shuke987 marked this pull request as ready for review July 17, 2026 08:07
@shuke987
shuke987 requested a review from morningman as a code owner July 17, 2026 08:07

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed PR 65758. I did not find a correctness issue to raise.

This test-only backport is focused on stabilizing BDBEnvironmentTest.testReadTxnIsNotMatched: follower visibility now waits for the exact replicated key/value, the temporary RepImpl spy is confined to the injected write and both JE handle fields are restored in finally, and the reopened old master verifies the exact locally committed value.

Critical checkpoint conclusions:

  • Goal and result proof: satisfied for the intended test stabilization; the exact JE commit path logs the local commit before the mocked post-commit acknowledgement failure, and the final count/key/value checks prove recovery of that record.
  • Scope: one FE test file with no production behavior change.
  • Concurrency and lifecycle: asynchronous follower visibility, spy/original state routing, restoration, ordinary close, and fresh reopen were traced; no actionable regression remains.
  • Compatibility, configuration, protocol, persistence, FE/BE variables, observability, and data-write behavior: no production contract or runtime path is changed.
  • Parallel and special-case paths: no production or parallel test path requires a matching change.
  • Test coverage and assertion quality: the new polling condition and byte-array assertion strengthen the intended invariant without assuming that an insufficient acknowledgement means followers did not receive the record.
  • User focus: no additional user-provided review focus.

Validation was static only. The review prompt prohibits builds, and this checkout is missing thirdparty/installed and thirdparty/installed/bin/protoc. The author reports the focused FE unit test passed twice locally; the live FE UT and compile checks were still pending at review time. The repository code-review SKILL.md referenced by the runner instructions was not present in this checkout, so the bundled review contract was applied directly.

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage `` 🎉
Increment coverage report
Complete coverage report

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants