-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Storage: Refactor DMContext to avoid being misused #8318
Conversation
std::shared_lock lock(read_write_mutex); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The lock was added to protect the "schema" in very old versions(https://github.com/pingcap/tiflash/pull/507/files#diff-22b900e9e8020dc835612316f3bf151cae28b621bfac64d6a22b377d062f4b7eR165-R190). But now the members used in this function do not have concurrent issues. So this lock can be removed.
const String & tracing_id_ = "") | ||
: db_context(db_context_) | ||
: global_context(session_context_.getGlobalContext()) // always save the global context |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always save the global context no matter what the pass-in session_context
is a session only context or global context, and rename it to be global_context
/run-all-tests |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JinheLin, Lloyd-Pottiger The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/run-integration-test |
1 similar comment
/run-integration-test |
What problem does this PR solve?
Issue Number: close #8312
Problem Summary:
What is changed and how it works?
DMContext::db_context
toDMContext::global_context
DeltaMergeStore::newDMContext
that does not have concurrent issue in the latest codeCheck List
Tests
Side effects
Documentation
Release note