Skip to content

test: fix the test failure that clear_regions_in_written may be called twice#17798

Merged
ti-chi-bot[bot] merged 1 commit intotikv:masterfrom
glorv:fix-clear
Nov 11, 2024
Merged

test: fix the test failure that clear_regions_in_written may be called twice#17798
ti-chi-bot[bot] merged 1 commit intotikv:masterfrom
glorv:fix-clear

Conversation

@glorv
Copy link
Contributor

@glorv glorv commented Nov 11, 2024

What is changed and how it works?

Issue Number: Close #17797

What's Changed:

If the last call `prepare_for_region` returns `NotInCache`,
`clear_written_regions` can be called twice in both `write_impl` and
`clear`, which will cause panic. This pr changes `clear_written_regions`
to consume `self.written_regions`to avoid this kind of duplicate clear.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note

None

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. do-not-merge/needs-triage-completed labels Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 11, 2024
@glorv glorv added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Nov 11, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: overvenus, SpadeA-Tang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [SpadeA-Tang,overvenus]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Nov 11, 2024
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Nov 11, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-11 04:35:01.085853389 +0000 UTC m=+244463.276722385: ☑️ agreed by SpadeA-Tang.
  • 2024-11-11 05:39:53.763321782 +0000 UTC m=+248355.954190779: ☑️ agreed by overvenus.

@glorv
Copy link
Contributor Author

glorv commented Nov 11, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 962553d into tikv:master Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added this to the Pool milestone Nov 11, 2024
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #17800.

ti-chi-bot bot added a commit that referenced this pull request Nov 11, 2024
…d twice (#17798) (#17800)

close #17797

If the last call `prepare_for_region` returns `NotInCache`,
`clear_written_regions` can be called twice in both `write_impl` and
`clear`, which will cause panic. This pr changes `clear_written_regions`
to consume `self.written_regions`to avoid this kind of duplicate clear.

Signed-off-by: glorv <glorvs@163.com>

Co-authored-by: glorv <glorvs@163.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@glorv glorv deleted the fix-clear branch November 13, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky test: cases::test_in_memory_engine::test_load_with_eviction

4 participants