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

add subcompaction listener #218

Merged
merged 3 commits into from
Dec 21, 2020
Merged

Conversation

tabokie
Copy link
Member

@tabokie tabokie commented Dec 10, 2020

Signed-off-by: tabokie [email protected]

Add listener for subcompaction, only called when there are actually multiple subcompactions executed in parallel.
Pass in SubcompactionJobInfo containing:

  // the id of the column family where the compaction happened.
  uint32_t cf_id;
  // the name of the column family where the compaction happened.
  std::string cf_name;
  // the status indicating whether the compaction was successful or not.
  Status status;
  // the id of the thread that completed this compaction job.
  uint64_t thread_id;
  // the smallest input level of the compaction.
  int base_input_level;
  // the output level of the compaction.
  int output_level;

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

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

what's it used for?

@tabokie
Copy link
Member Author

tabokie commented Dec 21, 2020

what's it used for?

@Connor1996 Check this comment: #216 (comment), used for tagging subcompaction IO type.

Copy link
Collaborator

@yiwu-arbug yiwu-arbug left a comment

Choose a reason for hiding this comment

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

LGTM

Status status;
// the id of the thread that completed this compaction job.
uint64_t thread_id;
// the smallest input level of the compaction.
Copy link
Member

Choose a reason for hiding this comment

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

Add job_id so we can use it to match the CompactionJobInfo later?

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems job id is only unique within each background thread, that's why I removed it.

// the job id, which is unique in the same thread.
  int job_id;

Copy link
Member Author

@tabokie tabokie Dec 21, 2020

Choose a reason for hiding this comment

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

We can put more thoughts on how to match subcompaction with main compaction later. Right now this PR covers our use case.

@tabokie tabokie merged commit 2dfbfa5 into tikv:6.4.tikv Dec 21, 2020
@tabokie tabokie deleted the subcompaction-hook branch December 23, 2020 03:17
@tabokie tabokie mentioned this pull request May 9, 2022
39 tasks
tabokie added a commit to tabokie/rocksdb that referenced this pull request May 12, 2022
Add listener for subcompaction, only called when there are actually multiple subcompactions executed in parallel.

Signed-off-by: tabokie <[email protected]>
tabokie added a commit that referenced this pull request May 12, 2022
Add listener for subcompaction, only called when there are actually multiple subcompactions executed in parallel.

Signed-off-by: tabokie <[email protected]>
tabokie added a commit to tabokie/rocksdb that referenced this pull request Aug 15, 2023
This reverts commit 2dfbfa5.

Signed-off-by: tabokie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants