Skip to content

Storages: fix a series of data race issues#9962

Merged
ti-chi-bot[bot] merged 2 commits intopingcap:masterfrom
Lloyd-Pottiger:fix-vector-tsan
Mar 11, 2025
Merged

Storages: fix a series of data race issues#9962
ti-chi-bot[bot] merged 2 commits intopingcap:masterfrom
Lloyd-Pottiger:fix-vector-tsan

Conversation

@Lloyd-Pottiger
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger commented Mar 7, 2025

What problem does this PR solve?

Issue Number: close #9961

Problem Summary:

What is changed and how it works?

1. We should not reuse anything which is not thread-safe between different queries, so do not reuse `ann_query_info` in unit tests.
2. Fix `FileCache::bgDownload` may still be running after `FileCache::shutdown`.
3. Suppress false positive alarm in `~shared_ptr`  and `re2::RE2::NumberOfCapturingGroups`.
4. Suppress alarm in `TiFlashStorageTestBasic::reload` which is only used in unit tests.
5. Fix data race between `DeltaMergeStore::segmentWaitDeltaLocalIndexReady` and `ColumnFilePersistedSet::updatePersistedColumnFilesAfterAddingIndex`

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
    Run the unit test cases with TSAN built binary
  • No code

Side effects

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

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Fix a data race issue by waiting for all background task done when shutting down under disagg arch

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-triage-completed release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 7, 2025
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 10, 2025
@Lloyd-Pottiger Lloyd-Pottiger changed the title Storages: fix TSAN error Storages: fix a series of data race or local index related issues Mar 10, 2025
@Lloyd-Pottiger Lloyd-Pottiger added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Mar 10, 2025
@JaySon-Huang
Copy link
Contributor

Fix the existing index infoes in ColumnFileTiny are missed after add new indexes.

I think you need a separate issue and fix PR for this problem

@Lloyd-Pottiger
Copy link
Contributor Author

Lloyd-Pottiger commented Mar 10, 2025

Fix the existing index infoes in ColumnFileTiny are missed after add new indexes.

I think you need a separate issue and fix PR for this problem

Open a separate issue, but IMO fix in this PR is ok, since other changes also need pick to release-8.5.

@JaySon-Huang
Copy link
Contributor

/hold
wait for #9975 merge first

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 11, 2025
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 11, 2025
@JaySon-Huang
Copy link
Contributor

/hold cancel

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. release-note-none Denotes a PR that doesn't merit a release note. labels Mar 11, 2025
@Lloyd-Pottiger Lloyd-Pottiger changed the title Storages: fix a series of data race or local index related issues Storages: fix a series of data race issues Mar 11, 2025
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Mar 11, 2025
Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, JinheLin

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 [JaySon-Huang,JinheLin]

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 Mar 11, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Mar 11, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-03-11 05:18:59.744693539 +0000 UTC m=+246695.350222463: ☑️ agreed by JinheLin.
  • 2025-03-11 07:20:09.800628636 +0000 UTC m=+253965.406157548: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot bot merged commit b25fa23 into pingcap:master Mar 11, 2025
5 checks passed
ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Mar 11, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #9982.
But this PR has conflicts, please resolve them!

@ti-chi-bot ti-chi-bot bot removed the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thread Sanitizer Failure

4 participants