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

[Enhancement] reduce tablet shard read lock holding time when calc persistent index compact score #38299

Merged
merged 1 commit into from
Jan 3, 2024
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

Conversation

luohaha
Copy link
Contributor

@luohaha luohaha commented Jan 3, 2024

Why I'm doing:
When calc persistent index compact score, if pindex not exist in index cache, we will read persistent meta from rocksdb which can be very slow. We should't hold tablet shard read lock to do this, because it will affect tablet create and drop.

What I'm doing:
Remove persistent index compact score calculation from tablet shard read lock.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

…rsistent index compact score

Signed-off-by: luohaha <18810541851@163.com>
@luohaha luohaha force-pushed the fix-pk-index-compact-calc-score branch from 47c1831 to e782047 Compare January 3, 2024 05:37
@luohaha luohaha requested a review from a team as a code owner January 3, 2024 05:37
@mergify mergify bot assigned luohaha Jan 3, 2024
@luohaha luohaha enabled auto-merge (squash) January 3, 2024 07:58
Copy link

github-actions bot commented Jan 3, 2024

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Jan 3, 2024

[BE Incremental Coverage Report]

fail : 0 / 10 (00.00%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 src/storage/olap_server.cpp 0 3 00.00% [407, 408, 409]
🔵 src/storage/tablet_manager.cpp 0 7 00.00% [708, 720, 723, 724, 725, 727, 730]

@luohaha luohaha merged commit efcb2d5 into StarRocks:main Jan 3, 2024
41 checks passed
Copy link

github-actions bot commented Jan 3, 2024

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

@Mergifyio backport branch-3.1

@github-actions github-actions bot removed the 3.1 label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

@Mergifyio backport branch-3.0

@github-actions github-actions bot removed the 3.0 label Jan 3, 2024
Copy link

github-actions bot commented Jan 3, 2024

@Mergifyio backport branch-2.5

@github-actions github-actions bot removed the 2.5 label Jan 3, 2024
Copy link
Contributor

mergify bot commented Jan 3, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jan 3, 2024

backport branch-3.1

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jan 3, 2024

backport branch-3.0

✅ Backports have been created

Copy link
Contributor

mergify bot commented Jan 3, 2024

backport branch-2.5

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (#38299)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit efcb2d5)
mergify bot pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (#38299)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit efcb2d5)
mergify bot pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (#38299)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit efcb2d5)
_update_manager->get_pindex_compaction_mgr()->schedule([&]() {
return StorageEngine::instance()->tablet_manager()->pick_tablets_to_do_pk_index_major_compaction();
});
if (config::enable_pindex_minor_compaction) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why control major compact by minor switch ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because if there is no minor compaction, we don't need to do major compaction.

mergify bot pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (#38299)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit efcb2d5)
wanpengfei-git pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (backport #38299) (#38374)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (backport #38299) (#38373)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (backport #38299) (#38371)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request Jan 3, 2024
…rsistent index compact score (backport #38299) (#38372)

Co-authored-by: Yixin Luo <18810541851@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

6 participants