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

[ENH] Handle one-off compaction message in compaction manager #3379

Conversation

Sicheng-Pan
Copy link
Contributor

@Sicheng-Pan Sicheng-Pan commented Dec 31, 2024

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • N/A
  • New functionality
    • Following the previous PR, this PR implements the logic to handle one-off compaction message in the compaction manager. It adds the collection ids to the scheduler, which will whitelist the collections for the next compaction run only.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

Sicheng-Pan commented Dec 31, 2024

@Sicheng-Pan Sicheng-Pan marked this pull request as ready for review December 31, 2024 19:14
@Sicheng-Pan Sicheng-Pan force-pushed the 12-30-_enh_implement_compactor_server_interface branch from b4533be to 6adc66c Compare January 9, 2025 21:00
@Sicheng-Pan Sicheng-Pan force-pushed the 12-31-_enh_handle_one-off_compaction_message_in_compaction_manager branch from 30b27ce to 45b2fe6 Compare January 9, 2025 21:01
@Sicheng-Pan Sicheng-Pan force-pushed the 12-30-_enh_implement_compactor_server_interface branch from 6adc66c to f04bbfa Compare January 10, 2025 00:16
@Sicheng-Pan Sicheng-Pan force-pushed the 12-31-_enh_handle_one-off_compaction_message_in_compaction_manager branch from 45b2fe6 to 25ff5ed Compare January 10, 2025 00:17
@Sicheng-Pan Sicheng-Pan force-pushed the 12-30-_enh_implement_compactor_server_interface branch from f04bbfa to ccf3eb3 Compare January 14, 2025 22:30
@Sicheng-Pan Sicheng-Pan force-pushed the 12-31-_enh_handle_one-off_compaction_message_in_compaction_manager branch 2 times, most recently from fe94965 to 2e0c103 Compare January 15, 2025 00:25

tracing::info!("Running {} compaction jobs", job_futures.len());

job_futures
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice cleanup

&mut self,
compacted: &mut Vec<CollectionUuid>,
) -> (u32, u32) {
pub(crate) async fn compact_batch(&mut self) -> Vec<CollectionUuid> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did we change the interface of this away from num success/failed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The old interface seemed strange for me. We are able to tell the number of successful compactions using the length of the returned Vec. The number of successful/failed compactions are only examined in one test case, and not used anywhere else. I updated the interface so that it looks cleaner to me.

@Sicheng-Pan Sicheng-Pan force-pushed the 12-30-_enh_implement_compactor_server_interface branch from 2245609 to b9521bc Compare January 21, 2025 21:47
@Sicheng-Pan Sicheng-Pan force-pushed the 12-31-_enh_handle_one-off_compaction_message_in_compaction_manager branch from 2e0c103 to d2d6721 Compare January 21, 2025 21:47
@Sicheng-Pan
Copy link
Contributor Author

Sicheng-Pan commented Jan 21, 2025

Merge activity

  • Jan 21, 5:43 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 21, 5:45 PM EST: Graphite rebased this pull request as part of a merge.
  • Jan 21, 6:29 PM EST: A user merged this pull request with Graphite.

@Sicheng-Pan Sicheng-Pan changed the base branch from 12-30-_enh_implement_compactor_server_interface to graphite-base/3379 January 21, 2025 22:43
@Sicheng-Pan Sicheng-Pan changed the base branch from graphite-base/3379 to main January 21, 2025 22:44
@Sicheng-Pan Sicheng-Pan force-pushed the 12-31-_enh_handle_one-off_compaction_message_in_compaction_manager branch from d2d6721 to e3fac40 Compare January 21, 2025 22:44
@Sicheng-Pan Sicheng-Pan merged commit be27c46 into main Jan 21, 2025
79 checks passed
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.

2 participants