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(compaction): add vnode watermark picker #17372

Merged
merged 12 commits into from
Jul 23, 2024

Conversation

zwang28
Copy link
Contributor

@zwang28 zwang28 commented Jun 20, 2024

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

What's changed and what's your intention?

close #17157

  • Add a new picker that picks trivial reclaim compaction task. For simplicity, this picker only takes bottommost level into consideration.
  • Extract SkipWatermarkState::from_safe_epoch_watermarks and HummockVersion::safe_epoch_table_watermarks into pure functions for easier reuse.
  • Add a CompactionSelectorContext to convey parameters to compaction selectors.

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • I have added test labels as necessary. See details.
  • I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features Sqlsmith: Sql feature generation #7934).
  • My PR contains breaking changes. (If it deprecates some features, please create a tracking issue to remove them in the future).
  • All checks passed in ./risedev check (or alias, ./risedev c)
  • My PR changes performance-critical code. (Please run macro/micro-benchmarks and show the results.)
  • My PR contains critical fixes that are necessary to be merged into the latest release. (Please check out the details)

Documentation

  • My PR needs documentation updates. (Please use the Release note section below to summarize the impact on users)

Release note

If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.

@zwang28 zwang28 requested a review from hzxa21 June 20, 2024 10:16
@zwang28 zwang28 marked this pull request as ready for review June 24, 2024 05:39
@zwang28 zwang28 requested a review from wenym1 June 24, 2024 05:39
@zwang28
Copy link
Contributor Author

zwang28 commented Jun 26, 2024

One issue is compaction tasks of dynamic type has the highest priority, potentially starving space reclaim tasks.

@hzxa21
Copy link
Collaborator

hzxa21 commented Jun 27, 2024

One issue is compaction tasks of dynamic type has the highest priority, potentially starving space reclaim tasks.

The assumptions are:

  1. dynamic task should be done ASAP because it will cause write stall
  2. dynamic task will also reclaim tombstones/space if it can

2 is not 100% valid because dynamic task will not take reclaim releated statistics like tombstone ratio into consideration. Also, for trivial reclaim task, which uses very few resource, it can be done relatively fast and won't block dynamic tasks.

However, this is a separate issue pre-exists prior to this PR so we don't need to block this PR because of that.

Copy link
Collaborator

@hzxa21 hzxa21 left a comment

Choose a reason for hiding this comment

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

LGTM.

Do we have a integration test (like the one in compaction test pipeline maybe?) to verify the effectiveness of the new picker?

@lmatz lmatz added the compaction-test trigger compaction-test on Buildkite label Jul 2, 2024
@cyliu0
Copy link
Collaborator

cyliu0 commented Jul 2, 2024

/test

@risingwave-ci
Copy link

risingwave-ci commented Jul 2, 2024

Failed: 1
Passed:0
FailedExecutions:
https://buildkite.com/risingwave-test/compaction-test/builds/176
PassedExecutions:

Please ignore this, it's failed because of the toml issue in the pipeline

@risingwave-ci
Copy link

Failed: 1
Passed:0
FailedExecutions:
https://buildkite.com/risingwave-test/compaction-test/builds/176
PassedExecutions:

@cyliu0
Copy link
Collaborator

cyliu0 commented Jul 2, 2024

/test

@risingwave-ci
Copy link

@zwang28
Copy link
Contributor Author

zwang28 commented Jul 22, 2024

Do we have a integration test (like the one in compaction test pipeline maybe?) to verify the effectiveness of the new picker?

I'm still considering how to add the corresponding tests.

@zwang28
Copy link
Contributor Author

zwang28 commented Jul 23, 2024

Do we have a integration test (like the one in compaction test pipeline maybe?) to verify the effectiveness of the new picker?

I'm still considering how to add the corresponding tests.

I ended up with adding a simulation integration test.
I didn't add one in compaction test pipeline because I needed risectl to move the table to dedicated compaction group, in order to prevent other table's compaction from complicating the tests. The compaction test pipeline doesn't support risectl yet.

@zwang28 zwang28 enabled auto-merge July 23, 2024 09:05
@zwang28 zwang28 added this pull request to the merge queue Jul 23, 2024
Merged via the queue into main with commit 285afdb Jul 23, 2024
32 of 33 checks passed
@zwang28 zwang28 deleted the wangzheng/reclaim_table_watermark branch July 23, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reclaim space more aggresively for table with vnode table watermark specificed (table with range delete)
6 participants