Skip to content
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

ddl: Atomic rename DeltaMergeStore::db_name in memory #9246

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

JaySon-Huang
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #9233

Problem Summary:
A part of fixing #9233. In the previous code, updating DeltaMergeStore::db_name is not atomic.

What is changed and how it works?

Make renaming `DeltaMergeStore::db_name` to be atomic

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

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 22, 2024
@JaySon-Huang JaySon-Huang changed the title ddl: Atomic rename database_name in memory ddl: Atomic rename DeltaMergeStore::db_name in memory Jul 22, 2024
Copy link
Contributor

@Lloyd-Pottiger Lloyd-Pottiger left a comment

Choose a reason for hiding this comment

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

Others LGTM

dbms/src/Storages/DeltaMerge/DeltaMergeStore.h Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Jul 22, 2024
"GC - Merge skipped because current segment is not small, segment={} table={}",
segment->simpleInfo(),
table_name);
LOG_TRACE(log, "GC - Merge skipped because current segment is not small, segment={}", segment->simpleInfo());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: The logger of DeltaMergeStore contains the keyspace and table_id as a suffix. So we don't need to log down the table_name in these methods.

, log(Logger::get(fmt::format("keyspace={} table_id={}", keyspace_id_, physical_table_id_)))

@JaySon-Huang
Copy link
Contributor Author

/test pull-unit-test

Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2024

[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:
  • OWNERS [JinheLin,Lloyd-Pottiger]

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 Jul 23, 2024
Copy link
Contributor

ti-chi-bot bot commented Jul 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-22 12:54:07.764658732 +0000 UTC m=+876869.755600202: ☑️ agreed by Lloyd-Pottiger.
  • 2024-07-23 10:35:30.715258056 +0000 UTC m=+954952.706199526: ☑️ agreed by JinheLin.

@ti-chi-bot ti-chi-bot bot merged commit 4049a8c into pingcap:master Jul 23, 2024
4 of 5 checks passed
@JaySon-Huang JaySon-Huang deleted the atomic_rename_in_mem branch July 23, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants