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

feat(storage): compactor skip sst and block related to non-existent able_id #9707

Merged
merged 2 commits into from
May 9, 2023

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented May 9, 2023

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

As we continue to create and delete tables, the residual data from the tables will still take up compactor resources. This pr skips non-existent data from the table and block perspective to reduce resource usage.

part of #9706

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)
  • All checks passed in ./risedev check (or alias, ./risedev c)

Checklist For Reviewers

  • I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.

Documentation

  • My PR DOES NOT contain user-facing changes.
Click here for Documentation

Types of user-facing changes

Please keep the types that apply to your changes, and remove the others.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

@Li0k
Copy link
Contributor Author

Li0k commented May 9, 2023

nexmark test with q1

After I manually drop q1 mv, the compactor will skip the non-existent (table) sst when build_sst_iter

image

Comment on lines 130 to 135
while self.remaining_blocks > 0 && let Some(block) = self.download_next_block().await? {
self.remaining_blocks -= 1;
let block_table_id = block.table_id();
if !self.existing_table_ids.contains(&block_table_id.table_id) {
continue;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This optimization is already done in #8489. See prune_from_valid_block_iter for details.

Copy link
Contributor

Choose a reason for hiding this comment

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

No...It seems we did not remove table-id from SstableInfo when unregister state tables

Copy link
Contributor

@Little-Wallace Little-Wallace left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented May 9, 2023

Codecov Report

Merging #9707 (6350339) into main (0ff65d1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #9707   +/-   ##
=======================================
  Coverage   70.97%   70.97%           
=======================================
  Files        1241     1241           
  Lines      207703   207713   +10     
=======================================
+ Hits       147412   147430   +18     
+ Misses      60291    60283    -8     
Flag Coverage Δ
rust 70.97% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../storage/src/hummock/compactor/compactor_runner.rs 98.38% <100.00%> (+0.65%) ⬆️

... and 5 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Li0k Li0k added this pull request to the merge queue May 9, 2023
Merged via the queue into main with commit a62abc6 May 9, 2023
@Li0k Li0k deleted the li0k/storage_skip_inexist_table_in_compactor branch May 9, 2023 10:59
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.

3 participants