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

[controller] log compaction #1282

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from

Conversation

WhitneyDeng
Copy link

Summary

  • purpose: to get stores ready for compaction based on programmatically defined criteria
  • added API endpoints to get compaction-ready stores

How was this PR tested?

unit test: filter all stores on a cluster for compaction-ready stores

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to explain your proposed changes and call out the behavior change.

Whitney Deng added 10 commits October 29, 2024 11:52
…er methods VeniceParentHelixAdmin::isCompactionReady VeniceParentHelixAdmin::isLastCompactionTimeOlderThanThresholdHours
…ForCompaction & VeniceParentHelixAdmin::isLastCompactionTimeOlderThanThresholdHours JavaDocs description

- complete description of VeniceParentHelixAdmin::getStoresForCompaction
- future tense to present tense for VeniceParentHelixAdmin::isLastCompactionTimeOlderThanThresholdHours
…:filterStoresForCompaction

- extract filterStoresForCompaction() logic for testing
- write VeniceParentHelixAdminTest::testFilterStoresForCompaction
… TestVeniceParentHelixAdmin

- migrate from integration test files to unit test files
Copy link
Contributor

@mynameborat mynameborat left a comment

Choose a reason for hiding this comment

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

Good job on putting up the first PR quickly. Looks very good. I have put in some comments.

Let me know if you have questions.

Whitney Deng added 5 commits November 6, 2024 11:38
- remodularise VeniceParentHelixAdmin::isHybridStore to function var in VeniceParentHelixAdmin::isCompactionReady
- make VeniceParentHelixAdmin::isLastCompactionTimeOlderThanThresholdHours hardcoded int to class constant
Whitney Deng added 13 commits November 21, 2024 09:10
- change exception message in child controller
interface for repush: Azkaban/Airflow implementation for Linkedin internal. (potentially) Spark implementation for OSS.
- empty implementation for now
reason: since repush will be used for diff use cases (other than compaction), the term repush should be reserved for the abstracted repush action.
- instantiate in VeniceController
- this config determines the number of threads for LogCompactionService::executor
…into CompactionManager

- create CompactionManager & TestCompactionManager
- move TestCompactionManager::testFilterStoresForCompaction from TestVeniceParentHelixAdmin
…utor setup in LogCompactionService::startInner
Whitney Deng added 4 commits November 25, 2024 16:39
- add RepushOrchestratorClassName config (to configure RepushOrchestrator implementation used)
- CompactionManager::filterStoresForCompaction return ArrayList of stores
   - update TestCompactionManager::testFilterStoresForCompaction

- create & organise logcompaction package
   - update import statements for logcompaction package classes

- create RepushJobResponse
   - RepushOrchestrator::repush returns RepushJobResponse
   - CompactionManager::compactStore receives RepushResponse -> logs success OR error
Copy link
Contributor

@mynameborat mynameborat left a comment

Choose a reason for hiding this comment

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

I took another pass and put in comments. Looks like some parts are still work in progress. Can you ping me when you have them ready for review?


@Override
public void compactStore(String storeName) {
// TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are still working on the compaction manager and this method? Can you let me know when this part is ready for review?

Copy link
Author

@WhitneyDeng WhitneyDeng Dec 6, 2024

Choose a reason for hiding this comment

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

Can I confirm that VPHA::compactStore() does nothing since the compaction is done by child controllers?

This is the plan VHA::compactStore() only calls CompactionManager::compactStore() and let CompactionManager handle the trigger response & logging. Any comments/thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Depends on what sort of thing happens within CompactionManager::compactStore. E.g., if you are invoking other APIs to get some other store metadata. My guess is it should happen on the child controller and also the leader child controller (potentially) to make sure it sees the most up-to-date store metadata e.g., version information (if at all it needs to invalidate some of the request parameters).

Copy link
Author

Choose a reason for hiding this comment

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

Let's have CompactionManager::compactStore log the response status but have VHA::compactStore receive and handle errors.

We can think of CompactionManager as an "irresponsible" class with low visibility, and all it does is execute and hands off any results back upstream.

* @see Admin#compactStore(String)
*/
public Route compactStore(Admin admin) {
return new VeniceRouteHandler<ControllerResponse>(ControllerResponse.class) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the concrete response for the compactStore? Also, this might be not necessary for the log compaction itself.

You can start w/

  • Implementing CompactionManager logic
  • Followed by injecting CompactionManager in VeniceHelixAdmin
  • Tackle the API (controller) last as it is only needed for adhoc triggers and not for LogCompactionService

Putting up the priority above so that you can get some part of the PR ready for review

@WhitneyDeng WhitneyDeng changed the title [controller] select stores for log compaction [controller] log compaction Dec 6, 2024
Whitney Deng added 3 commits December 5, 2024 16:52
- create com.linkedin.venice.controller.logcompaction in tests
- change CompactionManager::filterStoresForCompaction from public to package private
@WhitneyDeng WhitneyDeng closed this Dec 6, 2024
@WhitneyDeng WhitneyDeng deleted the log-compaction branch December 6, 2024 19:25
@WhitneyDeng WhitneyDeng restored the log-compaction branch December 6, 2024 22:11
@WhitneyDeng
Copy link
Author

closed because branch renamed to whdeng/log-compaction-repush to follow branch naming convention

@WhitneyDeng WhitneyDeng reopened this Dec 6, 2024
@WhitneyDeng
Copy link
Author

reverted branch name to log-compaction for PR continuity.

Whitney Deng added 9 commits December 6, 2024 15:08
…abled feature flat

purpose: control rollout of log compaction service
- log trigger source (for now, can expand later)
…QueryParams initialisation to take explicit clusterName directly
- since triggerRepush() is beyond the original scope of log compaction, this method is parked for later addition. adding TODO to remember thought process & design decision to use byte[] + data model class rather than QueryParams for repush job details
- CompactionManager::compactStore & VeniceHelixAdmin::compactStore logs & rethrows exception from repush
- LogCompactionService logs exception & can be extended to perform other actions to handle exception

- RepushJobResponse will be passe from RepushOrchestrator::repush through CompactionManager::compactStore & VeniceHelixAdmin::compactStore to LogCompactionService

- added execution URL to RepushJobResponse, to follow repush.py's pattern
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